summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-02-09 19:28:01 (GMT)
committerBrad King <brad.king@kitware.com>2006-02-09 19:28:01 (GMT)
commit0ddf06e952088c95147312c486da9835f84385b2 (patch)
tree5c333bf9ca0c82ec323f4e3624fb7f8828dc4f7c /Modules
parente40ca0f42804924b16282f5a8dd68436eca9c794 (diff)
downloadCMake-0ddf06e952088c95147312c486da9835f84385b2.zip
CMake-0ddf06e952088c95147312c486da9835f84385b2.tar.gz
CMake-0ddf06e952088c95147312c486da9835f84385b2.tar.bz2
ENH: Pay attention to CMAKE_REQUIRED_INCLUDES.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CheckSymbolExists.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake
index d39f5d1..f75e43b 100644
--- a/Modules/CheckSymbolExists.cmake
+++ b/Modules/CheckSymbolExists.cmake
@@ -17,7 +17,15 @@ MACRO(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
IF(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_SYMBOL_EXISTS_LIBS
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
+ ELSE(CMAKE_REQUIRED_LIBRARIES)
+ SET(CHECK_SYMBOL_EXISTS_LIBS)
ENDIF(CMAKE_REQUIRED_LIBRARIES)
+ IF(CMAKE_REQUIRED_INCLUDES)
+ SET(CMAKE_SYMBOL_EXISTS_INCLUDES
+ "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
+ ELSE(CMAKE_REQUIRED_INCLUDES)
+ SET(CMAKE_SYMBOL_EXISTS_INCLUDES)
+ ENDIF(CMAKE_REQUIRED_INCLUDES)
FOREACH(FILE ${FILES})
SET(CHECK_SYMBOL_EXISTS_CONTENT
"${CHECK_SYMBOL_EXISTS_CONTENT}#include <${FILE}>\n")
@@ -35,6 +43,7 @@ MACRO(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
CMAKE_FLAGS
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_SYMBOL_EXISTS_FLAGS}
"${CHECK_SYMBOL_EXISTS_LIBS}"
+ "${CMAKE_SYMBOL_EXISTS_INCLUDES}"
OUTPUT_VARIABLE OUTPUT)
IF(${VARIABLE})
MESSAGE(STATUS "Looking for ${SYMBOL} - found")