[cmake-developers] A type for static plugins?

Brad King brad.king at kitware.com
Fri Sep 20 09:03:30 EDT 2013


On 09/20/2013 08:54 AM, Stephen Kelly wrote:
> Brad King wrote:
>> Other than the TYPE being a different name, how would CMake
>> treat this target type differently?
> 
> So the answer is, 'probably nothing'.

In that case I do not think we can justify a special CMake
target type for it.  All the special cases for STATIC_LIBRARY
targets will have to be updated to also account for the new
type with no difference in logic.

Can't this work with a simple explicit property?  Just put

 $<$<BOOL:$<TARGET_PROPERTY:QT_STATICPLUGIN>>:QT_STATICPLUGIN>

in Qt5::Core's INTERFACE_COMPILE_DEFINITIONS and then

 add_library(mystatic_library STATIC foo.cpp)
 set_property(TARGET mystatic_library PROPERTY QT_STATICPLUGIN 1)
 target_link_libraries(mystatic_library Qt5::Core)

-Brad



More information about the cmake-developers mailing list