diff options
author | Brad King <brad.king@kitware.com> | 2007-05-17 19:17:45 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2007-05-17 19:17:45 (GMT) |
commit | 58debfd6bdd5d950b500bb9315241723ff019a11 (patch) | |
tree | f6abccdfb4cd70d94cbce07277cb04025f0f869e | |
parent | b8928b0c8e2d6e649cf52d28021cf349194f2485 (diff) | |
download | CMake-58debfd6bdd5d950b500bb9315241723ff019a11.zip CMake-58debfd6bdd5d950b500bb9315241723ff019a11.tar.gz CMake-58debfd6bdd5d950b500bb9315241723ff019a11.tar.bz2 |
ENH: Use IF(NOT DEFINED) check to short-circuit size test.
-rw-r--r-- | Modules/CheckTypeSize.cmake | 4 | ||||
-rw-r--r-- | Source/CTest/Curl/CMake/CheckTypeSize.cmake | 2 | ||||
-rw-r--r-- | Utilities/cmcurl/CMake/CheckTypeSize.cmake | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake index 9f43249..a9ae642 100644 --- a/Modules/CheckTypeSize.cmake +++ b/Modules/CheckTypeSize.cmake @@ -13,8 +13,8 @@ # CMAKE_REQUIRED_LIBRARIES = list of libraries to link MACRO(CHECK_TYPE_SIZE TYPE VARIABLE) - IF(NOT DEFINED ${VARIABLE}) SET(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1) + IF(NOT DEFINED ${VARIABLE}) IF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") SET(CHECK_TYPE_SIZE_TYPE "${TYPE}") SET(MACRO_CHECK_TYPE_SIZE_FLAGS @@ -65,6 +65,6 @@ MACRO(CHECK_TYPE_SIZE TYPE VARIABLE) "Determining size of ${TYPE} failed with the following output:\n${OUTPUT}\nCheckTypeSize.c:\n${CHECK_TYPE_SIZE_FILE_CONTENT}\n\n") ENDIF(HAVE_${VARIABLE}) ENDIF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") - SET(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS ) ENDIF(NOT DEFINED ${VARIABLE}) + SET(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS ) ENDMACRO(CHECK_TYPE_SIZE) diff --git a/Source/CTest/Curl/CMake/CheckTypeSize.cmake b/Source/CTest/Curl/CMake/CheckTypeSize.cmake index dd023a6..0f7ad52 100644 --- a/Source/CTest/Curl/CMake/CheckTypeSize.cmake +++ b/Source/CTest/Curl/CMake/CheckTypeSize.cmake @@ -9,6 +9,7 @@ MACRO(CHECK_TYPE_SIZE TYPE VARIABLE) SET(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1) + IF(NOT DEFINED ${VARIABLE}) IF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") SET(MACRO_CHECK_TYPE_SIZE_FLAGS "-DCHECK_TYPE_SIZE_TYPE=\"${TYPE}\" ${CMAKE_REQUIRED_FLAGS}") @@ -47,5 +48,6 @@ MACRO(CHECK_TYPE_SIZE TYPE VARIABLE) "Determining size of ${TYPE} failed with the following output:\n${OUTPUT}\nCheckTypeSize.c:\n${CHECK_TYPE_SIZE_FILE_CONTENT}\n\n") ENDIF(HAVE_${VARIABLE}) ENDIF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") + ENDIF(NOT DEFINED ${VARIABLE}) SET(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS ) ENDMACRO(CHECK_TYPE_SIZE) diff --git a/Utilities/cmcurl/CMake/CheckTypeSize.cmake b/Utilities/cmcurl/CMake/CheckTypeSize.cmake index e573d5b..e16c64d 100644 --- a/Utilities/cmcurl/CMake/CheckTypeSize.cmake +++ b/Utilities/cmcurl/CMake/CheckTypeSize.cmake @@ -8,6 +8,7 @@ MACRO(CHECK_TYPE_SIZE TYPE VARIABLE) SET(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1) + IF(NOT DEFINED ${VARIABLE}) IF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") SET(CHECK_TYPE_SIZE_TYPE "${TYPE}") SET(MACRO_CHECK_TYPE_SIZE_FLAGS @@ -50,5 +51,6 @@ MACRO(CHECK_TYPE_SIZE TYPE VARIABLE) "Determining size of ${TYPE} failed with the following output:\n${OUTPUT}\nCheckTypeSize.c:\n${CHECK_TYPE_SIZE_FILE_CONTENT}\n\n") ENDIF(HAVE_${VARIABLE}) ENDIF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") + ENDIF(NOT DEFINED ${VARIABLE}) SET(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS ) ENDMACRO(CHECK_TYPE_SIZE) |