summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-03-15 09:00:31 -0400
committerBrad King <brad.king@kitware.com>2010-03-15 15:17:18 -0400
commitfd38eda9fe92dea61372e3ee1b54dfa49d6bddce (patch)
tree138f9f2c7f3c92594d942b8205c892df44aebfec /Modules
parentebdda6ed138173a287e52d7877c528ec8ccc817f (diff)
downloadcmake-fd38eda9fe92dea61372e3ee1b54dfa49d6bddce.tar.gz
Support multiple arguments in CC,CXX,FC values
Teach compiler identification to support values such as export CC='gcc -g -O2' by separating the arguments on spaces. We already do this for the values of CFLAGS, CXXFLAGS, and FFLAGS.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index bddd6a1e8b..4a800a8ea0 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -19,6 +19,7 @@
FUNCTION(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
# Make sure the compiler arguments are clean.
STRING(STRIP "${CMAKE_${lang}_COMPILER_ARG1}" CMAKE_${lang}_COMPILER_ID_ARG1)
+ STRING(REGEX REPLACE " +" ";" CMAKE_${lang}_COMPILER_ID_ARG1 "${CMAKE_${lang}_COMPILER_ID_ARG1}")
# Make sure user-specified compiler flags are used.
IF(CMAKE_${lang}_FLAGS)