diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2008-04-21 17:04:15 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2008-04-21 17:04:15 (GMT) |
commit | aa10b4e33cd4a0c304f3cd3ffd5f0f382a6b6178 (patch) | |
tree | 9f65728434ce0f45debaa6b5dcd0549574854663 /Modules/CMakeCXXInformation.cmake | |
parent | 2eb3653d79a523b1745bd6fc7f3abc7bd0738e06 (diff) | |
download | CMake-aa10b4e33cd4a0c304f3cd3ffd5f0f382a6b6178.zip CMake-aa10b4e33cd4a0c304f3cd3ffd5f0f382a6b6178.tar.gz CMake-aa10b4e33cd4a0c304f3cd3ffd5f0f382a6b6178.tar.bz2 |
ENH: fix init flags getting stuffed into the compile line by force.
Diffstat (limited to 'Modules/CMakeCXXInformation.cmake')
-rw-r--r-- | Modules/CMakeCXXInformation.cmake | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake index 6cd2ec7..65c5902 100644 --- a/Modules/CMakeCXXInformation.cmake +++ b/Modules/CMakeCXXInformation.cmake @@ -145,13 +145,14 @@ ENDFOREACH(type) # on the initial values computed in the platform/*.cmake files # use _INIT variables so that this only happens the first time # and you can set these flags in the cmake cache -SET (CMAKE_CXX_FLAGS "$ENV{CXXFLAGS}" CACHE STRING +SET(CMAKE_CXX_FLAGS_INIT "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_INIT}") +# avoid just having a space as the initial value for the cache +IF(CMAKE_CXX_FLAGS_INIT STREQUAL " ") + SET(CMAKE_CXX_FLAGS_INIT) +ENDIF(CMAKE_CXX_FLAGS_INIT STREQUAL " ") +SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT}" CACHE STRING "Flags used by the compiler during all build types.") -IF (CMAKE_CXX_FLAGS_INIT) - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_INIT}") -ENDIF (CMAKE_CXX_FLAGS_INIT) - IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS) SET (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG_INIT}" CACHE STRING "Flags used by the compiler during debug builds.") |