summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/CheckFunctionExists.cmake4
-rw-r--r--Modules/CheckIncludeFile.cmake4
-rw-r--r--Modules/CheckIncludeFileCXX.cmake42
-rw-r--r--Modules/CheckLibraryExists.cmake4
-rw-r--r--Modules/CheckSizeOf.cmake4
-rw-r--r--Modules/CheckVariableExists.cmake30
6 files changed, 46 insertions, 42 deletions
diff --git a/Modules/CheckFunctionExists.cmake b/Modules/CheckFunctionExists.cmake
index 2afaa40..e435745 100644
--- a/Modules/CheckFunctionExists.cmake
+++ b/Modules/CheckFunctionExists.cmake
@@ -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)
diff --git a/Modules/CheckIncludeFile.cmake b/Modules/CheckIncludeFile.cmake
index b4e0929..4db9953 100644
--- a/Modules/CheckIncludeFile.cmake
+++ b/Modules/CheckIncludeFile.cmake
@@ -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)
diff --git a/Modules/CheckIncludeFileCXX.cmake b/Modules/CheckIncludeFileCXX.cmake
index 265bbfc..5b2a77c 100644
--- a/Modules/CheckIncludeFileCXX.cmake
+++ b/Modules/CheckIncludeFileCXX.cmake
@@ -7,24 +7,26 @@
#
MACRO(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
- MESSAGE(STATUS "Checking for CXX include file ${INCLUDE}")
- SET(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
- CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
- ${PROJECT_BINARY_DIR}/CMakeTmp/CheckIncludeFile.cxx IMMEDIATE)
- TRY_COMPILE(${VARIABLE}
- ${PROJECT_BINARY_DIR}
- ${PROJECT_BINARY_DIR}/CMakeTmp/CheckIncludeFile.cxx
- CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CMAKE_ANSI_CXXFLAGS}
- OUTPUT_VARIABLE OUTPUT)
- IF(${VARIABLE})
- MESSAGE(STATUS "Checking for CXX include file ${INCLUDE} -- found")
- SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
- ELSE(${VARIABLE})
- MESSAGE(STATUS "Checking for CXX include file ${INCLUDE} -- not found")
- SET(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}")
- WRITE_FILE(${PROJECT_BINARY_DIR}/CMakeError.log
- "Determining if the include file ${INCLUDE} "
- "exists failed with the following output:\n"
- "${OUTPUT}\n" APPEND)
- ENDIF(${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
+ ${PROJECT_BINARY_DIR}/CMakeTmp/CheckIncludeFile.cxx IMMEDIATE)
+ TRY_COMPILE(${VARIABLE}
+ ${PROJECT_BINARY_DIR}
+ ${PROJECT_BINARY_DIR}/CMakeTmp/CheckIncludeFile.cxx
+ CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CMAKE_ANSI_CXXFLAGS}
+ OUTPUT_VARIABLE OUTPUT)
+ IF(${VARIABLE})
+ MESSAGE(STATUS "Checking for CXX include file ${INCLUDE} -- found")
+ SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
+ ELSE(${VARIABLE})
+ MESSAGE(STATUS "Checking for CXX include file ${INCLUDE} -- not found")
+ SET(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}")
+ WRITE_FILE(${PROJECT_BINARY_DIR}/CMakeError.log
+ "Determining if the include file ${INCLUDE} "
+ "exists failed with the following output:\n"
+ "${OUTPUT}\n" APPEND)
+ ENDIF(${VARIABLE})
+ ENDIF("${VARIABLE}" MATCHES "^${VARIABLE}$")
ENDMACRO(CHECK_INCLUDE_FILE_CXX)
diff --git a/Modules/CheckLibraryExists.cmake b/Modules/CheckLibraryExists.cmake
index 65a6ec8..ccca0f5 100644
--- a/Modules/CheckLibraryExists.cmake
+++ b/Modules/CheckLibraryExists.cmake
@@ -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)
diff --git a/Modules/CheckSizeOf.cmake b/Modules/CheckSizeOf.cmake
index d375135..65481ca 100644
--- a/Modules/CheckSizeOf.cmake
+++ b/Modules/CheckSizeOf.cmake
@@ -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)
diff --git a/Modules/CheckVariableExists.cmake b/Modules/CheckVariableExists.cmake
index daa87a0..9eaf73b 100644
--- a/Modules/CheckVariableExists.cmake
+++ b/Modules/CheckVariableExists.cmake
@@ -6,18 +6,20 @@
#
MACRO(CHECK_VARIABLE_EXISTS VAR VARIABLE)
- SET(MACRO_CHECK_VARIABLE_DEFINITIONS -DCHECK_VARIABLE_EXISTS=${VAR})
- TRY_COMPILE(${VARIABLE}
- ${PROJECT_BINARY_DIR}
- ${CMAKE_ROOT}/Modules/CheckVariableExists.c
- CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_VARIABLE_DEFINITIONS}
- OUTPUT_VARIABLE OUTPUT)
- IF(${VARIABLE})
- SET(${VARIABLE} 1 CACHE INTERNAL "Have variable ${VAR}")
- ELSE(${VARIABLE})
- SET(${VARIABLE} "" CACHE INTERNAL "Have variable ${VAR}")
- WRITE_FILE(${PROJECT_BINARY_DIR}/CMakeError.log
- "Determining if the variable ${VAR} exists failed with the following output:\n"
- "${OUTPUT}\n" APPEND)
- ENDIF(${VARIABLE})
+ IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
+ SET(MACRO_CHECK_VARIABLE_DEFINITIONS -DCHECK_VARIABLE_EXISTS=${VAR})
+ TRY_COMPILE(${VARIABLE}
+ ${PROJECT_BINARY_DIR}
+ ${CMAKE_ROOT}/Modules/CheckVariableExists.c
+ CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_VARIABLE_DEFINITIONS}
+ OUTPUT_VARIABLE OUTPUT)
+ IF(${VARIABLE})
+ SET(${VARIABLE} 1 CACHE INTERNAL "Have variable ${VAR}")
+ ELSE(${VARIABLE})
+ SET(${VARIABLE} "" CACHE INTERNAL "Have variable ${VAR}")
+ WRITE_FILE(${PROJECT_BINARY_DIR}/CMakeError.log
+ "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)