ENH: Cleanups and add missing CMakeOutput.log and CMakeError.log appending. Close Bug #136 - Verify that all modules that do try compile produce CMakeError.log and CMakeOutput.log
This commit is contained in:
parent
565ed7d8a1
commit
8149dbed29
|
@ -51,6 +51,13 @@ EXEC_PROGRAM(${CMAKE_C_COMPILER} ARGS -E ${CMAKE_ROOT}/Modules/CMakeTestGNU.c OU
|
|||
IF(NOT CMAKE_COMPILER_RETURN)
|
||||
IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
|
||||
SET(CMAKE_COMPILER_IS_GNUCC 1)
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
|
||||
"Determining if the C compiler is GNU succeeded with "
|
||||
"the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n")
|
||||
ELSE("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
|
||||
"Determining if the C compiler is GNU failed with "
|
||||
"the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n")
|
||||
ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
|
||||
ENDIF(NOT CMAKE_COMPILER_RETURN)
|
||||
|
||||
|
|
|
@ -44,6 +44,13 @@ EXEC_PROGRAM(${CMAKE_CXX_COMPILER} ARGS -E ${CMAKE_ROOT}/Modules/CMakeTestGNU.c
|
|||
IF(NOT CMAKE_COMPILER_RETURN)
|
||||
IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
|
||||
SET(CMAKE_COMPILER_IS_GNUCXX 1)
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
|
||||
"Determining if the C++ compiler is GNU succeeded with "
|
||||
"the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n")
|
||||
ELSE("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
|
||||
"Determining if the C++ compiler is GNU failed with "
|
||||
"the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n")
|
||||
ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
|
||||
ENDIF(NOT CMAKE_COMPILER_RETURN)
|
||||
|
||||
|
|
|
@ -62,6 +62,9 @@ IF(CMAKE_SYSTEM_VERSION)
|
|||
ENDIF(CMAKE_SYSTEM_VERSION)
|
||||
|
||||
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
|
||||
"The system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n")
|
||||
|
||||
# configure variables set in this file for fast reload
|
||||
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeSystem.cmake.in
|
||||
${CMAKE_BINARY_DIR}/CMakeSystem.cmake IMMEDIATE)
|
||||
|
|
|
@ -17,6 +17,12 @@ IF(NOT CMAKE_C_COMPILER_WORKS)
|
|||
"is not able to compile a simple test program.\nIt fails "
|
||||
"with the following output:\n ${OUTPUT}\n\n"
|
||||
"CMake will not be able to correctly generate this project.")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log
|
||||
"Determining if the C compiler works failed with "
|
||||
"the following output:\n${OUTPUT}\n\n")
|
||||
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")
|
||||
ENDIF(NOT CMAKE_C_COMPILER_WORKS)
|
||||
|
|
|
@ -16,6 +16,12 @@ IF(NOT CMAKE_CXX_COMPILER_WORKS)
|
|||
"is not able to compile a simple test program.\nIt fails "
|
||||
"with the following output:\n ${OUTPUT}\n\n"
|
||||
"CMake will not be able to correctly generate this project.")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log
|
||||
"Determining if the CXX compiler works failed with "
|
||||
"the following output:\n${OUTPUT}\n\n")
|
||||
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")
|
||||
ENDIF(NOT CMAKE_CXX_COMPILER_WORKS)
|
||||
|
|
|
@ -5,5 +5,5 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
|
|||
"c:/Program Files/Microsoft Visual Studio/Common/MSDev98/Bin"
|
||||
"c:/Program Files/Microsoft Visual Studio/Common/MSDev98/Bin"
|
||||
"/Program Files/Microsoft Visual Studio/Common/MSDev98/Bin"
|
||||
)
|
||||
)
|
||||
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
|
||||
|
|
|
@ -5,5 +5,5 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
|
|||
"c:/Program Files/Microsoft Visual Studio .NET/Common7/IDE"
|
||||
"c:/Program Files/Microsoft Visual Studio.NET/Common7/IDE"
|
||||
"/Program Files/Microsoft Visual Studio .NET/Common7/IDE/"
|
||||
)
|
||||
)
|
||||
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
|
||||
|
|
|
@ -5,5 +5,5 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
|
|||
"c:/Program Files/Microsoft Visual Studio .NET/Common7/IDE"
|
||||
"c:/Program Files/Microsoft Visual Studio.NET/Common7/IDE"
|
||||
"/Program Files/Microsoft Visual Studio .NET/Common7/IDE/"
|
||||
)
|
||||
)
|
||||
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
|
||||
|
|
|
@ -24,6 +24,9 @@ MACRO(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
|
|||
IF(${VARIABLE})
|
||||
SET(${VARIABLE} 1 CACHE INTERNAL "Have function ${FUNCTION}")
|
||||
MESSAGE(STATUS "Looking for ${FUNCTION} - found")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
|
||||
"Determining if the function ${FUNCTION} exists passed with the following output:\n"
|
||||
"${OUTPUT}\n\n")
|
||||
ELSE(${VARIABLE})
|
||||
MESSAGE(STATUS "Looking for ${FUNCTION} - not found")
|
||||
SET(${VARIABLE} "" CACHE INTERNAL "Have function ${FUNCTION}")
|
||||
|
|
|
@ -22,6 +22,10 @@ MACRO(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
|
|||
IF(${VARIABLE})
|
||||
MESSAGE(STATUS "Looking for ${INCLUDE} - found")
|
||||
SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
|
||||
"Determining if the include file ${INCLUDE} "
|
||||
"exists passed with the following output:\n"
|
||||
"${OUTPUT}\n\n")
|
||||
ELSE(${VARIABLE})
|
||||
MESSAGE(STATUS "Looking for ${INCLUDE} - not found.")
|
||||
SET(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}")
|
||||
|
|
|
@ -19,6 +19,10 @@ MACRO(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
|
|||
IF(${VARIABLE})
|
||||
MESSAGE(STATUS "Checking for CXX include file ${INCLUDE} -- found")
|
||||
SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
|
||||
"Determining if the include file ${INCLUDE} "
|
||||
"exists passed with the following output:\n"
|
||||
"${OUTPUT}\n\n")
|
||||
ELSE(${VARIABLE})
|
||||
MESSAGE(STATUS "Checking for CXX include file ${INCLUDE} -- not found")
|
||||
SET(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}")
|
||||
|
|
|
@ -29,6 +29,10 @@ MACRO(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
|
|||
IF(${VARIABLE})
|
||||
MESSAGE(STATUS "Looking for include files ${VARIABLE} - found")
|
||||
SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${VARIABLE}")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
|
||||
"Determining if files ${INCLUDE} "
|
||||
"exist passed with the following output:\n"
|
||||
"${OUTPUT}\n\n")
|
||||
ELSE(${VARIABLE})
|
||||
MESSAGE(STATUS "Looking for include files ${VARIABLE} - not found.")
|
||||
SET(${VARIABLE} "" CACHE INTERNAL "Have includes ${VARIABLE}")
|
||||
|
|
|
@ -28,6 +28,10 @@ MACRO(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
|
|||
IF(${VARIABLE})
|
||||
MESSAGE(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - found")
|
||||
SET(${VARIABLE} 1 CACHE INTERNAL "Have library ${LIBRARY}")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
|
||||
"Determining if the function ${FUNCTION} exists in the ${LIBRARY} "
|
||||
"passed with the following output:\n"
|
||||
"${OUTPUT}\n\n")
|
||||
ELSE(${VARIABLE})
|
||||
MESSAGE(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - not found")
|
||||
SET(${VARIABLE} "" CACHE INTERNAL "Have library ${LIBRARY}")
|
||||
|
|
|
@ -31,6 +31,8 @@ MACRO(CHECK_TYPE_SIZE TYPE VARIABLE)
|
|||
OUTPUT_VARIABLE OUTPUT)
|
||||
IF(HAVE_${VARIABLE})
|
||||
MESSAGE(STATUS "Check size of ${TYPE} - done")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
|
||||
"Determining size of ${TYPE} passed with the following output:\n${OUTPUT}\n\n")
|
||||
ELSE(HAVE_${VARIABLE})
|
||||
MESSAGE(STATUS "Check size of ${TYPE} - failed")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log
|
||||
|
|
|
@ -23,6 +23,9 @@ MACRO(CHECK_VARIABLE_EXISTS VAR VARIABLE)
|
|||
IF(${VARIABLE})
|
||||
SET(${VARIABLE} 1 CACHE INTERNAL "Have variable ${VAR}")
|
||||
MESSAGE(STATUS "Looking for ${VARIABLE} - found")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
|
||||
"Determining if the variable ${VAR} exists passed with the following output:\n"
|
||||
"${OUTPUT}\n\n")
|
||||
ELSE(${VARIABLE})
|
||||
SET(${VARIABLE} "" CACHE INTERNAL "Have variable ${VAR}")
|
||||
MESSAGE(STATUS "Looking for ${VARIABLE} - not found")
|
||||
|
|
|
@ -5,12 +5,30 @@
|
|||
#
|
||||
|
||||
MACRO(TEST_BIG_ENDIAN VARIABLE)
|
||||
IF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
|
||||
TRY_RUN(${VARIABLE} HAVE_${VARIABLE}
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_ROOT}/Modules/TestBigEndian.c
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
IF(NOT HAVE_${VARIABLE})
|
||||
MESSAGE(STATUS "Check if the system is big endian")
|
||||
IF(HAVE_${VARIABLE})
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log
|
||||
"Determining the endianes of the system passed. The system is ")
|
||||
IF(${VARIABLE})
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log
|
||||
"big endian")
|
||||
MESSAGE(STATUS "Check if the system is big endian - big endian")
|
||||
ELSE(${VARIABLE})
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log
|
||||
"little endian")
|
||||
MESSAGE(STATUS "Check if the system is big endian - little endian")
|
||||
ENDIF(${VARIABLE})
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log
|
||||
"Test produced following output:\n${OUTPUT}\n\n")
|
||||
ELSE(HAVE_${VARIABLE})
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log
|
||||
"Determining the endianes of the system failed with the following output:\n${OUTPUT}\n\n")
|
||||
ENDIF(NOT HAVE_${VARIABLE})
|
||||
MESSAGE("Check if the system is big endian - failed")
|
||||
ENDIF(HAVE_${VARIABLE})
|
||||
ENDIF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
|
||||
ENDMACRO(TEST_BIG_ENDIAN)
|
||||
|
|
|
@ -15,8 +15,13 @@ MACRO(CHECK_CXX_ACCEPTS_FLAG FLAGS VARIABLE)
|
|||
OUTPUT_VARIABLE OUTPUT)
|
||||
IF(${VARIABLE})
|
||||
MESSAGE(STATUS "Checking to see if CXX compiler acepts flag ${FLAGS} - yes")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
|
||||
"Determining if the CXX compiler accepts the flag ${FLAGS} passed with "
|
||||
"the following output:\n${OUTPUT}\n\n")
|
||||
ELSE(${VARIABLE})
|
||||
MESSAGE(STATUS "Checking to see if CXX compiler acepts flag ${FLAGS} - no")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log
|
||||
"Determining if the CXX compiler accepts the flag ${FLAGS} failed with the following output:\n${OUTPUT}\n\n")
|
||||
"Determining if the CXX compiler accepts the flag ${FLAGS} failed with "
|
||||
"the following output:\n${OUTPUT}\n\n")
|
||||
ENDIF(${VARIABLE})
|
||||
ENDMACRO(CHECK_CXX_ACCEPTS_FLAG)
|
||||
|
|
|
@ -12,10 +12,16 @@ IF("CMAKE_ANSI_FOR_SCOPE" MATCHES "^CMAKE_ANSI_FOR_SCOPE$")
|
|||
MESSAGE(STATUS "Check for ANSI scope - found")
|
||||
SET (CMAKE_NO_ANSI_FOR_SCOPE 0 CACHE INTERNAL
|
||||
"Does the compiler support ansi for scope.")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
|
||||
"Determining if the CXX compiler understands ansi for scopes passed with "
|
||||
"the following output:\n${OUTPUT}\n\n")
|
||||
ELSE (CMAKE_ANSI_FOR_SCOPE)
|
||||
MESSAGE(STATUS "Check for ANSI scope - not found")
|
||||
SET (CMAKE_NO_ANSI_FOR_SCOPE 1 CACHE INTERNAL
|
||||
"Does the compiler support ansi for scope.")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log
|
||||
"Determining if the CXX compiler understands ansi for scopes failed with "
|
||||
"the following output:\n${OUTPUT}\n\n")
|
||||
ENDIF (CMAKE_ANSI_FOR_SCOPE)
|
||||
ENDIF("CMAKE_ANSI_FOR_SCOPE" MATCHES "^CMAKE_ANSI_FOR_SCOPE$")
|
||||
|
||||
|
|
|
@ -11,10 +11,16 @@ IF("CMAKE_STD_NAMESPACE" MATCHES "^CMAKE_STD_NAMESPACE$")
|
|||
MESSAGE(STATUS "Check for STD namespace - found")
|
||||
SET (CMAKE_NO_STD_NAMESPACE 0 CACHE INTERNAL
|
||||
"Does the compiler support std::.")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
|
||||
"Determining if the CXX compiler has std namespace passed with "
|
||||
"the following output:\n${OUTPUT}\n\n")
|
||||
ELSE (CMAKE_STD_NAMESPACE)
|
||||
MESSAGE(STATUS "Check for STD namespace - not found")
|
||||
SET (CMAKE_NO_STD_NAMESPACE 1 CACHE INTERNAL
|
||||
"Does the compiler support std::.")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log
|
||||
"Determining if the CXX compiler has std namespace failed with "
|
||||
"the following output:\n${OUTPUT}\n\n")
|
||||
ENDIF (CMAKE_STD_NAMESPACE)
|
||||
ENDIF("CMAKE_STD_NAMESPACE" MATCHES "^CMAKE_STD_NAMESPACE$")
|
||||
|
||||
|
|
Loading…
Reference in New Issue