summaryrefslogtreecommitdiffstats
path: root/Modules/CheckSymbolExists.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-02-10 00:23:18 (GMT)
committerBrad King <brad.king@kitware.com>2006-02-10 00:23:18 (GMT)
commitf0a1da00c1d46bd3ffd0e1f4cfd76a3bbf2a2155 (patch)
tree2cbfbb98abe5416da719d9960563efbd7419bc8f /Modules/CheckSymbolExists.cmake
parentf8a8e88a081600e8f6bbad8172f77fb4f422b5cd (diff)
downloadCMake-f0a1da00c1d46bd3ffd0e1f4cfd76a3bbf2a2155.zip
CMake-f0a1da00c1d46bd3ffd0e1f4cfd76a3bbf2a2155.tar.gz
CMake-f0a1da00c1d46bd3ffd0e1f4cfd76a3bbf2a2155.tar.bz2
ENH: Made Check* modules more consistent and well documented. Added CMAKE_REQUIRED_DEFINITIONS option.
Diffstat (limited to 'Modules/CheckSymbolExists.cmake')
-rw-r--r--Modules/CheckSymbolExists.cmake14
1 files changed, 9 insertions, 5 deletions
diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake
index f75e43b..ab4298a 100644
--- a/Modules/CheckSymbolExists.cmake
+++ b/Modules/CheckSymbolExists.cmake
@@ -4,11 +4,14 @@
# SYMBOL - symbol
# FILES - include files to check
# VARIABLE - variable to return result
-#
-# If CMAKE_REQUIRED_FLAGS is set then those flags will be passed into the
-# compile of the program likewise if CMAKE_REQUIRED_LIBRARIES is set then
-# those libraries will be linked against the test program
-
+#
+# 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
+# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
MACRO(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
@@ -40,6 +43,7 @@ MACRO(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
TRY_COMPILE(${VARIABLE}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckSymbolExists.c
+ COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
CMAKE_FLAGS
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_SYMBOL_EXISTS_FLAGS}
"${CHECK_SYMBOL_EXISTS_LIBS}"