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