BUG: Only test for cxx flags the first time around

This commit is contained in:
Andy Cedilnik 2004-10-26 17:23:20 -04:00
parent 18642f4b4e
commit c57512ea38

View File

@ -7,21 +7,23 @@
# #
MACRO(CHECK_CXX_ACCEPTS_FLAG FLAGS VARIABLE) MACRO(CHECK_CXX_ACCEPTS_FLAG FLAGS VARIABLE)
MESSAGE(STATUS "Checking to see if CXX compiler acepts flag ${FLAGS}") IF(DEFINED ${VARIABLE})
TRY_COMPILE(${VARIABLE} MESSAGE(STATUS "Checking to see if CXX compiler acepts flag ${FLAGS}")
${CMAKE_BINARY_DIR} TRY_COMPILE(${VARIABLE}
${CMAKE_ROOT}/Modules/DummyCXXFile.cxx ${CMAKE_BINARY_DIR}
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${FLAGS} ${CMAKE_ROOT}/Modules/DummyCXXFile.cxx
OUTPUT_VARIABLE OUTPUT) CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${FLAGS}
IF(${VARIABLE}) OUTPUT_VARIABLE OUTPUT)
MESSAGE(STATUS "Checking to see if CXX compiler acepts flag ${FLAGS} - yes") IF(${VARIABLE})
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log MESSAGE(STATUS "Checking to see if CXX compiler acepts flag ${FLAGS} - yes")
"Determining if the CXX compiler accepts the flag ${FLAGS} passed with " FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
"the following output:\n${OUTPUT}\n\n") "Determining if the CXX compiler accepts the flag ${FLAGS} passed with "
ELSE(${VARIABLE}) "the following output:\n${OUTPUT}\n\n")
MESSAGE(STATUS "Checking to see if CXX compiler acepts flag ${FLAGS} - no") ELSE(${VARIABLE})
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log MESSAGE(STATUS "Checking to see if CXX compiler acepts flag ${FLAGS} - no")
"Determining if the CXX compiler accepts the flag ${FLAGS} failed with " FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log
"the following output:\n${OUTPUT}\n\n") "Determining if the CXX compiler accepts the flag ${FLAGS} failed with "
ENDIF(${VARIABLE}) "the following output:\n${OUTPUT}\n\n")
ENDIF(${VARIABLE})
ENDIF(DEFINED ${VARIABLE})
ENDMACRO(CHECK_CXX_ACCEPTS_FLAG) ENDMACRO(CHECK_CXX_ACCEPTS_FLAG)