Commit 652b2956 authored by Brad King's avatar Brad King Committed by Kitware Robot

Merge topic 'CMakePushCheckState-fix-RESET'

fda50a08 CMakePushCheckState: Fix cmake_push_check_state RESET argument
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !1040
parents 52db8d55 fda50a08
Pipeline #64866 passed with stage
in 0 seconds
......@@ -62,7 +62,7 @@ macro(CMAKE_PUSH_CHECK_STATE)
set(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_FLAGS})
set(_CMAKE_REQUIRED_QUIET_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_QUIET})
if (ARGC GREATER 0 AND ARGV0 STREQUAL "RESET")
if (${ARGC} GREATER 0 AND "${ARGV0}" STREQUAL "RESET")
cmake_reset_check_state()
endif()
......
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
......
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