Steven Wilson wrote:
I am asking why CMake doesn't support the following:

set_target_properties(${TARGET} PROPERTIES COMPILE_FLAGS_<CONFIG>
"-fmyflag")


Ah...I see now, sorry for misunderstanding. That would indeed be a useful feature, much like how you can set flags for different variants in Boost.Build.

With generators that don't support configuration types, you can hack your way around it with if statements:

if( ${CMAKE_BUILD_TYPE} STREQUAL "Debug" )
  set_target_properties(...)

but that's kind of a crummy solution and won't work with the VS generator. I would also be curious to find a solution to your problem.


    Would set_target_properties() work?  Then you can do something like:

    set_target_properties( ${TARGET} PROPERTIES COMPILE_FLAGS "-fmyflag" )

    to set compile flags on a target by target basis.




--
Will Dicharry
Software Developer
Stellar Science Ltd Co

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to