CMakeLists.txt 1006 B

12345678910111213141516171819202122
  1. execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/nodeprecated_defined)
  2. execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/nodeprecated_not_defined)
  3. configure_file(CMakeLists.txt.in ${CMAKE_CURRENT_BINARY_DIR}/nodeprecated_not_defined/CMakeLists.txt)
  4. set(DEFINE_NO_DEPRECATED DEFINE_NO_DEPRECATED)
  5. configure_file(CMakeLists.txt.in ${CMAKE_CURRENT_BINARY_DIR}/nodeprecated_defined/CMakeLists.txt)
  6. try_compile(Result ${CMAKE_CURRENT_BINARY_DIR}/nodeprecated_not_defined_build
  7. ${CMAKE_CURRENT_BINARY_DIR}/nodeprecated_not_defined
  8. nodeprecated_test
  9. OUTPUT_VARIABLE Out
  10. )
  11. test_pass(Result "Failed to build without no-deprecated define")
  12. try_compile(Result ${CMAKE_CURRENT_BINARY_DIR}/nodeprecated_defined_build
  13. ${CMAKE_CURRENT_BINARY_DIR}/nodeprecated_defined
  14. nodeprecated_test
  15. OUTPUT_VARIABLE Out
  16. )
  17. test_fail(Result "Built even with no-deprecated define")