PushCheckStateTest.cmake.in 715 B

123456789101112131415161718192021222324252627282930
  1. include(CMakePushCheckState)
  2. set(CMAKE_REQUIRED_DEFINITIONS defs1 )
  3. cmake_push_check_state()
  4. set(CMAKE_REQUIRED_DEFINITIONS defs2)
  5. cmake_push_check_state()
  6. set(CMAKE_REQUIRED_DEFINITIONS defs3)
  7. cmake_pop_check_state()
  8. if (NOT "${CMAKE_REQUIRED_DEFINITIONS}" STREQUAL "defs2")
  9. set(fatal TRUE)
  10. message("ERROR: "CMAKE_REQUIRED_DEFINITIONS is \"${CMAKE_REQUIRED_DEFINITIONS}\" (expected \"defs2\")" )
  11. endif()
  12. cmake_pop_check_state()
  13. if (NOT "${CMAKE_REQUIRED_DEFINITIONS}" STREQUAL "defs1")
  14. set(fatal TRUE)
  15. message("ERROR: "CMAKE_REQUIRED_DEFINITIONS is \"${CMAKE_REQUIRED_DEFINITIONS}\" (expected \"defs1\")" )
  16. endif()
  17. if(fatal)
  18. message(FATAL_ERROR "cmake_push_check_state() test failed")
  19. endif()