I have some flags I need to set for certain builds on a single source file.
For single-configuration generators (make, nmake) it's easy enough to look at
CMAKE_BUILD_TYPE and use set_source_files_properties, like this:
if (CMAKE_BUILD_TYPE STREQUAL Debug)
set_source_files_properties( myfile.cpp PROPERTIES COMPILE_FLAGS
-DMYFLAG=asdf )
endif (CMAKE_BUILD_TYPE STREQUAL Debug)
However, for multi-configuration build types (msvc, xcode) I can't use
CMAKE_BUILD_TYPE. In fact, I'm not sure what function to use here. I could
modify the CMAKE_C_FLAGS_XXX/CMAKE_CXX_FLAGS_XXX variables, but that would
affect all the source. How can I specify a configuration type when using
set_source_files_properties? Is there some other api to use?
Thanks,
aaron
_______________________________________________
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