diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2002-11-19 23:17:17 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2002-11-19 23:17:17 (GMT) |
commit | 5a75e03037b946abe56563fa1b568496f309ef5d (patch) | |
tree | 23f08815b01fea1e7216fac52a293ed347f73ad2 /Modules/CMakeDetermineCXXCompiler.cmake | |
parent | 939035ad91aff5de5a1b514176cd2765a1b9a728 (diff) | |
download | CMake-5a75e03037b946abe56563fa1b568496f309ef5d.zip CMake-5a75e03037b946abe56563fa1b568496f309ef5d.tar.gz CMake-5a75e03037b946abe56563fa1b568496f309ef5d.tar.bz2 |
allow flags to be in the CC and CXX environment variables
Diffstat (limited to 'Modules/CMakeDetermineCXXCompiler.cmake')
-rw-r--r-- | Modules/CMakeDetermineCXXCompiler.cmake | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index 24ba288..101786a 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -8,12 +8,11 @@ IF(NOT CMAKE_CXX_COMPILER) # if the user has specified CC via the environment, then use that without checking IF($ENV{CXX} MATCHES ".+") - SET(CMAKE_CXX_COMPILER_INIT $ENV{CXX}) - # make sure we can find it - FIND_PROGRAM(CMAKE_CXX_COMPILER_FULLPATH NAMES $ENV{CXX}) - IF(NOT CMAKE_CXX_COMPILER_FULLPATH) - MESSAGE(SEND_ERROR "Could not find compiler set in environment variable CXX:\n$ENV{CXX}, make sure CXX does not have flags in it, use CXXFLAGS instead.") - ENDIF(NOT CMAKE_CXX_COMPILER_FULLPATH) + GET_FILENAME_COMPONENT(CMAKE_CXX_COMPILER_INIT $ENV{CXX} PROGRAM PROGRAM_ARGS CMAKE_CXX_FLAGS_ENV_INIT) + IF(EXISTS ${CMAKE_CXX_COMPILER_INIT}) + ELSE(EXISTS ${CMAKE_CXX_COMPILER_INIT}) + MESSAGE(SEND_ERROR "Could not find compiler set in environment variable CXX:\n$ENV{CXX}.") + ENDIF(EXISTS ${CMAKE_CXX_COMPILER_INIT}) ELSE($ENV{CXX} MATCHES ".+") # if not in the envionment then search for the compiler in the path SET(CMAKE_CXX_COMPILER_LIST ${CMAKE_GENERATOR_CXX} c++ g++ CC aCC cl bcc ) |