Commit 36dd18ef authored by Bill Hoffman's avatar Bill Hoffman

ENH: stuff to keep compiler tests from re-running all the time

parent beb584e7
......@@ -10,11 +10,7 @@ IF(CMAKE_COMPILER_IS_CYGWIN)
SET(UNIX 1)
ENDIF(CMAKE_COMPILER_IS_CYGWIN)
SET(CMAKE_VC_COMPILER_TESTS_RUN 1)
SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE @CMAKE_COMPILER_SUPPORTS_PDBTYPE@)
SET(CMAKE_COMPILER_2005 @CMAKE_COMPILER_2005@)
SET(CMAKE_USING_VC_FREE_TOOLS @CMAKE_USING_VC_FREE_TOOLS@)
SET(CMAKE_C_COMPILER_ENV_VAR "CC")
IF(CMAKE_COMPILER_IS_MINGW)
SET(MINGW 1)
......
SET(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@")
SET(CMAKE_COMPILER_IS_GNUCXX @CMAKE_COMPILER_IS_GNUCXX@)
SET(CMAKE_CXX_COMPILER_LOADED 1)
SET(CMAKE_COMPILER_IS_GNUCC_RUN 1)
SET(CMAKE_VC_COMPILER_TESTS_RUN 1)
SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE @CMAKE_COMPILER_SUPPORTS_PDBTYPE@)
SET(CMAKE_COMPILER_2005 @CMAKE_COMPILER_2005@)
SET(CMAKE_USING_VC_FREE_TOOLS @CMAKE_USING_VC_FREE_TOOLS@)
SET(CMAKE_COMPILER_IS_GNUCXX_RUN 1)
SET(CMAKE_CXX_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
SET(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm)
......@@ -17,3 +11,4 @@ IF(UNIX)
ELSE(UNIX)
SET(CMAKE_CXX_OUTPUT_EXTENSION .obj)
ENDIF(UNIX)
SET(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
......@@ -86,4 +86,5 @@ ENDIF(NOT CMAKE_COMPILER_IS_GNUCC_RUN)
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
${CMAKE_BINARY_DIR}/CMakeCCompiler.cmake IMMEDIATE)
MARK_AS_ADVANCED(CMAKE_AR)
SET(CMAKE_C_COMPILER_ENV_VAR "CC")
......@@ -22,3 +22,4 @@ IF(UNIX)
ELSE(UNIX)
SET(CMAKE_Fortran_OUTPUT_EXTENSION .obj)
ENDIF(UNIX)
SET(CMAKE_Fortran_COMPILER_ENV_VAR "FC")
......@@ -8,3 +8,4 @@ SET(CMAKE_Java_LINKER_PREFERENCE Prefered)
SET(CMAKE_Java_OUTPUT_EXTENSION .class)
SET(CMAKE_STATIC_LIBRARY_PREFIX_Java "")
SET(CMAKE_STATIC_LIBRARY_SUFFIX_Java ".jar")
SET(CMAKE_Java_COMPILER_ENV_VAR "JAVA_COMPILER")
......@@ -2,3 +2,4 @@ SET(CMAKE_RC_COMPILER "@CMAKE_RC_COMPILER@")
SET(CMAKE_RC_COMPILER_LOADED 1)
SET(CMAKE_RC_SOURCE_FILE_EXTENSIONS rc)
SET(CMAKE_RC_OUTPUT_EXTENSION .res)
SET(CMAKE_RC_COMPILER_ENV_VAR "RC")
......@@ -12,7 +12,8 @@ IF(NOT CMAKE_C_COMPILER_WORKS)
"int main(){return 0;}\n")
TRY_COMPILE(CMAKE_C_COMPILER_WORKS ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/CMakeTmp/testCCompiler.c
OUTPUT_VARIABLE OUTPUT)
OUTPUT_VARIABLE OUTPUT)
SET(C_TEST_WAS_RUN 1)
ENDIF(NOT CMAKE_C_COMPILER_WORKS)
IF(NOT CMAKE_C_COMPILER_WORKS)
......@@ -25,8 +26,11 @@ IF(NOT CMAKE_C_COMPILER_WORKS)
"with the following output:\n ${OUTPUT}\n\n"
"CMake will not be able to correctly generate this project.")
ELSE(NOT CMAKE_C_COMPILER_WORKS)
MESSAGE(STATUS "Check for working C compiler: ${CMAKE_C_COMPILER} -- works")
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
"Determining if the C compiler works passed with "
"the following output:\n${OUTPUT}\n\n")
IF(C_TEST_WAS_RUN)
MESSAGE(STATUS "Check for working C compiler: ${CMAKE_C_COMPILER} -- works")
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
"Determining if the C compiler works passed with "
"the following output:\n${OUTPUT}\n\n")
ENDIF(C_TEST_WAS_RUN)
SET(CMAKE_C_COMPILER_WORKS 1 CACHE INTERNAL "")
ENDIF(NOT CMAKE_C_COMPILER_WORKS)
......@@ -13,6 +13,7 @@ IF(NOT CMAKE_CXX_COMPILER_WORKS)
TRY_COMPILE(CMAKE_CXX_COMPILER_WORKS ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/CMakeTmp/testCXXCompiler.cxx
OUTPUT_VARIABLE OUTPUT)
SET(CXX_TEST_WAS_RUN 1)
ENDIF(NOT CMAKE_CXX_COMPILER_WORKS)
IF(NOT CMAKE_CXX_COMPILER_WORKS)
......@@ -25,8 +26,11 @@ IF(NOT CMAKE_CXX_COMPILER_WORKS)
"with the following output:\n ${OUTPUT}\n\n"
"CMake will not be able to correctly generate this project.")
ELSE(NOT CMAKE_CXX_COMPILER_WORKS)
MESSAGE(STATUS "Check for working CXX compiler: ${CMAKE_CXX_COMPILER} -- works")
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
"Determining if the CXX compiler works passed with "
"the following output:\n${OUTPUT}\n\n")
IF(CXX_TEST_WAS_RUN)
MESSAGE(STATUS "Check for working CXX compiler: ${CMAKE_CXX_COMPILER} -- works")
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
"Determining if the CXX compiler works passed with "
"the following output:\n${OUTPUT}\n\n")
ENDIF(CXX_TEST_WAS_RUN)
SET(CMAKE_CXX_COMPILER_WORKS 1 CACHE INTERNAL "")
ENDIF(NOT CMAKE_CXX_COMPILER_WORKS)
# try to load any previously computed information for C on this platform
INCLUDE( ${CMAKE_BINARY_DIR}/CMakeCPlatform.cmake OPTIONAL)
SET(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:")
SET(CMAKE_LINK_LIBRARY_FLAG "")
SET(WIN32 1)
......@@ -55,14 +58,22 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual
MARK_AS_ADVANCED(CMAKE_CONFIGURATION_TYPES CMAKE_CXX_STACK_SIZE CMAKE_CXX_WARNING_LEVEL)
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8")
# does the compiler support pdbtype and is it the newer compiler
SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 1)
SET(CMAKE_COMPILER_2005 0)
IF(CMAKE_GENERATOR MATCHES "Visual Studio 8")
SET(CMAKE_COMPILER_2005 1)
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8")
# for nmake we need to compute some information about the compiler
# that is being used.
# the compiler may be free command line, 6, 7, or 71, and
# each have properties that must be determined.
# to avoid running these tests with each cmake run, the
# test results are saved in CMakeCPlatform.cmake, a file
# that is automatically copied into try_compile directories
# by the global generator.
IF(CMAKE_GENERATOR MATCHES "NMake Makefiles")
IF(NOT CMAKE_VC_COMPILER_TESTS_RUN)
SET(CMAKE_VC_COMPILER_TESTS 1)
MESSAGE("running CMAKE_VC_COMPILER_TESTS_RUN")
EXEC_PROGRAM(${CMAKE_C_COMPILER}
ARGS /nologo -EP \"${CMAKE_ROOT}/Modules/CMakeTestNMakeCLVersion.c\"
OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT
......@@ -71,9 +82,13 @@ IF(CMAKE_GENERATOR MATCHES "NMake Makefiles")
IF(NOT CMAKE_COMPILER_RETURN)
IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*VERSION=1[3-9][0-9][0-9].*" )
SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0)
ELSE("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*VERSION=1[3-9][0-9][0-9].*" )
SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 1)
ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*VERSION=1[3-9][0-9][0-9].*" )
IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*VERSION=1[4-9][0-9][0-9].*" )
SET(CMAKE_COMPILER_2005 1)
ELSE("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*VERSION=1[4-9][0-9][0-9].*" )
SET(CMAKE_COMPILER_2005 0)
ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*VERSION=1[4-9][0-9][0-9].*" )
ENDIF(NOT CMAKE_COMPILER_RETURN)
# try to figure out if we are running the free command line
......@@ -91,7 +106,6 @@ IF(CMAKE_GENERATOR MATCHES "NMake Makefiles")
ELSE(CMAKE_COMPILER_RETURN)
SET(CMAKE_USING_VC_FREE_TOOLS 0)
ENDIF(CMAKE_COMPILER_RETURN)
SET(CMAKE_VC_COMPILER_TESTS_RUN 1 CACHE INTERNAL "")
ENDIF(NOT CMAKE_VC_COMPILER_TESTS_RUN)
ENDIF(CMAKE_GENERATOR MATCHES "NMake Makefiles")
......@@ -164,3 +178,8 @@ SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBU
SET (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT})
SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT})
SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT})
# save computed information for this platform
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake.in
${CMAKE_BINARY_DIR}/CMakeCPlatform.cmake IMMEDIATE)
SET(CMAKE_VC_COMPILER_TESTS_RUN 1)
SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE @CMAKE_COMPILER_SUPPORTS_PDBTYPE@)
SET(CMAKE_COMPILER_2005 @CMAKE_COMPILER_2005@)
SET(CMAKE_USING_VC_FREE_TOOLS @CMAKE_USING_VC_FREE_TOOLS@)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment