My case: I have one file which can be compiled into 4 different binaries using macros. For this I use add_definitions() and remove_definitions() commands. But as I understand these commands has global effect in CMakeLists file. How can I define and undefine macros in *one* CMakeLists file?
For this case more useful another command - set_target_properties() with property COMPILE_FLAGS. It really helped me, but I was confronted with difficulties in this way. I can't call it with 2 parameters, like set_target_properties( target PROPERTIES COMPILE_FLAGS -D__flag1__ COMPILE_FLAGS -D__flag2__ ). In this case no keys were defined... It's very strange, because CMake's documentation present usage example with multiple properties in one command. I solved this issue with variable which contains all needed keys. -- -- Andrey
_______________________________________________ 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