From 72a862a55bdf16f4ff41239d400bd6b1aacfc7c2 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Thu, 31 Mar 2016 11:11:02 -0400 Subject: 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. --- Help/release/dev/CMakePushCheckState-CMAKE_EXTRA_INCLUDE_FILES.rst | 5 +++++ Modules/CMakePushCheckState.cmake | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 Help/release/dev/CMakePushCheckState-CMAKE_EXTRA_INCLUDE_FILES.rst diff --git a/Help/release/dev/CMakePushCheckState-CMAKE_EXTRA_INCLUDE_FILES.rst b/Help/release/dev/CMakePushCheckState-CMAKE_EXTRA_INCLUDE_FILES.rst new file mode 100644 index 0000000..a4e9a14 --- /dev/null +++ b/Help/release/dev/CMakePushCheckState-CMAKE_EXTRA_INCLUDE_FILES.rst @@ -0,0 +1,5 @@ +CMakePushCheckState-CMAKE_EXTRA_INCLUDE_FILE +-------------------------------------------- + +* The :module:`CMakePushCheckState` module now pushes/pops/resets the variable + ``CMAKE_EXTRA_INCLUDE_FILE`` used in :module:`CheckTypeSize`. 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}}) -- cgit v0.12