RunCMakeTest.cmake 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. include(RunCMake)
  2. function(run_SymlinkImplicit)
  3. # Use a single build tree for a few tests without cleaning.
  4. set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SymlinkImplicit-build)
  5. set(RunCMake_TEST_NO_CLEAN 1)
  6. if(NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
  7. set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug)
  8. endif()
  9. file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
  10. file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
  11. run_cmake(SymlinkImplicit)
  12. run_cmake_command(SymlinkImplicit-build ${CMAKE_COMMAND} --build . --config Debug)
  13. run_cmake_command(SymlinkImplicitCheck
  14. ${CMAKE_COMMAND} -Ddir=${RunCMake_TEST_BINARY_DIR} -P ${RunCMake_SOURCE_DIR}/SymlinkImplicitCheck.cmake)
  15. endfunction()
  16. run_SymlinkImplicit()
  17. function(run_Relative)
  18. # Use a single build tree for a few tests without cleaning.
  19. set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Relative-build)
  20. set(RunCMake_TEST_NO_CLEAN 1)
  21. if(NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
  22. set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug)
  23. endif()
  24. file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
  25. file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
  26. run_cmake(Relative)
  27. run_cmake_command(Relative-build ${CMAKE_COMMAND} --build . --config Debug)
  28. endfunction()
  29. run_Relative()