[cmake-developers] A type for static plugins?

Stephen Kelly steveire at gmail.com
Fri Sep 20 09:10:41 EDT 2013


Brad King wrote:

> 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.

Ok. If I don't ask I don't get :).


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

Yes, but I don't think that's better than

 add_library(mystatic_library STATIC foo.cpp)
 target_compile_definitions(mystatic_library PRIVATE QT_STATICPLUGIN)
 target_link_libraries(mystatic_library Qt5::Core)

I guess that's what I should recommend.

Thanks,

Steve.






More information about the cmake-developers mailing list