diff options
author | Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com> | 2016-03-31 15:11:02 (GMT) |
---|---|---|
committer | Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com> | 2016-03-31 15:11:02 (GMT) |
commit | 72a862a55bdf16f4ff41239d400bd6b1aacfc7c2 (patch) | |
tree | ac9fc33edd0e67a645b8702a3dd74818eca7828d /Modules/CMakePushCheckState.cmake | |
parent | a3468b78f21d6f3520a351fde6db6dd9153df948 (diff) | |
download | CMake-72a862a55bdf16f4ff41239d400bd6b1aacfc7c2.zip CMake-72a862a55bdf16f4ff41239d400bd6b1aacfc7c2.tar.gz CMake-72a862a55bdf16f4ff41239d400bd6b1aacfc7c2.tar.bz2 |
CMakePushCheckState: Add support for CMAKE_EXTRA_INCLUDE_FILES
This commit teaches the module to push/pop/reset state of variable
CMAKE_EXTRA_INCLUDE_FILES used in CheckTypeSize module.
Diffstat (limited to 'Modules/CMakePushCheckState.cmake')
-rw-r--r-- | Modules/CMakePushCheckState.cmake | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/CMakePushCheckState.cmake b/Modules/CMakePushCheckState.cmake index bf4ec0e..6958da1 100644 --- a/Modules/CMakePushCheckState.cmake +++ b/Modules/CMakePushCheckState.cmake @@ -8,8 +8,8 @@ # CMAKE_POP_CHECK_STATE() and CMAKE_RESET_CHECK_STATE() These macros can # be used to save, restore and reset (i.e., clear contents) the state of # the variables CMAKE_REQUIRED_FLAGS, CMAKE_REQUIRED_DEFINITIONS, -# CMAKE_REQUIRED_LIBRARIES and CMAKE_REQUIRED_INCLUDES used by the -# various Check-files coming with CMake, like e.g. +# CMAKE_REQUIRED_LIBRARIES, CMAKE_REQUIRED_INCLUDES and CMAKE_EXTRA_INCLUDE_FILES +# used by the various Check-files coming with CMake, like e.g. # check_function_exists() etc. The variable contents are pushed on a # stack, pushing multiple times is supported. This is useful e.g. when # executing such tests in a Find-module, where they have to be set, but @@ -49,6 +49,7 @@ macro(CMAKE_RESET_CHECK_STATE) + set(CMAKE_EXTRA_INCLUDE_FILES) set(CMAKE_REQUIRED_INCLUDES) set(CMAKE_REQUIRED_DEFINITIONS) set(CMAKE_REQUIRED_LIBRARIES) @@ -65,6 +66,7 @@ macro(CMAKE_PUSH_CHECK_STATE) math(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}+1") + set(_CMAKE_EXTRA_INCLUDE_FILES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_EXTRA_INCLUDE_FILES}) set(_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_INCLUDES}) set(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS}) set(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_LIBRARIES}) @@ -82,6 +84,7 @@ macro(CMAKE_POP_CHECK_STATE) # don't pop more than we pushed if("${_CMAKE_PUSH_CHECK_STATE_COUNTER}" GREATER "0") + set(CMAKE_EXTRA_INCLUDE_FILES ${_CMAKE_EXTRA_INCLUDE_FILES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) set(CMAKE_REQUIRED_INCLUDES ${_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) set(CMAKE_REQUIRED_DEFINITIONS ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) set(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) |