cmake/Tests/RunCMake/RuntimePath/RunCMakeTest.cmake

33 lines
1.1 KiB
CMake
Raw Normal View History

2017-04-14 19:02:05 +02:00
include(RunCMake)
2020-02-01 23:06:01 +01:00
function(run_RuntimePath name)
2017-04-14 19:02:05 +02:00
# Use a single build tree for a few tests without cleaning.
2020-02-01 23:06:01 +01:00
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${name}-build)
2017-04-14 19:02:05 +02:00
set(RunCMake_TEST_NO_CLEAN 1)
2018-04-23 21:13:27 +02:00
if(NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
2020-08-30 11:54:41 +02:00
set(RunCMake_TEST_OPTIONS -Dcfg_dir= -DCMAKE_BUILD_TYPE=Debug)
else()
set(RunCMake_TEST_OPTIONS -Dcfg_dir=/$<CONFIG>)
2017-04-14 19:02:05 +02:00
endif()
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
2020-02-01 23:06:01 +01:00
run_cmake(${name})
run_cmake_command(${name}-build ${CMAKE_COMMAND} --build . --config Debug)
2017-04-14 19:02:05 +02:00
endfunction()
2019-11-11 23:01:05 +01:00
2020-08-30 11:54:41 +02:00
set(cfg_dir)
if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
set(cfg_dir /Debug)
endif()
2020-02-01 23:06:01 +01:00
run_RuntimePath(SymlinkImplicit)
run_cmake_command(SymlinkImplicitCheck
2020-08-30 11:54:41 +02:00
${CMAKE_COMMAND} -Ddir=${RunCMake_BINARY_DIR}/SymlinkImplicit-build -Dcfg_dir=${cfg_dir} -P ${RunCMake_SOURCE_DIR}/SymlinkImplicitCheck.cmake)
2020-02-01 23:06:01 +01:00
run_RuntimePath(Relative)
run_RuntimePath(Genex)
run_cmake_command(GenexCheck
${CMAKE_COMMAND} -Ddir=${RunCMake_BINARY_DIR}/Genex-build -P ${RunCMake_SOURCE_DIR}/GenexCheck.cmake)