summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-02-25 13:12:07 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-02-25 13:12:13 (GMT)
commit0883ab385a8d15075cab99a265a20131a37b506d (patch)
treef0e11e726d3be8dc9ef3fd1b5ffefcb84a138089
parent805484ac5db08c9b208b98ae00f032a4025b48c1 (diff)
parentef162bb40bcda8dcbd561ed2b1a6c4bd46288add (diff)
downloadCMake-0883ab385a8d15075cab99a265a20131a37b506d.zip
CMake-0883ab385a8d15075cab99a265a20131a37b506d.tar.gz
CMake-0883ab385a8d15075cab99a265a20131a37b506d.tar.bz2
Merge topic 'test-symlink-trees'
ef162bb40b Tests: Extend RunCMake.SymlinkTrees with more symlink layouts 802b76140d Tests: Extend RunCMake.SymlinkTrees to verify paths passed to compiler b0ac0fbe0e Tests: Extend RunCMake.SymlinkTrees with directory argument variants 6c971b5e93 Tests: Generalize RunCMake.SymlinkTrees implementation 0443bdb8d4 Tests: Simplify RunCMake.SymlinkTrees per-case implementation Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7019
-rw-r--r--Tests/RunCMake/SymlinkTrees/CMakeLists.txt51
-rw-r--r--Tests/RunCMake/SymlinkTrees/PrintTrees.cmake6
-rw-r--r--Tests/RunCMake/SymlinkTrees/RunCMakeTest.cmake236
-rw-r--r--Tests/RunCMake/SymlinkTrees/asymmetric-bin_in_src-exe-build-stdout.txt4
-rw-r--r--Tests/RunCMake/SymlinkTrees/asymmetric-bin_in_src-stdout.txt4
-rw-r--r--Tests/RunCMake/SymlinkTrees/asymmetric-separate-exe-build-stdout.txt4
-rw-r--r--Tests/RunCMake/SymlinkTrees/asymmetric-separate-stdout.txt4
-rw-r--r--Tests/RunCMake/SymlinkTrees/asymmetric-src_in_bin-exe-build-stdout.txt4
-rw-r--r--Tests/RunCMake/SymlinkTrees/asymmetric-src_in_bin-stdout.txt4
-rw-r--r--Tests/RunCMake/SymlinkTrees/common-bin_in_src-exe-build-stdout.txt4
-rw-r--r--Tests/RunCMake/SymlinkTrees/common-bin_in_src-stdout.txt4
-rw-r--r--Tests/RunCMake/SymlinkTrees/common-separate-exe-build-stdout.txt4
-rw-r--r--Tests/RunCMake/SymlinkTrees/common-separate-stdout.txt (renamed from Tests/RunCMake/SymlinkTrees/common_symlinks-stdout.txt)0
-rw-r--r--Tests/RunCMake/SymlinkTrees/common-src_in_bin-exe-build-stdout.txt4
-rw-r--r--Tests/RunCMake/SymlinkTrees/common-src_in_bin-stdout.txt4
-rw-r--r--Tests/RunCMake/SymlinkTrees/common_symlinks.cmake1
-rw-r--r--Tests/RunCMake/SymlinkTrees/different-bin_in_src-exe-build-stdout.txt4
-rw-r--r--Tests/RunCMake/SymlinkTrees/different-bin_in_src-stdout.txt4
-rw-r--r--Tests/RunCMake/SymlinkTrees/different-separate-exe-build-stdout.txt4
-rw-r--r--Tests/RunCMake/SymlinkTrees/different-separate-stdout.txt4
-rw-r--r--Tests/RunCMake/SymlinkTrees/different-src_in_bin-exe-build-stdout.txt4
-rw-r--r--Tests/RunCMake/SymlinkTrees/different-src_in_bin-stdout.txt4
-rw-r--r--Tests/RunCMake/SymlinkTrees/generic-exe-build-stdout.txt4
-rw-r--r--Tests/RunCMake/SymlinkTrees/none-bin_in_src-exe-build-stdout.txt4
-rw-r--r--Tests/RunCMake/SymlinkTrees/none-bin_in_src-stdout.txt4
-rw-r--r--Tests/RunCMake/SymlinkTrees/none-separate-exe-build-stdout.txt4
-rw-r--r--Tests/RunCMake/SymlinkTrees/none-separate-stdout.txt4
-rw-r--r--Tests/RunCMake/SymlinkTrees/none-src_in_bin-exe-build-stdout.txt4
-rw-r--r--Tests/RunCMake/SymlinkTrees/none-src_in_bin-stdout.txt4
29 files changed, 370 insertions, 20 deletions
diff --git a/Tests/RunCMake/SymlinkTrees/CMakeLists.txt b/Tests/RunCMake/SymlinkTrees/CMakeLists.txt
index d6fea2c..e16faea 100644
--- a/Tests/RunCMake/SymlinkTrees/CMakeLists.txt
+++ b/Tests/RunCMake/SymlinkTrees/CMakeLists.txt
@@ -1,3 +1,52 @@
cmake_minimum_required(VERSION 2.8.12)
project(${RunCMake_TEST} NONE)
-include("${include_dir}/${RunCMake_TEST}.cmake")
+
+message(STATUS "source: '${CMAKE_SOURCE_DIR}'")
+message(STATUS "binary: '${CMAKE_BINARY_DIR}'")
+get_filename_component(real_source "${CMAKE_SOURCE_DIR}" REALPATH)
+get_filename_component(real_binary "${CMAKE_BINARY_DIR}" REALPATH)
+message(STATUS "real source: '${real_source}'")
+message(STATUS "real binary: '${real_binary}'")
+
+if(RunCMake_TEST MATCHES "-exe")
+ enable_language(C)
+ file(WRITE "${CMAKE_SOURCE_DIR}/source.c" [[
+ #include <stdio.h>
+ #include "source.h"
+ #include "binary.h"
+ extern void print_binary_c(void);
+ extern void print_binary_c(void);
+ void print_source_c(void) {
+ printf("source.c: '%s'\n", __FILE__);
+ }
+ int main(void) {
+ print_source_c();
+ print_source_h();
+ print_binary_c();
+ print_binary_h();
+ return 0;
+ }
+ ]])
+ file(WRITE "${CMAKE_BINARY_DIR}/binary.c" [[
+ #include <stdio.h>
+ void print_binary_c(void) {
+ printf("binary.c: '%s'\n", __FILE__);
+ }
+ ]])
+ file(WRITE "${CMAKE_SOURCE_DIR}/include/source.h" [[
+ void print_source_h(void) {
+ printf("source.h: '%s'\n", __FILE__);
+ }
+ ]])
+ file(WRITE "${CMAKE_BINARY_DIR}/include/binary.h" [[
+ void print_binary_h(void) {
+ printf("binary.h: '%s'\n", __FILE__);
+ }
+ ]])
+ add_executable(exe source.c ${CMAKE_BINARY_DIR}/binary.c)
+ target_include_directories(exe PRIVATE
+ ${CMAKE_SOURCE_DIR}/include
+ ${CMAKE_BINARY_DIR}/include
+ )
+ add_custom_target(print ALL COMMAND exe)
+endif()
diff --git a/Tests/RunCMake/SymlinkTrees/PrintTrees.cmake b/Tests/RunCMake/SymlinkTrees/PrintTrees.cmake
deleted file mode 100644
index aa99127..0000000
--- a/Tests/RunCMake/SymlinkTrees/PrintTrees.cmake
+++ /dev/null
@@ -1,6 +0,0 @@
-message(STATUS "source: '${CMAKE_SOURCE_DIR}'")
-message(STATUS "binary: '${CMAKE_BINARY_DIR}'")
-get_filename_component(real_source "${CMAKE_SOURCE_DIR}" REALPATH)
-get_filename_component(real_binary "${CMAKE_BINARY_DIR}" REALPATH)
-message(STATUS "real source: '${real_source}'")
-message(STATUS "real binary: '${real_binary}'")
diff --git a/Tests/RunCMake/SymlinkTrees/RunCMakeTest.cmake b/Tests/RunCMake/SymlinkTrees/RunCMakeTest.cmake
index e5f1f7f..304e9de 100644
--- a/Tests/RunCMake/SymlinkTrees/RunCMakeTest.cmake
+++ b/Tests/RunCMake/SymlinkTrees/RunCMakeTest.cmake
@@ -1,34 +1,246 @@
include(RunCMake)
+function(run_symlink_test_case)
+ file(REMOVE_RECURSE
+ "${RunCMake_TEST_BINARY_DIR}/CMakeCache.txt"
+ "${RunCMake_TEST_BINARY_DIR}/CMakeFiles"
+ )
+ run_cmake_with_options(${ARGN})
+endfunction()
+
# This function assumes that ``${RunCMake_BINARY_DIR}/${name}/source`` and
# ``${RunCMake_BINARY_DIR}/${name}/binary`` are set up properly prior to
# calling it.
-function (run_symlink_test name)
+function (run_symlink_test case src bin src_from_bin bin_from_src)
+ string(REGEX REPLACE "-.*" "" name "${case}")
set(RunCMake_TEST_NO_CLEAN TRUE)
+ set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/${name}/${src}")
+ set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/${name}/${bin}")
configure_file(
"${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt"
- "${RunCMake_BINARY_DIR}/${name}/source/CMakeLists.txt"
+ "${RunCMake_TEST_SOURCE_DIR}/CMakeLists.txt"
COPYONLY)
- set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/${name}/source")
- set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/${name}/binary")
+
+ # We explicitly pass the source directory argument for each case.
+ set(RunCMake_TEST_NO_SOURCE_DIR 1)
+
+ # Test running in binary directory.
+ set(RunCMake_TEST_COMMAND_WORKING_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
# Emulate a shell using this directory.
- set(ENV{PWD} "${RunCMake_TEST_BINARY_DIR}")
- set(RunCMake_TEST_OPTIONS
- "-Dinclude_dir:PATH=${CMAKE_CURRENT_LIST_DIR}")
- run_cmake("${name}_symlinks")
+ set(ENV{PWD} "${RunCMake_TEST_COMMAND_WORKING_DIRECTORY}")
+
+ # Pass absolute path to the source tree, plain.
+ set(RunCMake_TEST_VARIANT_DESCRIPTION " $abs/${name}/${src}")
+ run_symlink_test_case("${case}" "${RunCMake_TEST_SOURCE_DIR}")
+
+ # Pass absolute path to the source tree, with -S.
+ set(RunCMake_TEST_VARIANT_DESCRIPTION " -S $abs/${name}/${src}")
+ run_symlink_test_case("${case}" -S "${RunCMake_TEST_SOURCE_DIR}")
+
+ # Pass relative path to the source tree, plain.
+ set(RunCMake_TEST_VARIANT_DESCRIPTION " ${src_from_bin}")
+ run_symlink_test_case("${case}" "${src_from_bin}")
+
+ # Pass relative path to the source tree, with -S.
+ set(RunCMake_TEST_VARIANT_DESCRIPTION " -S ${src_from_bin}")
+ run_symlink_test_case("${case}" -S "${src_from_bin}")
+
+ # Test running in source directory.
+ set(RunCMake_TEST_COMMAND_WORKING_DIRECTORY "${RunCMake_TEST_SOURCE_DIR}")
+ # Emulate a shell using this directory.
+ set(ENV{PWD} "${RunCMake_TEST_COMMAND_WORKING_DIRECTORY}")
+
+ # Pass absolute path to the binary tree with -B.
+ set(RunCMake_TEST_VARIANT_DESCRIPTION " -B $abs/${name}/${bin}")
+ run_symlink_test_case("${case}" -B "${RunCMake_TEST_BINARY_DIR}")
+
+ # Pass relative path to the binary tree with -B.
+ set(RunCMake_TEST_VARIANT_DESCRIPTION " -B ${bin_from_src}")
+ run_symlink_test_case("${case}" -B "${bin_from_src}")
+
+ # Test running in another directory.
+ set(RunCMake_TEST_COMMAND_WORKING_DIRECTORY "${RunCMake_BINARY_DIR}/${name}")
+ # Emulate a shell using this directory.
+ set(ENV{PWD} "${RunCMake_TEST_COMMAND_WORKING_DIRECTORY}")
+
+ # Pass absolute paths to the source and binary trees.
+ set(RunCMake_TEST_VARIANT_DESCRIPTION " -S $abs/${name}/${src} -B $abs/${name}/${bin}")
+ run_symlink_test_case("${case}" -S "${RunCMake_TEST_SOURCE_DIR}" -B "${RunCMake_TEST_BINARY_DIR}")
+
+ # Pass relative paths to the source and binary trees.
+ set(RunCMake_TEST_VARIANT_DESCRIPTION " -S ${src} -B ${bin}")
+ run_symlink_test_case("${case}" -S "${src}" -B "${bin}")
+
+ # Pass relative paths to the source and binary trees.
+ set(RunCMake_TEST_VARIANT_DESCRIPTION " -S ../${name}/${src} -B ../${name}/${bin}")
+ run_symlink_test_case("${case}" -S "../${name}/${src}" -B "../${name}/${bin}")
+
+ # Verify paths passed to compiler.
+ if(case MATCHES "^(different|asymmetric)-bin_in_src$")
+ # FIXME: Some generators compute incorrect relative paths.
+ message(STATUS "${case}-exe - SKIPPED")
+ message(STATUS "${case}-exe-build - SKIPPED")
+ return()
+ endif()
+ if(case MATCHES "^(different|asymmetric)-src_in_bin$" AND RunCMake_GENERATOR STREQUAL "Xcode")
+ # FIXME: The Xcode generator computes an incorrect relative path.
+ message(STATUS "${case}-exe - SKIPPED")
+ message(STATUS "${case}-exe-build - SKIPPED")
+ return()
+ endif()
+ unset(RunCMake_TEST_VARIANT_DESCRIPTION)
+ run_symlink_test_case("${case}-exe" -S "${src}" -B "${bin}")
+ if (RunCMake_GENERATOR MATCHES "Xcode")
+ # The native build system may pass the real paths.
+ set(RunCMake-stdout-file "generic-exe-build-stdout.txt")
+ endif()
+ set(RunCMake_TEST_OUTPUT_MERGE 1)
+ run_cmake_command("${case}-exe-build" ${CMAKE_COMMAND} --build "${bin}")
endfunction ()
# Create the following structure:
#
+# .../none/source
+# .../none/binary
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/none")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/none/source")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/none/binary")
+run_symlink_test(none-separate "source" "binary" "../source" "../binary")
+
+# Create the following structure:
+#
+# .../none/source
+# .../none/source/binary
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/none")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/none/source")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/none/source/binary")
+run_symlink_test(none-bin_in_src "source" "source/binary" ".." "binary")
+
+# Create the following structure:
+#
+# .../none/binary
+# .../none/binary/source
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/none")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/none/binary")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/none/binary/source")
+run_symlink_test(none-src_in_bin "binary/source" "binary" "source" "..")
+
+# Create the following structure:
+#
# .../common_real/source
# .../common_real/binary
# .../common -> common_real
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/common_real")
+file(REMOVE "${RunCMake_BINARY_DIR}/common")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/common_real/source")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/common_real/binary")
+file(CREATE_LINK "common_real" "${RunCMake_BINARY_DIR}/common" SYMBOLIC)
+run_symlink_test(common-separate "source" "binary" "../source" "../binary")
+
+# Create the following structure:
#
-# In this case, CMake should act as if .../common *is* .../common_real for all
-# computations except ``REALPATH``. This supports the case where a system has
-# a stable *symlink*, but not a stable target for that symlink.
+# .../common_real/source
+# .../common_real/source/binary
+# .../common -> common_real
file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/common_real")
file(REMOVE "${RunCMake_BINARY_DIR}/common")
file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/common_real/source")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/common_real/source/binary")
file(CREATE_LINK "common_real" "${RunCMake_BINARY_DIR}/common" SYMBOLIC)
-run_symlink_test(common)
+run_symlink_test(common-bin_in_src "source" "source/binary" ".." "binary")
+
+# Create the following structure:
+#
+# .../common_real/binary
+# .../common_real/binary/source
+# .../common -> common_real
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/common_real")
+file(REMOVE "${RunCMake_BINARY_DIR}/common")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/common_real/binary")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/common_real/binary/source")
+file(CREATE_LINK "common_real" "${RunCMake_BINARY_DIR}/common" SYMBOLIC)
+run_symlink_test(common-src_in_bin "binary/source" "binary" "source" "..")
+
+# Create the following structure:
+#
+# .../different_src/source_real
+# .../different_bin/binary_real
+# .../different/source -> ../different_src/source_real
+# .../different/binary -> ../different_bin/binary_real
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/different")
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/different_src")
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/different_bin")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/different")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/different_src/source_real")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/different_bin/binary_real")
+file(CREATE_LINK "../different_src/source_real" "${RunCMake_BINARY_DIR}/different/source" SYMBOLIC)
+file(CREATE_LINK "../different_bin/binary_real" "${RunCMake_BINARY_DIR}/different/binary" SYMBOLIC)
+run_symlink_test(different-separate "source" "binary" "../../different/source" "../../different/binary")
+
+# Create the following structure:
+#
+# .../different_src/source_real
+# .../different_bin/binary_real
+# .../different/source -> ../different_src/source_real
+# .../different_src/source_real/binary -> ../../different_bin/binary_real
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/different")
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/different_src")
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/different_bin")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/different")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/different_src/source_real")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/different_bin/binary_real")
+file(CREATE_LINK "../different_src/source_real" "${RunCMake_BINARY_DIR}/different/source" SYMBOLIC)
+file(CREATE_LINK "../../different_bin/binary_real" "${RunCMake_BINARY_DIR}/different_src/source_real/binary" SYMBOLIC)
+run_symlink_test(different-bin_in_src "source" "source/binary" "../../different/source" "binary")
+
+# Create the following structure:
+#
+# .../different_src/source_real
+# .../different_bin/binary_real
+# .../different/binary -> ../different_bin/binary_real
+# .../different_bin/binary_real/source -> ../../different_src/source_real
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/different")
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/different_src")
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/different_bin")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/different")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/different_src/source_real")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/different_bin/binary_real")
+file(CREATE_LINK "../different_bin/binary_real" "${RunCMake_BINARY_DIR}/different/binary" SYMBOLIC)
+file(CREATE_LINK "../../different_src/source_real" "${RunCMake_BINARY_DIR}/different_bin/binary_real/source" SYMBOLIC)
+run_symlink_test(different-src_in_bin "binary/source" "binary" "source" "../../different/binary")
+
+# Create the following structure:
+#
+# .../asymmetric_real/path/binary
+# .../asymmetric/source
+# .../asymmetric/binary -> ../asymmetric_real/path/binary
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/asymmetric")
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/asymmetric_real")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/asymmetric/source")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/asymmetric_real/path/binary")
+file(CREATE_LINK "../asymmetric_real/path/binary" "${RunCMake_BINARY_DIR}/asymmetric/binary" SYMBOLIC)
+run_symlink_test(asymmetric-separate "source" "binary" "../../../asymmetric/source" "../binary")
+
+# Create the following structure:
+#
+# .../asymmetric_real/path/binary
+# .../asymmetric/source
+# .../asymmetric/source/binary -> ../../asymmetric_real/path/binary
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/asymmetric")
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/asymmetric_real")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/asymmetric/source")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/asymmetric_real/path/binary")
+file(CREATE_LINK "../../asymmetric_real/path/binary" "${RunCMake_BINARY_DIR}/asymmetric/source/binary" SYMBOLIC)
+run_symlink_test(asymmetric-bin_in_src "source" "source/binary" "../../../asymmetric/source" "binary")
+
+# Create the following structure:
+#
+# .../asymmetric_real/path/source
+# .../asymmetric/binary
+# .../asymmetric/binary/source -> ../../asymmetric_real/path/source
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/asymmetric")
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/asymmetric_real")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/asymmetric/binary")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/asymmetric_real/path/source")
+file(CREATE_LINK "../../asymmetric_real/path/source" "${RunCMake_BINARY_DIR}/asymmetric/binary/source" SYMBOLIC)
+run_symlink_test(asymmetric-src_in_bin "binary/source" "binary" "source" "../../../asymmetric/binary")
diff --git a/Tests/RunCMake/SymlinkTrees/asymmetric-bin_in_src-exe-build-stdout.txt b/Tests/RunCMake/SymlinkTrees/asymmetric-bin_in_src-exe-build-stdout.txt
new file mode 100644
index 0000000..450d9f1
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/asymmetric-bin_in_src-exe-build-stdout.txt
@@ -0,0 +1,4 @@
+source.c: '[^']*/Tests/RunCMake/SymlinkTrees/asymmetric/source/source.c'
+source.h: '[^']*/Tests/RunCMake/SymlinkTrees/asymmetric/source/include/source.h'
+binary.c: '[^']*/Tests/RunCMake/SymlinkTrees/asymmetric/source/binary/binary.c'
+binary.h: '[^']*/Tests/RunCMake/SymlinkTrees/asymmetric/source/binary/include/binary.h'
diff --git a/Tests/RunCMake/SymlinkTrees/asymmetric-bin_in_src-stdout.txt b/Tests/RunCMake/SymlinkTrees/asymmetric-bin_in_src-stdout.txt
new file mode 100644
index 0000000..bc19ac9
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/asymmetric-bin_in_src-stdout.txt
@@ -0,0 +1,4 @@
+-- source: '[^']*/Tests/RunCMake/SymlinkTrees/asymmetric/source'
+-- binary: '[^']*/Tests/RunCMake/SymlinkTrees/asymmetric/source/binary'
+-- real source: '[^']*/Tests/RunCMake/SymlinkTrees/asymmetric/source'
+-- real binary: '[^']*/Tests/RunCMake/SymlinkTrees/asymmetric_real/path/binary'
diff --git a/Tests/RunCMake/SymlinkTrees/asymmetric-separate-exe-build-stdout.txt b/Tests/RunCMake/SymlinkTrees/asymmetric-separate-exe-build-stdout.txt
new file mode 100644
index 0000000..c1ad9d7
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/asymmetric-separate-exe-build-stdout.txt
@@ -0,0 +1,4 @@
+source.c: '[^']*/Tests/RunCMake/SymlinkTrees/asymmetric/source/source.c'
+source.h: '[^']*/Tests/RunCMake/SymlinkTrees/asymmetric/source/include/source.h'
+binary.c: '[^']*/Tests/RunCMake/SymlinkTrees/asymmetric/binary/binary.c'
+binary.h: '[^']*/Tests/RunCMake/SymlinkTrees/asymmetric/binary/include/binary.h'
diff --git a/Tests/RunCMake/SymlinkTrees/asymmetric-separate-stdout.txt b/Tests/RunCMake/SymlinkTrees/asymmetric-separate-stdout.txt
new file mode 100644
index 0000000..f103630
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/asymmetric-separate-stdout.txt
@@ -0,0 +1,4 @@
+-- source: '[^']*/Tests/RunCMake/SymlinkTrees/asymmetric/source'
+-- binary: '[^']*/Tests/RunCMake/SymlinkTrees/asymmetric/binary'
+-- real source: '[^']*/Tests/RunCMake/SymlinkTrees/asymmetric/source'
+-- real binary: '[^']*/Tests/RunCMake/SymlinkTrees/asymmetric_real/path/binary'
diff --git a/Tests/RunCMake/SymlinkTrees/asymmetric-src_in_bin-exe-build-stdout.txt b/Tests/RunCMake/SymlinkTrees/asymmetric-src_in_bin-exe-build-stdout.txt
new file mode 100644
index 0000000..4a33651
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/asymmetric-src_in_bin-exe-build-stdout.txt
@@ -0,0 +1,4 @@
+source.c: '[^']*/Tests/RunCMake/SymlinkTrees/asymmetric/binary/source/source.c'
+source.h: '[^']*/Tests/RunCMake/SymlinkTrees/asymmetric/binary/source/include/source.h'
+binary.c: '[^']*/Tests/RunCMake/SymlinkTrees/asymmetric/binary/binary.c'
+binary.h: '[^']*/Tests/RunCMake/SymlinkTrees/asymmetric/binary/include/binary.h'
diff --git a/Tests/RunCMake/SymlinkTrees/asymmetric-src_in_bin-stdout.txt b/Tests/RunCMake/SymlinkTrees/asymmetric-src_in_bin-stdout.txt
new file mode 100644
index 0000000..6b6bf11
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/asymmetric-src_in_bin-stdout.txt
@@ -0,0 +1,4 @@
+-- source: '[^']*/Tests/RunCMake/SymlinkTrees/asymmetric/binary/source'
+-- binary: '[^']*/Tests/RunCMake/SymlinkTrees/asymmetric/binary'
+-- real source: '[^']*/Tests/RunCMake/SymlinkTrees/asymmetric_real/path/source'
+-- real binary: '[^']*/Tests/RunCMake/SymlinkTrees/asymmetric/binary'
diff --git a/Tests/RunCMake/SymlinkTrees/common-bin_in_src-exe-build-stdout.txt b/Tests/RunCMake/SymlinkTrees/common-bin_in_src-exe-build-stdout.txt
new file mode 100644
index 0000000..d72e250
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/common-bin_in_src-exe-build-stdout.txt
@@ -0,0 +1,4 @@
+source.c: '[^']*/Tests/RunCMake/SymlinkTrees/common/source/source.c'
+source.h: '[^']*/Tests/RunCMake/SymlinkTrees/common/source/include/source.h'
+binary.c: '[^']*/Tests/RunCMake/SymlinkTrees/common/source/binary/binary.c'
+binary.h: '[^']*/Tests/RunCMake/SymlinkTrees/common/source/binary/include/binary.h'
diff --git a/Tests/RunCMake/SymlinkTrees/common-bin_in_src-stdout.txt b/Tests/RunCMake/SymlinkTrees/common-bin_in_src-stdout.txt
new file mode 100644
index 0000000..90dcf02
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/common-bin_in_src-stdout.txt
@@ -0,0 +1,4 @@
+-- source: '[^']*/Tests/RunCMake/SymlinkTrees/common/source'
+-- binary: '[^']*/Tests/RunCMake/SymlinkTrees/common/source/binary'
+-- real source: '[^']*/Tests/RunCMake/SymlinkTrees/common_real/source'
+-- real binary: '[^']*/Tests/RunCMake/SymlinkTrees/common_real/source/binary'
diff --git a/Tests/RunCMake/SymlinkTrees/common-separate-exe-build-stdout.txt b/Tests/RunCMake/SymlinkTrees/common-separate-exe-build-stdout.txt
new file mode 100644
index 0000000..7f73af2
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/common-separate-exe-build-stdout.txt
@@ -0,0 +1,4 @@
+source.c: '[^']*/Tests/RunCMake/SymlinkTrees/common/source/source.c'
+source.h: '[^']*/Tests/RunCMake/SymlinkTrees/common/source/include/source.h'
+binary.c: '[^']*/Tests/RunCMake/SymlinkTrees/common/binary/binary.c'
+binary.h: '[^']*/Tests/RunCMake/SymlinkTrees/common/binary/include/binary.h'
diff --git a/Tests/RunCMake/SymlinkTrees/common_symlinks-stdout.txt b/Tests/RunCMake/SymlinkTrees/common-separate-stdout.txt
index bb04450..bb04450 100644
--- a/Tests/RunCMake/SymlinkTrees/common_symlinks-stdout.txt
+++ b/Tests/RunCMake/SymlinkTrees/common-separate-stdout.txt
diff --git a/Tests/RunCMake/SymlinkTrees/common-src_in_bin-exe-build-stdout.txt b/Tests/RunCMake/SymlinkTrees/common-src_in_bin-exe-build-stdout.txt
new file mode 100644
index 0000000..aa0d60a
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/common-src_in_bin-exe-build-stdout.txt
@@ -0,0 +1,4 @@
+source.c: '[^']*/Tests/RunCMake/SymlinkTrees/common/binary/source/source.c'
+source.h: '[^']*/Tests/RunCMake/SymlinkTrees/common/binary/source/include/source.h'
+binary.c: '[^']*/Tests/RunCMake/SymlinkTrees/common/binary/binary.c'
+binary.h: '[^']*/Tests/RunCMake/SymlinkTrees/common/binary/include/binary.h'
diff --git a/Tests/RunCMake/SymlinkTrees/common-src_in_bin-stdout.txt b/Tests/RunCMake/SymlinkTrees/common-src_in_bin-stdout.txt
new file mode 100644
index 0000000..fc9db21
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/common-src_in_bin-stdout.txt
@@ -0,0 +1,4 @@
+-- source: '[^']*/Tests/RunCMake/SymlinkTrees/common/binary/source'
+-- binary: '[^']*/Tests/RunCMake/SymlinkTrees/common/binary'
+-- real source: '[^']*/Tests/RunCMake/SymlinkTrees/common_real/binary/source'
+-- real binary: '[^']*/Tests/RunCMake/SymlinkTrees/common_real/binary'
diff --git a/Tests/RunCMake/SymlinkTrees/common_symlinks.cmake b/Tests/RunCMake/SymlinkTrees/common_symlinks.cmake
deleted file mode 100644
index 5eafe26..0000000
--- a/Tests/RunCMake/SymlinkTrees/common_symlinks.cmake
+++ /dev/null
@@ -1 +0,0 @@
-include("${CMAKE_CURRENT_LIST_DIR}/PrintTrees.cmake")
diff --git a/Tests/RunCMake/SymlinkTrees/different-bin_in_src-exe-build-stdout.txt b/Tests/RunCMake/SymlinkTrees/different-bin_in_src-exe-build-stdout.txt
new file mode 100644
index 0000000..1bd1559
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/different-bin_in_src-exe-build-stdout.txt
@@ -0,0 +1,4 @@
+source.c: '[^']*/Tests/RunCMake/SymlinkTrees/different/source/source.c'
+source.h: '[^']*/Tests/RunCMake/SymlinkTrees/different/source/include/source.h'
+binary.c: '[^']*/Tests/RunCMake/SymlinkTrees/different/source/binary/binary.c'
+binary.h: '[^']*/Tests/RunCMake/SymlinkTrees/different/source/binary/include/binary.h'
diff --git a/Tests/RunCMake/SymlinkTrees/different-bin_in_src-stdout.txt b/Tests/RunCMake/SymlinkTrees/different-bin_in_src-stdout.txt
new file mode 100644
index 0000000..0533872
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/different-bin_in_src-stdout.txt
@@ -0,0 +1,4 @@
+-- source: '[^']*/Tests/RunCMake/SymlinkTrees/different/source'
+-- binary: '[^']*/Tests/RunCMake/SymlinkTrees/different/source/binary'
+-- real source: '[^']*/Tests/RunCMake/SymlinkTrees/different_src/source_real'
+-- real binary: '[^']*/Tests/RunCMake/SymlinkTrees/different_bin/binary_real'
diff --git a/Tests/RunCMake/SymlinkTrees/different-separate-exe-build-stdout.txt b/Tests/RunCMake/SymlinkTrees/different-separate-exe-build-stdout.txt
new file mode 100644
index 0000000..e598725
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/different-separate-exe-build-stdout.txt
@@ -0,0 +1,4 @@
+source.c: '[^']*/Tests/RunCMake/SymlinkTrees/different/source/source.c'
+source.h: '[^']*/Tests/RunCMake/SymlinkTrees/different/source/include/source.h'
+binary.c: '[^']*/Tests/RunCMake/SymlinkTrees/different/binary/binary.c'
+binary.h: '[^']*/Tests/RunCMake/SymlinkTrees/different/binary/include/binary.h'
diff --git a/Tests/RunCMake/SymlinkTrees/different-separate-stdout.txt b/Tests/RunCMake/SymlinkTrees/different-separate-stdout.txt
new file mode 100644
index 0000000..fe9c472
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/different-separate-stdout.txt
@@ -0,0 +1,4 @@
+-- source: '[^']*/Tests/RunCMake/SymlinkTrees/different/source'
+-- binary: '[^']*/Tests/RunCMake/SymlinkTrees/different/binary'
+-- real source: '[^']*/Tests/RunCMake/SymlinkTrees/different_src/source_real'
+-- real binary: '[^']*/Tests/RunCMake/SymlinkTrees/different_bin/binary_real'
diff --git a/Tests/RunCMake/SymlinkTrees/different-src_in_bin-exe-build-stdout.txt b/Tests/RunCMake/SymlinkTrees/different-src_in_bin-exe-build-stdout.txt
new file mode 100644
index 0000000..a5a2111
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/different-src_in_bin-exe-build-stdout.txt
@@ -0,0 +1,4 @@
+source.c: '[^']*/Tests/RunCMake/SymlinkTrees/different/binary/source/source.c'
+source.h: '[^']*/Tests/RunCMake/SymlinkTrees/different/binary/source/include/source.h'
+binary.c: '[^']*/Tests/RunCMake/SymlinkTrees/different/binary/binary.c'
+binary.h: '[^']*/Tests/RunCMake/SymlinkTrees/different/binary/include/binary.h'
diff --git a/Tests/RunCMake/SymlinkTrees/different-src_in_bin-stdout.txt b/Tests/RunCMake/SymlinkTrees/different-src_in_bin-stdout.txt
new file mode 100644
index 0000000..248e820
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/different-src_in_bin-stdout.txt
@@ -0,0 +1,4 @@
+-- source: '[^']*/Tests/RunCMake/SymlinkTrees/different/binary/source'
+-- binary: '[^']*/Tests/RunCMake/SymlinkTrees/different/binary'
+-- real source: '[^']*/Tests/RunCMake/SymlinkTrees/different_src/source_real'
+-- real binary: '[^']*/Tests/RunCMake/SymlinkTrees/different_bin/binary_real'
diff --git a/Tests/RunCMake/SymlinkTrees/generic-exe-build-stdout.txt b/Tests/RunCMake/SymlinkTrees/generic-exe-build-stdout.txt
new file mode 100644
index 0000000..db2173c
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/generic-exe-build-stdout.txt
@@ -0,0 +1,4 @@
+source.c: '[^']*/Tests/RunCMake/SymlinkTrees/[^']*/source.c'
+source.h: '[^']*/Tests/RunCMake/SymlinkTrees/[^']*/include/source.h'
+binary.c: '[^']*/Tests/RunCMake/SymlinkTrees/[^']*/binary.c'
+binary.h: '[^']*/Tests/RunCMake/SymlinkTrees/[^']*/include/binary.h'
diff --git a/Tests/RunCMake/SymlinkTrees/none-bin_in_src-exe-build-stdout.txt b/Tests/RunCMake/SymlinkTrees/none-bin_in_src-exe-build-stdout.txt
new file mode 100644
index 0000000..520d8a8
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/none-bin_in_src-exe-build-stdout.txt
@@ -0,0 +1,4 @@
+source.c: '[^']*/Tests/RunCMake/SymlinkTrees/none/source/source.c'
+source.h: '[^']*/Tests/RunCMake/SymlinkTrees/none/source/include/source.h'
+binary.c: '[^']*/Tests/RunCMake/SymlinkTrees/none/source/binary/binary.c'
+binary.h: '[^']*/Tests/RunCMake/SymlinkTrees/none/source/binary/include/binary.h'
diff --git a/Tests/RunCMake/SymlinkTrees/none-bin_in_src-stdout.txt b/Tests/RunCMake/SymlinkTrees/none-bin_in_src-stdout.txt
new file mode 100644
index 0000000..6d6af52
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/none-bin_in_src-stdout.txt
@@ -0,0 +1,4 @@
+-- source: '[^']*/Tests/RunCMake/SymlinkTrees/none/source'
+-- binary: '[^']*/Tests/RunCMake/SymlinkTrees/none/source/binary'
+-- real source: '[^']*/Tests/RunCMake/SymlinkTrees/none/source'
+-- real binary: '[^']*/Tests/RunCMake/SymlinkTrees/none/source/binary'
diff --git a/Tests/RunCMake/SymlinkTrees/none-separate-exe-build-stdout.txt b/Tests/RunCMake/SymlinkTrees/none-separate-exe-build-stdout.txt
new file mode 100644
index 0000000..90791d4
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/none-separate-exe-build-stdout.txt
@@ -0,0 +1,4 @@
+source.c: '[^']*/Tests/RunCMake/SymlinkTrees/none/source/source.c'
+source.h: '[^']*/Tests/RunCMake/SymlinkTrees/none/source/include/source.h'
+binary.c: '[^']*/Tests/RunCMake/SymlinkTrees/none/binary/binary.c'
+binary.h: '[^']*/Tests/RunCMake/SymlinkTrees/none/binary/include/binary.h'
diff --git a/Tests/RunCMake/SymlinkTrees/none-separate-stdout.txt b/Tests/RunCMake/SymlinkTrees/none-separate-stdout.txt
new file mode 100644
index 0000000..2251ac5
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/none-separate-stdout.txt
@@ -0,0 +1,4 @@
+-- source: '[^']*/Tests/RunCMake/SymlinkTrees/none/source'
+-- binary: '[^']*/Tests/RunCMake/SymlinkTrees/none/binary'
+-- real source: '[^']*/Tests/RunCMake/SymlinkTrees/none/source'
+-- real binary: '[^']*/Tests/RunCMake/SymlinkTrees/none/binary'
diff --git a/Tests/RunCMake/SymlinkTrees/none-src_in_bin-exe-build-stdout.txt b/Tests/RunCMake/SymlinkTrees/none-src_in_bin-exe-build-stdout.txt
new file mode 100644
index 0000000..07aed79
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/none-src_in_bin-exe-build-stdout.txt
@@ -0,0 +1,4 @@
+source.c: '[^']*/Tests/RunCMake/SymlinkTrees/none/binary/source/source.c'
+source.h: '[^']*/Tests/RunCMake/SymlinkTrees/none/binary/source/include/source.h'
+binary.c: '[^']*/Tests/RunCMake/SymlinkTrees/none/binary/binary.c'
+binary.h: '[^']*/Tests/RunCMake/SymlinkTrees/none/binary/include/binary.h'
diff --git a/Tests/RunCMake/SymlinkTrees/none-src_in_bin-stdout.txt b/Tests/RunCMake/SymlinkTrees/none-src_in_bin-stdout.txt
new file mode 100644
index 0000000..731d62a
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/none-src_in_bin-stdout.txt
@@ -0,0 +1,4 @@
+-- source: '[^']*/Tests/RunCMake/SymlinkTrees/none/binary/source'
+-- binary: '[^']*/Tests/RunCMake/SymlinkTrees/none/binary'
+-- real source: '[^']*/Tests/RunCMake/SymlinkTrees/none/binary/source'
+-- real binary: '[^']*/Tests/RunCMake/SymlinkTrees/none/binary'