https://github.com/Kitware/CMake
Raw File
Tip revision: 1f6f114a7a61043ec0b9d6147f3b297081d214d5 authored by Brad King on 08 December 2014, 14:09:24 UTC
CMake 3.1.0-rc3
Tip revision: 1f6f114
PushCheckStateTest.cmake.in
include(CMakePushCheckState)

set(CMAKE_REQUIRED_DEFINITIONS defs1 )

cmake_push_check_state()

set(CMAKE_REQUIRED_DEFINITIONS defs2)

cmake_push_check_state()

set(CMAKE_REQUIRED_DEFINITIONS defs3)

cmake_pop_check_state()

if (NOT "${CMAKE_REQUIRED_DEFINITIONS}" STREQUAL "defs2")
  set(fatal TRUE)
  message("ERROR: "CMAKE_REQUIRED_DEFINITIONS is \"${CMAKE_REQUIRED_DEFINITIONS}\" (expected \"defs2\")" )
endif()

cmake_pop_check_state()

if (NOT "${CMAKE_REQUIRED_DEFINITIONS}" STREQUAL "defs1")
  set(fatal TRUE)
  message("ERROR: "CMAKE_REQUIRED_DEFINITIONS is \"${CMAKE_REQUIRED_DEFINITIONS}\" (expected \"defs1\")" )
endif()


if(fatal)
  message(FATAL_ERROR "cmake_push_check_state() test failed")
endif()
back to top