Add required flags
This commit is contained in:
parent
624a222df3
commit
e720b84d6b
|
@ -8,7 +8,8 @@
|
||||||
|
|
||||||
MACRO(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
|
MACRO(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
|
||||||
IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
|
IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
|
||||||
SET(MACRO_CHECK_FUNCTION_DEFINITIONS -DCHECK_FUNCTION_EXISTS=${FUNCTION})
|
SET(MACRO_CHECK_FUNCTION_DEFINITIONS -DCHECK_FUNCTION_EXISTS=${FUNCTION}
|
||||||
|
${CMAKE_REQUIRED_FLAGS})
|
||||||
MESSAGE(STATUS "Looking for ${FUNCTION}")
|
MESSAGE(STATUS "Looking for ${FUNCTION}")
|
||||||
IF(CMAKE_REQUIRED_LIBRARIES)
|
IF(CMAKE_REQUIRED_LIBRARIES)
|
||||||
SET(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
|
SET(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
MACRO(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
|
MACRO(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
|
||||||
IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
|
IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
|
||||||
|
SET(MACRO_CHECK_INCLUDE_FILE_FLAGS ${CMAKE_REQUIRED_FLAGS})
|
||||||
SET(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
|
SET(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
|
||||||
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CheckIncludeFile.c.in
|
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CheckIncludeFile.c.in
|
||||||
${CMAKE_BINARY_DIR}/CMakeTmp/CheckIncludeFile.c IMMEDIATE)
|
${CMAKE_BINARY_DIR}/CMakeTmp/CheckIncludeFile.c IMMEDIATE)
|
||||||
|
@ -15,6 +16,8 @@ MACRO(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
|
||||||
TRY_COMPILE(${VARIABLE}
|
TRY_COMPILE(${VARIABLE}
|
||||||
${CMAKE_BINARY_DIR}
|
${CMAKE_BINARY_DIR}
|
||||||
${CMAKE_BINARY_DIR}/CMakeTmp/CheckIncludeFile.c
|
${CMAKE_BINARY_DIR}/CMakeTmp/CheckIncludeFile.c
|
||||||
|
CMAKE_FLAGS
|
||||||
|
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILE_FLAGS}
|
||||||
OUTPUT_VARIABLE OUTPUT)
|
OUTPUT_VARIABLE OUTPUT)
|
||||||
IF(${VARIABLE})
|
IF(${VARIABLE})
|
||||||
MESSAGE(STATUS "Looking for ${INCLUDE} - found")
|
MESSAGE(STATUS "Looking for ${INCLUDE} - found")
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
MACRO(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
|
MACRO(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
|
||||||
IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
|
IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
|
||||||
SET(CHECK_INCLUDE_FILES_CONTENT "/* */\n")
|
SET(CHECK_INCLUDE_FILES_CONTENT "/* */\n")
|
||||||
|
SET(MACRO_CHECK_INCLUDE_FILES_FLAGS ${CMAKE_REQUIRED_FLAGS})
|
||||||
STRING(ASCII 35 POUND)
|
STRING(ASCII 35 POUND)
|
||||||
STRING(ASCII 40 41 PARENTS)
|
STRING(ASCII 40 41 PARENTS)
|
||||||
FOREACH(FILE ${INCLUDE})
|
FOREACH(FILE ${INCLUDE})
|
||||||
|
@ -24,6 +25,8 @@ MACRO(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
|
||||||
TRY_COMPILE(${VARIABLE}
|
TRY_COMPILE(${VARIABLE}
|
||||||
${CMAKE_BINARY_DIR}
|
${CMAKE_BINARY_DIR}
|
||||||
${CMAKE_BINARY_DIR}/CMakeTmp/CheckIncludeFiles.c
|
${CMAKE_BINARY_DIR}/CMakeTmp/CheckIncludeFiles.c
|
||||||
|
CMAKE_FLAGS
|
||||||
|
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILES_FLAGS}
|
||||||
OUTPUT_VARIABLE OUTPUT)
|
OUTPUT_VARIABLE OUTPUT)
|
||||||
IF(${VARIABLE})
|
IF(${VARIABLE})
|
||||||
MESSAGE(STATUS "Looking for set of ${INCLUDE} - found")
|
MESSAGE(STATUS "Looking for set of ${INCLUDE} - found")
|
||||||
|
|
|
@ -8,7 +8,8 @@
|
||||||
|
|
||||||
MACRO(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
|
MACRO(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
|
||||||
IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
|
IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
|
||||||
SET(MACRO_CHECK_LIBRARY_EXISTS_DEFINITION -DCHECK_FUNCTION_EXISTS=${FUNCTION})
|
SET(MACRO_CHECK_LIBRARY_EXISTS_DEFINITION -DCHECK_FUNCTION_EXISTS=${FUNCTION}
|
||||||
|
${CMAKE_REQUIRED_FLAGS})
|
||||||
MESSAGE(STATUS "Looking for ${FUNCTION} in ${LIBRARY}")
|
MESSAGE(STATUS "Looking for ${FUNCTION} in ${LIBRARY}")
|
||||||
SET(CHECK_LIBRARY_EXISTS_LIBRARIES ${LIBRARY})
|
SET(CHECK_LIBRARY_EXISTS_LIBRARIES ${LIBRARY})
|
||||||
IF(CMAKE_REQUIRED_LIBRARIES)
|
IF(CMAKE_REQUIRED_LIBRARIES)
|
||||||
|
|
|
@ -8,7 +8,8 @@
|
||||||
|
|
||||||
MACRO(CHECK_TYPE_SIZE TYPE VARIABLE)
|
MACRO(CHECK_TYPE_SIZE TYPE VARIABLE)
|
||||||
IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
|
IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
|
||||||
SET(MACRO_CHECK_TYPE_SIZE_FLAGS -DCHECK_TYPE_SIZE_TYPE="${TYPE}")
|
SET(MACRO_CHECK_TYPE_SIZE_FLAGS -DCHECK_TYPE_SIZE_TYPE="${TYPE}"
|
||||||
|
${CMAKE_REQUIRED_FLAGS})
|
||||||
IF(HAVE_SYS_TYPES_H)
|
IF(HAVE_SYS_TYPES_H)
|
||||||
SET(MACRO_CHECK_TYPE_SIZE_FLAGS
|
SET(MACRO_CHECK_TYPE_SIZE_FLAGS
|
||||||
"${MACRO_CHECK_TYPE_SIZE_FLAGS} -DHAVE_SYS_TYPES_H")
|
"${MACRO_CHECK_TYPE_SIZE_FLAGS} -DHAVE_SYS_TYPES_H")
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
|
|
||||||
MACRO(CHECK_VARIABLE_EXISTS VAR VARIABLE)
|
MACRO(CHECK_VARIABLE_EXISTS VAR VARIABLE)
|
||||||
IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
|
IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
|
||||||
SET(MACRO_CHECK_VARIABLE_DEFINITIONS -DCHECK_VARIABLE_EXISTS=${VAR})
|
SET(MACRO_CHECK_VARIABLE_DEFINITIONS -DCHECK_VARIABLE_EXISTS=${VAR}
|
||||||
|
${CMAKE_REQUIRED_FLAGS})
|
||||||
MESSAGE(STATUS "Looking for ${VARIABLE}")
|
MESSAGE(STATUS "Looking for ${VARIABLE}")
|
||||||
IF(CMAKE_REQUIRED_LIBRARIES)
|
IF(CMAKE_REQUIRED_LIBRARIES)
|
||||||
SET(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES
|
SET(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES
|
||||||
|
|
Loading…
Reference in New Issue