BUG: fix for bug 80, check include cxx now has an optional argument that can is added to the cxx flags
This commit is contained in:
parent
d76c9f8195
commit
79269fc5a9
@ -4,6 +4,7 @@
|
|||||||
# CHECK_INCLUDE_FILE - macro which checks the include file exists.
|
# CHECK_INCLUDE_FILE - macro which checks the include file exists.
|
||||||
# INCLUDE - name of include file
|
# INCLUDE - name of include file
|
||||||
# VARIABLE - variable to return result
|
# VARIABLE - variable to return result
|
||||||
|
# OPTIONAL - a third argument can be extra flags which are passed to the compiler
|
||||||
#
|
#
|
||||||
|
|
||||||
MACRO(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
|
MACRO(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
|
||||||
@ -12,10 +13,20 @@ MACRO(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
|
|||||||
SET(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
|
SET(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
|
||||||
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
|
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
|
||||||
${CMAKE_BINARY_DIR}/CMakeTmp/CheckIncludeFile.cxx IMMEDIATE)
|
${CMAKE_BINARY_DIR}/CMakeTmp/CheckIncludeFile.cxx IMMEDIATE)
|
||||||
|
IF(${ARGC} EQUAL 2)
|
||||||
|
SET(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS})
|
||||||
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARGV2}")
|
||||||
|
ENDIF(${ARGC} EQUAL 2)
|
||||||
|
|
||||||
TRY_COMPILE(${VARIABLE}
|
TRY_COMPILE(${VARIABLE}
|
||||||
${CMAKE_BINARY_DIR}
|
${CMAKE_BINARY_DIR}
|
||||||
${CMAKE_BINARY_DIR}/CMakeTmp/CheckIncludeFile.cxx
|
${CMAKE_BINARY_DIR}/CMakeTmp/CheckIncludeFile.cxx
|
||||||
OUTPUT_VARIABLE OUTPUT)
|
OUTPUT_VARIABLE OUTPUT)
|
||||||
|
|
||||||
|
IF(${ARGC} EQUAL 2)
|
||||||
|
SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS_SAVE})
|
||||||
|
ENDIF(${ARGC} EQUAL 2)
|
||||||
|
|
||||||
IF(${VARIABLE})
|
IF(${VARIABLE})
|
||||||
MESSAGE(STATUS "Checking for CXX include file ${INCLUDE} -- found")
|
MESSAGE(STATUS "Checking for CXX include file ${INCLUDE} -- found")
|
||||||
SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
|
SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user