On 07/21/2014 03:19 PM, Jörg Kreuzberger wrote:
1) i reset it with set( CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS_INIT} ) set( CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE_INIT} ) set( CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG_INIT} )and then append my own custom compiler definitions. "-DNDEBUG" appears in flags.make, only in CXX_FLAGS, but not in CXX_DEFINES! and this is the issue i had with it: as long it appears only in CXX_FLAGS, it works for the code compilation but it does not work for qt4_wrapp_cpp (missing defines for moc). 2) the point i want to change global compiler properties is in my toplevel CMakeLists.txt, there i do include( cmake/GlobalCompilerSettings.cmake) 3) following your example, it does not work for COMPILE_DEFINITIONS_RELEASE, but does work for COMPILE_DEFINITIONS. (works means it appears in CXX_DEFINES) using release cmake 3.0.0 version. Platform is ubuntu linux (makefile generator)
I forgot that COMPILE_DEFINITIONS_<CONFIG> were deprecated. When you require 3.0 the property is ignored (Policy CMP0043). $<$<CONFIG:Release>:NDEBUG> in COMPILE_DEFINITIONS should work. Nils -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
