summaryrefslogtreecommitdiff
path: root/Modules/CheckIncludeFiles.cmake
diff options
context:
space:
mode:
authorKitware Robot <kwrobot@kitware.com>2012-08-13 13:47:32 -0400
committerBrad King <brad.king@kitware.com>2012-08-13 14:19:16 -0400
commit77543bde41b0e52c3959016698b529835945d62d (patch)
treeff63e5fbec326c4a5d821e7496c6d2cb52f75b92 /Modules/CheckIncludeFiles.cmake
parent7bbaa4283de26864b2e55e819db0884771585467 (diff)
downloadcmake-77543bde41b0e52c3959016698b529835945d62d.tar.gz
Convert CMake-language commands to lower case
Ancient CMake versions required upper-case commands. Later command names became case-insensitive. Now the preferred style is lower-case. Run the following shell code: cmake --help-command-list | grep -v "cmake version" | while read c; do echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | xargs -0 sed -i -f convert.sed && rm convert.sed
Diffstat (limited to 'Modules/CheckIncludeFiles.cmake')
-rw-r--r--Modules/CheckIncludeFiles.cmake74
1 files changed, 37 insertions, 37 deletions
diff --git a/Modules/CheckIncludeFiles.cmake b/Modules/CheckIncludeFiles.cmake
index 6901fbc5dc..02e3aac2ef 100644
--- a/Modules/CheckIncludeFiles.cmake
+++ b/Modules/CheckIncludeFiles.cmake
@@ -25,37 +25,37 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-MACRO(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
- IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
- SET(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n")
- IF(CMAKE_REQUIRED_INCLUDES)
- SET(CHECK_INCLUDE_FILES_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}")
- ELSE(CMAKE_REQUIRED_INCLUDES)
- SET(CHECK_INCLUDE_FILES_INCLUDE_DIRS)
- ENDIF(CMAKE_REQUIRED_INCLUDES)
- SET(CHECK_INCLUDE_FILES_CONTENT "/* */\n")
- SET(MACRO_CHECK_INCLUDE_FILES_FLAGS ${CMAKE_REQUIRED_FLAGS})
- FOREACH(FILE ${INCLUDE})
- SET(CMAKE_CONFIGURABLE_FILE_CONTENT
+macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
+ if("${VARIABLE}" MATCHES "^${VARIABLE}$")
+ set(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n")
+ if(CMAKE_REQUIRED_INCLUDES)
+ set(CHECK_INCLUDE_FILES_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}")
+ else(CMAKE_REQUIRED_INCLUDES)
+ set(CHECK_INCLUDE_FILES_INCLUDE_DIRS)
+ endif(CMAKE_REQUIRED_INCLUDES)
+ set(CHECK_INCLUDE_FILES_CONTENT "/* */\n")
+ set(MACRO_CHECK_INCLUDE_FILES_FLAGS ${CMAKE_REQUIRED_FLAGS})
+ foreach(FILE ${INCLUDE})
+ set(CMAKE_CONFIGURABLE_FILE_CONTENT
"${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n")
- ENDFOREACH(FILE)
- SET(CMAKE_CONFIGURABLE_FILE_CONTENT
+ endforeach(FILE)
+ set(CMAKE_CONFIGURABLE_FILE_CONTENT
"${CMAKE_CONFIGURABLE_FILE_CONTENT}\n\nint main(){return 0;}\n")
- CONFIGURE_FILE("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
+ configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFiles.c" @ONLY IMMEDIATE)
- SET(_INCLUDE ${INCLUDE}) # remove empty elements
- IF("${_INCLUDE}" MATCHES "^([^;]+);.+;([^;]+)$")
- LIST(LENGTH _INCLUDE _INCLUDE_LEN)
- SET(_description "${_INCLUDE_LEN} include files ${CMAKE_MATCH_1}, ..., ${CMAKE_MATCH_2}")
- ELSEIF("${_INCLUDE}" MATCHES "^([^;]+);([^;]+)$")
- SET(_description "include files ${CMAKE_MATCH_1}, ${CMAKE_MATCH_2}")
- ELSE()
- SET(_description "include file ${_INCLUDE}")
- ENDIF()
+ set(_INCLUDE ${INCLUDE}) # remove empty elements
+ if("${_INCLUDE}" MATCHES "^([^;]+);.+;([^;]+)$")
+ list(LENGTH _INCLUDE _INCLUDE_LEN)
+ set(_description "${_INCLUDE_LEN} include files ${CMAKE_MATCH_1}, ..., ${CMAKE_MATCH_2}")
+ elseif("${_INCLUDE}" MATCHES "^([^;]+);([^;]+)$")
+ set(_description "include files ${CMAKE_MATCH_1}, ${CMAKE_MATCH_2}")
+ else()
+ set(_description "include file ${_INCLUDE}")
+ endif()
- MESSAGE(STATUS "Looking for ${_description}")
- TRY_COMPILE(${VARIABLE}
+ message(STATUS "Looking for ${_description}")
+ try_compile(${VARIABLE}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFiles.c
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@@ -63,20 +63,20 @@ MACRO(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILES_FLAGS}
"${CHECK_INCLUDE_FILES_INCLUDE_DIRS}"
OUTPUT_VARIABLE OUTPUT)
- IF(${VARIABLE})
- MESSAGE(STATUS "Looking for ${_description} - found")
- SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ if(${VARIABLE})
+ message(STATUS "Looking for ${_description} - found")
+ set(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if files ${INCLUDE} "
"exist passed with the following output:\n"
"${OUTPUT}\n\n")
- ELSE(${VARIABLE})
- MESSAGE(STATUS "Looking for ${_description} - not found.")
- SET(${VARIABLE} "" CACHE INTERNAL "Have includes ${INCLUDE}")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ else(${VARIABLE})
+ message(STATUS "Looking for ${_description} - not found.")
+ set(${VARIABLE} "" CACHE INTERNAL "Have includes ${INCLUDE}")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if files ${INCLUDE} "
"exist failed with the following output:\n"
"${OUTPUT}\nSource:\n${CMAKE_CONFIGURABLE_FILE_CONTENT}\n")
- ENDIF(${VARIABLE})
- ENDIF("${VARIABLE}" MATCHES "^${VARIABLE}$")
-ENDMACRO(CHECK_INCLUDE_FILES)
+ endif(${VARIABLE})
+ endif("${VARIABLE}" MATCHES "^${VARIABLE}$")
+endmacro(CHECK_INCLUDE_FILES)