[cmake-developers] A type for static plugins?
Stephen Kelly
steveire at gmail.com
Sat Sep 21 06:29:14 EDT 2013
Brad King wrote:
> On 09/20/2013 01:40 PM, Stephen Kelly wrote:
>> macro(qt_add_plugin name type)
>> if (${type} STREQUAL STATIC OR ${type} STREQUAL MODULE)
>> set(_type ${type})
>> set(args ${ARGN})
>> else()
>> set(_type MODULE)
>> set(args ${type} ${ARGN})
>> endif()
>> add_library(${name} ${_type} ${ARGN})
>
> s/ARGN/args/ ?
Yes.
>
>> if (_type STREQUAL STATIC)
>> set_target_properties(${name} PROPERTIES
>> PLUGIN "1"
>> # Not sure if this is a Qt/KDE convention:
>> PREFIX ""
>> )
>> endif()
>> endmacro()
>
> Don't you want an empty prefix for MODULE too?
Yes. I was assuming the existence of
set(CMAKE_SHARED_MODULE_PREFIX "")
Actually the empty prefix doesn't seem to be a Qt convention, only a KDE
one:
stephen at hal:~/dev/build/qtbase/qtbase$ l plugins/imageformats/
libqgif.so* libqico.so* libqjpeg.so*
So it wouldn't belong in a qt_add_plugin macro anyway, and kde would need
its own wrapper macro to set the prefix.
Those layers of wrapper macros are exactly what I'm aiming to avoid with
modern CMake patterns, so I will not add the qt_add_plugin macro to Qt 5.
Thanks,
Steve.
More information about the cmake-developers
mailing list