summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2003-01-22 12:29:37 -0500
committerBill Hoffman <bill.hoffman@kitware.com>2003-01-22 12:29:37 -0500
commit950399ec9dc30ee95be88ac11914e454576a1b38 (patch)
tree70ef06be9612f01a4334caa1b5d86bbeb8a75e06 /Modules
parent93265d84be040c11eb1906d764a0a4b3b11b8389 (diff)
downloadcmake-950399ec9dc30ee95be88ac11914e454576a1b38.tar.gz
ENH: only run test for working c and cxx compiler once
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeTestCCompiler.cmake13
-rw-r--r--Modules/CMakeTestCXXCompiler.cmake12
2 files changed, 15 insertions, 10 deletions
diff --git a/Modules/CMakeTestCCompiler.cmake b/Modules/CMakeTestCCompiler.cmake
index 8e88c0afe7..b6d33838da 100644
--- a/Modules/CMakeTestCCompiler.cmake
+++ b/Modules/CMakeTestCCompiler.cmake
@@ -3,11 +3,14 @@
# and like the most basic of programs. If not, a fatel error
# is set and cmake stops processing commands and will not generate
# any makefiles or projects.
-MESSAGE(STATUS "Check for working C compiler: ${CMAKE_C_COMPILER}")
-WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeTmp/testCCompiler.c "int main(){return 0;}")
-TRY_COMPILE(CMAKE_C_COMPILER_WORKS ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}/CMakeTmp/testCCompiler.c
- OUTPUT_VARIABLE OUTPUT)
+IF(NOT CMAKE_C_COMPILER_WORKS)
+ MESSAGE(STATUS "Check for working C compiler: ${CMAKE_C_COMPILER}")
+ WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeTmp/testCCompiler.c "int main(){return 0;}")
+ TRY_COMPILE(CMAKE_C_COMPILER_WORKS ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/CMakeTmp/testCCompiler.c
+ OUTPUT_VARIABLE OUTPUT)
+ENDIF(NOT CMAKE_C_COMPILER_WORKS)
+
IF(NOT CMAKE_C_COMPILER_WORKS)
MESSAGE(STATUS "Check for working C compiler: ${CMAKE_C_COMPILER} -- broken")
MESSAGE(FATAL_ERROR "The C compiler \"${CMAKE_C_COMPILER}\" "
diff --git a/Modules/CMakeTestCXXCompiler.cmake b/Modules/CMakeTestCXXCompiler.cmake
index 5609c963f6..4c227be9f1 100644
--- a/Modules/CMakeTestCXXCompiler.cmake
+++ b/Modules/CMakeTestCXXCompiler.cmake
@@ -3,11 +3,13 @@
# and like the most basic of programs. If not, a fatel error
# is set and cmake stops processing commands and will not generate
# any makefiles or projects.
-MESSAGE(STATUS "Check for working CXX compiler: ${CMAKE_CXX_COMPILER}")
-WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeTmp/testCXXCompiler.cxx "int main(){return 0;}")
-TRY_COMPILE(CMAKE_CXX_COMPILER_WORKS ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}/CMakeTmp/testCXXCompiler.cxx
- OUTPUT_VARIABLE OUTPUT)
+IF(NOT CMAKE_CXX_COMPILER_WORKS)
+ MESSAGE(STATUS "Check for working CXX compiler: ${CMAKE_CXX_COMPILER}")
+ WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeTmp/testCXXCompiler.cxx "int main(){return 0;}")
+ TRY_COMPILE(CMAKE_CXX_COMPILER_WORKS ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/CMakeTmp/testCXXCompiler.cxx
+ OUTPUT_VARIABLE OUTPUT)
+ENDIF(NOT CMAKE_CXX_COMPILER_WORKS)
IF(NOT CMAKE_CXX_COMPILER_WORKS)
MESSAGE(STATUS "Check for working CXX compiler: ${CMAKE_CXX_COMPILER} -- broken")
MESSAGE(FATAL_ERROR "The C++ compiler \"${CMAKE_CXX_COMPILER}\" "