summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeFortranInformation.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-07-01 17:52:10 (GMT)
committerBrad King <brad.king@kitware.com>2016-07-01 18:01:41 (GMT)
commit3643390d49b567214f9008091aa0e1f4ebe7782a (patch)
treee310832801d5fa8af2e33601391685a3b753669c /Modules/CMakeFortranInformation.cmake
parent4c476cc9b2441f7cf36fd87c7c7338c373905678 (diff)
downloadCMake-3643390d49b567214f9008091aa0e1f4ebe7782a.zip
CMake-3643390d49b567214f9008091aa0e1f4ebe7782a.tar.gz
CMake-3643390d49b567214f9008091aa0e1f4ebe7782a.tar.bz2
Strip CMAKE_<LANG>_FLAGS[_<CONFIG>] initializer whitespace
Diffstat (limited to 'Modules/CMakeFortranInformation.cmake')
-rw-r--r--Modules/CMakeFortranInformation.cmake9
1 files changed, 5 insertions, 4 deletions
diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake
index 1fd0972..45dbfcc 100644
--- a/Modules/CMakeFortranInformation.cmake
+++ b/Modules/CMakeFortranInformation.cmake
@@ -173,10 +173,11 @@ endif()
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_INIT "$ENV{FFLAGS} ${CMAKE_Fortran_FLAGS_INIT}")
-# avoid just having a space as the initial value for the cache
-if(CMAKE_Fortran_FLAGS_INIT STREQUAL " ")
- set(CMAKE_Fortran_FLAGS_INIT)
-endif()
+
+foreach(c "" _DEBUG _RELEASE _MINSIZEREL _RELWITHDEBINFO)
+ string(STRIP "${CMAKE_Fortran_FLAGS${c}_INIT}" CMAKE_Fortran_FLAGS${c}_INIT)
+endforeach()
+
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_INIT}" CACHE STRING
"Flags for Fortran compiler.")