summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeTests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-07-10 14:30:17 (GMT)
committerBrad King <brad.king@kitware.com>2017-07-12 19:09:16 (GMT)
commitfda50a08437d99aba753bc84d26ba535e06e7b06 (patch)
tree0db2d7f13562b36aa1261aefc033768e8b67bc1d /Tests/CMakeTests
parent1fda77d45565c3a819e6149597c3a194d9ccd0bb (diff)
downloadCMake-fda50a08437d99aba753bc84d26ba535e06e7b06.zip
CMake-fda50a08437d99aba753bc84d26ba535e06e7b06.tar.gz
CMake-fda50a08437d99aba753bc84d26ba535e06e7b06.tar.bz2
CMakePushCheckState: Fix cmake_push_check_state RESET argument
This option was added by commit v2.8.12~138^2 (Add cmake_reset_check_state() macro, 2013-07-28) but has never worked. Fix the implementation to refer to macro arguments properly (not as normal variables). Fixes: #17048
Diffstat (limited to 'Tests/CMakeTests')
-rw-r--r--Tests/CMakeTests/PushCheckStateTest.cmake.in22
1 files changed, 22 insertions, 0 deletions
diff --git a/Tests/CMakeTests/PushCheckStateTest.cmake.in b/Tests/CMakeTests/PushCheckStateTest.cmake.in
index b4c48f4..cbd879d 100644
--- a/Tests/CMakeTests/PushCheckStateTest.cmake.in
+++ b/Tests/CMakeTests/PushCheckStateTest.cmake.in
@@ -1,3 +1,4 @@
+cmake_minimum_required(VERSION 3.8)
include(CMakePushCheckState)
set(CMAKE_EXTRA_INCLUDE_FILES file1)
@@ -26,6 +27,27 @@ set(CMAKE_REQUIRED_LIBRARIES lib3)
set(CMAKE_REQUIRED_FLAGS flag3)
set(CMAKE_REQUIRED_QUIET 3)
+cmake_push_check_state(RESET)
+
+foreach(pair IN ITEMS
+ EXTRA_INCLUDE_FILES|
+ REQUIRED_INCLUDES|
+ REQUIRED_DEFINITIONS|
+ REQUIRED_LIBRARIES|
+ REQUIRED_FLAGS|
+ REQUIRED_QUIET|
+ )
+ string(REPLACE "|" ";" pair "${pair}")
+ list(GET pair 0 var)
+ list(GET pair 1 expected)
+ if (NOT "${CMAKE_${var}}" STREQUAL "${expected}")
+ set(fatal TRUE)
+ message("ERROR: CMAKE_${var} is \"${CMAKE_${var}}\" (expected \"${expected}\")" )
+ endif()
+endforeach()
+
+cmake_pop_check_state()
+
cmake_pop_check_state()
foreach(pair IN ITEMS