Jan Woetzel wrote:
Remi Denis-Courmont wrote:

The project is compiling the same source files multiple times with different
defines, resulting in different object code... But it seems like
ADD_DEFINITIONS won't support this case.

Any solution?


You may write multiple .cpp files that #include the code.
Then use SET_SOURCE_FILES_PROPERTIES with different PROPERTIES COMPILE_FLAGS for each file.

Work great, here.

I myself use SET_TARGET_PROPERTIES to send flags to all .c files in my specific target.


SET_TARGET_PROPERTIES(libchicken PROPERTIES
 COMPILE_FLAGS "-DC_BUILDING_LIBCHICKEN ${SHARED_FLAGS}"
)

SET_TARGET_PROPERTIES(libuchicken-static PROPERTIES
 COMPILE_FLAGS "-DC_BUILDING_LIBCHICKEN -DC_UNSAFE_RUNTIME ${STATIC_FLAGS}"
)



Cheers,
Brandon Van Every

_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to