Do not modify cached CMAKE_CXX_FLAGS_RELEASE Adding compiler's flags and force updating cached value of release C++ flags lead to appending special compiler flags on every edit of any CMakeList.txt. For compile result this is harmless, but was annoying slight modification of CMakeList.txt triggered full project rebuild. Now modified C++ flags are used for the whole subtree starting from the project root, but this doesn't lead to flags modified in cache. Change-Id: Ieb32bd7f96d5a09632f0b2b5325f6567be8cb5a8
diff --git a/CMakeLists.txt b/CMakeLists.txt index eee67fa..0b6e829 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt
@@ -612,8 +612,7 @@ ENDIF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") ENDIF (${BUILD_ANDROID}) ENDIF (CMAKE_COMPILER_IS_GNUCXX) - SET (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CERES_CXX_FLAGS}" - CACHE STRING "Release mode flags to the C++ Compiler" FORCE) + SET (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CERES_CXX_FLAGS}") ENDIF (CMAKE_BUILD_TYPE STREQUAL "Release") # After the tweaks for the compile settings, disable some warnings on MSVC.