[CMake] set_source_files_properties per configuration

Tyler Roscoe tyler at cryptio.net
Mon Mar 22 18:58:33 EDT 2010


On Mon, Mar 22, 2010 at 06:40:21PM -0400, Simmons, Aaron wrote:
>         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

Well, there's this:

http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_sf:COMPILE_DEFINITIONS_CONFIG

I think someone else (J Decker?) recently commented on the lack of a
per-config compiler flag property. Search the archives; I don't remember
the resolution or whether someone produced a workaround.

tyler


More information about the CMake mailing list