diff options
-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") |