ENH: Don't repeat check even if answer was no.

This commit is contained in:
Brad King 2002-12-13 14:58:55 -05:00
parent 858c6c9a02
commit 7e824e83a9
6 changed files with 46 additions and 42 deletions

View File

@ -7,7 +7,7 @@
#
MACRO(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
IF(NOT ${VARIABLE})
IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
SET(MACRO_CHECK_FUNCTION_DEFINITIONS -DCHECK_FUNCTION_EXISTS=${FUNCTION})
MESSAGE(STATUS "Looking for ${FUNCTION}")
TRY_COMPILE(${VARIABLE}
@ -25,5 +25,5 @@ MACRO(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
"Determining if the function ${FUNCTION} exists failed with the following output:\n"
"${OUTPUT}\n" APPEND)
ENDIF(${VARIABLE})
ENDIF(NOT ${VARIABLE})
ENDIF("${VARIABLE}" MATCHES "^${VARIABLE}$")
ENDMACRO(CHECK_FUNCTION_EXISTS)

View File

@ -7,7 +7,7 @@
#
MACRO(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
IF(NOT ${VARIABLE})
IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
SET(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CheckIncludeFile.c.in
${PROJECT_BINARY_DIR}/CMakeTmp/CheckIncludeFile.c IMMEDIATE)
@ -27,5 +27,5 @@ MACRO(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
"exists failed with the following output:\n"
"${OUTPUT}\n" APPEND)
ENDIF(${VARIABLE})
ENDIF(NOT ${VARIABLE})
ENDIF("${VARIABLE}" MATCHES "^${VARIABLE}$")
ENDMACRO(CHECK_INCLUDE_FILE)

View File

@ -7,6 +7,7 @@
#
MACRO(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
MESSAGE(STATUS "Checking for CXX include file ${INCLUDE}")
SET(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
@ -27,4 +28,5 @@ MACRO(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
"exists failed with the following output:\n"
"${OUTPUT}\n" APPEND)
ENDIF(${VARIABLE})
ENDIF("${VARIABLE}" MATCHES "^${VARIABLE}$")
ENDMACRO(CHECK_INCLUDE_FILE_CXX)

View File

@ -7,7 +7,7 @@
#
MACRO(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
IF(NOT ${VARIABLE})
IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
SET(MACRO_CHECK_LIBRARY_EXISTS_DEFINITION -DCHECK_FUNCTION_EXISTS=${FUNCTION})
MESSAGE(STATUS "Looking for ${FUNCTION} in ${LIBRARY}")
TRY_COMPILE(${VARIABLE}
@ -30,5 +30,5 @@ MACRO(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
"failed with the following output:\n"
"${OUTPUT}\n" APPEND)
ENDIF(${VARIABLE})
ENDIF(NOT ${VARIABLE})
ENDIF("${VARIABLE}" MATCHES "^${VARIABLE}$")
ENDMACRO(CHECK_LIBRARY_EXISTS)

View File

@ -7,7 +7,7 @@
#
MACRO(CHECK_TYPE_SIZE TYPE VARIABLE)
IF(NOT ${VARIABLE})
IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
SET(MACRO_CHECK_TYPE_SIZE_FLAGS -DCHECK_SIZE_OF="${TYPE}")
IF(HAVE_SYS_TYPES_H)
SET(MACRO_CHECK_TYPE_SIZE_FLAGS
@ -30,5 +30,5 @@ MACRO(CHECK_TYPE_SIZE TYPE VARIABLE)
"Determining size of ${TYPE} failed with the following output:\n${OUTPUT}\n"
APPEND)
ENDIF(HAVE_${VARIABLE})
ENDIF(NOT ${VARIABLE})
ENDIF("${VARIABLE}" MATCHES "^${VARIABLE}$")
ENDMACRO(CHECK_TYPE_SIZE)

View File

@ -6,6 +6,7 @@
#
MACRO(CHECK_VARIABLE_EXISTS VAR VARIABLE)
IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
SET(MACRO_CHECK_VARIABLE_DEFINITIONS -DCHECK_VARIABLE_EXISTS=${VAR})
TRY_COMPILE(${VARIABLE}
${PROJECT_BINARY_DIR}
@ -20,4 +21,5 @@ MACRO(CHECK_VARIABLE_EXISTS VAR VARIABLE)
"Determining if the variable ${VAR} exists failed with the following output:\n"
"${OUTPUT}\n" APPEND)
ENDIF(${VARIABLE})
ENDIF("${VARIABLE}" MATCHES "^${VARIABLE}$")
ENDMACRO(CHECK_VARIABLE_EXISTS)