summaryrefslogtreecommitdiff
path: root/Modules/CheckIncludeFiles.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-02-09 19:23:18 -0500
committerBrad King <brad.king@kitware.com>2006-02-09 19:23:18 -0500
commitf0a1da00c1d46bd3ffd0e1f4cfd76a3bbf2a2155 (patch)
tree2cbfbb98abe5416da719d9960563efbd7419bc8f /Modules/CheckIncludeFiles.cmake
parentf8a8e88a081600e8f6bbad8172f77fb4f422b5cd (diff)
downloadcmake-f0a1da00c1d46bd3ffd0e1f4cfd76a3bbf2a2155.tar.gz
ENH: Made Check* modules more consistent and well documented. Added CMAKE_REQUIRED_DEFINITIONS option.
Diffstat (limited to 'Modules/CheckIncludeFiles.cmake')
-rw-r--r--Modules/CheckIncludeFiles.cmake13
1 files changed, 8 insertions, 5 deletions
diff --git a/Modules/CheckIncludeFiles.cmake b/Modules/CheckIncludeFiles.cmake
index 45e5c892c7..bc923f09d5 100644
--- a/Modules/CheckIncludeFiles.cmake
+++ b/Modules/CheckIncludeFiles.cmake
@@ -4,11 +4,13 @@
#
# INCLUDE - list of files to include
# VARIABLE - variable to return result
-#
-# If CMAKE_REQUIRED_FLAGS is set then those flags will be passed into the
-# compile of the program
-# If CMAKE_REQUIRED_INCLUDES is set then those directories will be passed
-# as include paths to the compiler
+#
+# The following variables may be set before calling this macro to
+# modify the way the check is run:
+#
+# CMAKE_REQUIRED_FLAGS = string of compile command line flags
+# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+# CMAKE_REQUIRED_INCLUDES = list of include directories
MACRO(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
@@ -32,6 +34,7 @@ MACRO(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
TRY_COMPILE(${VARIABLE}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckIncludeFiles.c
+ COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
CMAKE_FLAGS
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILES_FLAGS}
"${CHECK_INCLUDE_FILES_INCLUDE_DIRS}"