summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2007-12-17 17:04:15 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2007-12-17 17:04:15 (GMT)
commit9eb207aa89256f30947feb031717050aa5a16aae (patch)
tree20b8cd31619e69b109812d9930d09d0c6973a9f5 /Modules
parent8506938407722306adeccf12b407a8e8d92a90a6 (diff)
downloadCMake-9eb207aa89256f30947feb031717050aa5a16aae.zip
CMake-9eb207aa89256f30947feb031717050aa5a16aae.tar.gz
CMake-9eb207aa89256f30947feb031717050aa5a16aae.tar.bz2
BUG: fix for bug 6167 get rid of extra space in flags
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeCInformation.cmake5
-rw-r--r--Modules/CMakeCXXInformation.cmake5
-rw-r--r--Modules/CMakeFortranInformation.cmake5
3 files changed, 12 insertions, 3 deletions
diff --git a/Modules/CMakeCInformation.cmake b/Modules/CMakeCInformation.cmake
index fec8389..543c396 100644
--- a/Modules/CMakeCInformation.cmake
+++ b/Modules/CMakeCInformation.cmake
@@ -62,8 +62,11 @@ IF(NOT CMAKE_MODULE_EXISTS)
SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
ENDIF(NOT CMAKE_MODULE_EXISTS)
-SET (CMAKE_C_FLAGS "$ENV{CFLAGS} ${CMAKE_C_FLAGS_INIT}" CACHE STRING
+SET (CMAKE_C_FLAGS "$ENV{CFLAGS}" CACHE STRING
"Flags for C compiler.")
+IF (CMAKE_C_FLAGS_INIT)
+ SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_INIT}")
+ENDIF (CMAKE_C_FLAGS_INIT)
IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
# default build type is none
diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake
index d4d1a8c..3d8460b 100644
--- a/Modules/CMakeCXXInformation.cmake
+++ b/Modules/CMakeCXXInformation.cmake
@@ -125,9 +125,12 @@ 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} ${CMAKE_CXX_FLAGS_INIT}" CACHE STRING
+SET (CMAKE_CXX_FLAGS "$ENV{CXXFLAGS}" 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
diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake
index 7484838..09880c1 100644
--- a/Modules/CMakeFortranInformation.cmake
+++ b/Modules/CMakeFortranInformation.cmake
@@ -86,8 +86,11 @@ ENDIF(NOT CMAKE_INCLUDE_FLAG_SEP_Fortran)
SET(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")
-SET (CMAKE_Fortran_FLAGS "$ENV{FFLAGS} ${CMAKE_Fortran_FLAGS_INIT}" CACHE STRING
+SET (CMAKE_Fortran_FLAGS "$ENV{FFLAGS}" CACHE STRING
"Flags for Fortran compiler.")
+IF (CMAKE_Fortran_FLAGS_INIT)
+ SET (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${CMAKE_Fortran_FLAGS_INIT}")
+ENDIF (CMAKE_Fortran_FLAGS_INIT)