ENH: Pay attention to CMAKE_REQUIRED_INCLUDES.
This commit is contained in:
parent
e40ca0f428
commit
0ddf06e952
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue