[cmake-developers] Convention driven CMAKE_USE_PACKAGE macro

Stephen Kelly steveire at gmail.com
Sun Mar 4 17:49:15 EST 2012


Brad King wrote:
>> We can then wrap that macro with some Qt related stuff like this:
>>
>> macro(qt5_use_package _target _package)
>>      cmake_use_package(${_target} Qt5${_package} ${ARGN})
> 
> For now I suggest keeping everything inside the qt5_use_package macro.
> After it matures there we can always refactor it out later, but you
> need to be able to fix things for Qt without waiting for CMake's
> release schedule.

Yes, currently it is just being developed in a unit test anyway, but we 
might eventually be able to make it public API (would require target include 
directories, so 2.8.8 anyway). 

Trying it out there should be useful, but I'd like to develop in parallel 
the ideas for how CMake is going to involve regarding this kind of stuff.

> 
>>      get_property(_target_type TARGET ${_target} PROPERTY TYPE)
>>      if ("${_target_type}" STREQUAL "EXECUTABLE")
>>          # TODO: How can I ensure this is done only once?
>>          target_link_libraries(${_target} ${Qt5Core_WINMAIN_LIBRARY})
> 
> Set a property on the target that records whether it has already
> been done.
> 

Thanks! I'll use that technique.

Steve.





More information about the cmake-developers mailing list