diff options
author | Brad King <brad.king@kitware.com> | 2006-02-09 19:28:01 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-02-09 19:28:01 (GMT) |
commit | 0ddf06e952088c95147312c486da9835f84385b2 (patch) | |
tree | 5c333bf9ca0c82ec323f4e3624fb7f8828dc4f7c | |
parent | e40ca0f42804924b16282f5a8dd68436eca9c794 (diff) | |
download | CMake-0ddf06e952088c95147312c486da9835f84385b2.zip CMake-0ddf06e952088c95147312c486da9835f84385b2.tar.gz CMake-0ddf06e952088c95147312c486da9835f84385b2.tar.bz2 |
ENH: Pay attention to CMAKE_REQUIRED_INCLUDES.
-rw-r--r-- | Modules/CheckSymbolExists.cmake | 9 |
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") |