Commit e720b84d authored by Andy Cedilnik's avatar Andy Cedilnik
Browse files

Add required flags

parent 624a222d
......@@ -8,7 +8,8 @@
MACRO(CHECK_FUNCTION_EXISTS FUNCTION 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}")
IF(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
......
......@@ -8,6 +8,7 @@
MACRO(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
SET(MACRO_CHECK_INCLUDE_FILE_FLAGS ${CMAKE_REQUIRED_FLAGS})
SET(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CheckIncludeFile.c.in
${CMAKE_BINARY_DIR}/CMakeTmp/CheckIncludeFile.c IMMEDIATE)
......@@ -15,6 +16,8 @@ MACRO(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
TRY_COMPILE(${VARIABLE}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/CMakeTmp/CheckIncludeFile.c
CMAKE_FLAGS
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILE_FLAGS}
OUTPUT_VARIABLE OUTPUT)
IF(${VARIABLE})
MESSAGE(STATUS "Looking for ${INCLUDE} - found")
......
......@@ -9,6 +9,7 @@
MACRO(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
SET(CHECK_INCLUDE_FILES_CONTENT "/* */\n")
SET(MACRO_CHECK_INCLUDE_FILES_FLAGS ${CMAKE_REQUIRED_FLAGS})
STRING(ASCII 35 POUND)
STRING(ASCII 40 41 PARENTS)
FOREACH(FILE ${INCLUDE})
......@@ -24,6 +25,8 @@ MACRO(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
TRY_COMPILE(${VARIABLE}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/CMakeTmp/CheckIncludeFiles.c
CMAKE_FLAGS
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILES_FLAGS}
OUTPUT_VARIABLE OUTPUT)
IF(${VARIABLE})
MESSAGE(STATUS "Looking for set of ${INCLUDE} - found")
......
......@@ -8,7 +8,8 @@
MACRO(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION 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}")
SET(CHECK_LIBRARY_EXISTS_LIBRARIES ${LIBRARY})
IF(CMAKE_REQUIRED_LIBRARIES)
......
......@@ -8,7 +8,8 @@
MACRO(CHECK_TYPE_SIZE TYPE 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)
SET(MACRO_CHECK_TYPE_SIZE_FLAGS
"${MACRO_CHECK_TYPE_SIZE_FLAGS} -DHAVE_SYS_TYPES_H")
......
......@@ -7,7 +7,8 @@
MACRO(CHECK_VARIABLE_EXISTS VAR 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}")
IF(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment