summaryrefslogtreecommitdiffstats
path: root/Modules/CheckIncludeFileCXX.cmake
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2004-04-28 13:52:12 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2004-04-28 13:52:12 (GMT)
commit79269fc5a9dab7be97918e522accfaf48545ff88 (patch)
tree63ab0b1d4f08d004e0a473548b3300fbae00c2c9 /Modules/CheckIncludeFileCXX.cmake
parentd76c9f8195b5f98f5fd2a99c88094192b9719288 (diff)
downloadCMake-79269fc5a9dab7be97918e522accfaf48545ff88.zip
CMake-79269fc5a9dab7be97918e522accfaf48545ff88.tar.gz
CMake-79269fc5a9dab7be97918e522accfaf48545ff88.tar.bz2
BUG: fix for bug 80, check include cxx now has an optional argument that can is added to the cxx flags
Diffstat (limited to 'Modules/CheckIncludeFileCXX.cmake')
-rw-r--r--Modules/CheckIncludeFileCXX.cmake11
1 files changed, 11 insertions, 0 deletions
diff --git a/Modules/CheckIncludeFileCXX.cmake b/Modules/CheckIncludeFileCXX.cmake
index 2ad5cf1..0fe6a5c 100644
--- a/Modules/CheckIncludeFileCXX.cmake
+++ b/Modules/CheckIncludeFileCXX.cmake
@@ -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}")