Commit 79269fc5 authored by Bill Hoffman's avatar Bill Hoffman

BUG: fix for bug 80, check include cxx now has an optional argument that can...

BUG: fix for bug 80, check include cxx now has an optional argument that can is added to the cxx flags
parent d76c9f81
......@@ -4,6 +4,7 @@
# CHECK_INCLUDE_FILE - macro which checks the include file exists.
# INCLUDE - name of include file
# 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)
......@@ -12,10 +13,20 @@ MACRO(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
SET(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
${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}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/CMakeTmp/CheckIncludeFile.cxx
OUTPUT_VARIABLE OUTPUT)
IF(${ARGC} EQUAL 2)
SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS_SAVE})
ENDIF(${ARGC} EQUAL 2)
IF(${VARIABLE})
MESSAGE(STATUS "Checking for CXX include file ${INCLUDE} -- found")
SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
......
Markdown is supported
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