summaryrefslogtreecommitdiffstats
path: root/Tests/OutOfSource
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-08-03 17:38:21 (GMT)
committerBrad King <brad.king@kitware.com>2022-08-03 18:58:47 (GMT)
commit5e0b06fe849ee035bedbeac1bd2bfe05f7f8d860 (patch)
tree44f64b7e1e85375dce2816e19428f118e1d6a522 /Tests/OutOfSource
parent9d24d62098d6bf2f9dc4c8e97b39310181443ba3 (diff)
downloadCMake-5e0b06fe849ee035bedbeac1bd2bfe05f7f8d860.zip
CMake-5e0b06fe849ee035bedbeac1bd2bfe05f7f8d860.tar.gz
CMake-5e0b06fe849ee035bedbeac1bd2bfe05f7f8d860.tar.bz2
Makefiles: Restore path consistency in the global dispatch makefile
Directory-level rules in `CMakeFiles/Makefile2` were previously previously written by each directory's local generator using its own decision for using relative or absolute paths. Since commit d33b12d84b (Add support for build tree symlink inside source tree, 2022-02-25, v3.24.0-rc1~583^2), each local generator explicitly models the relationship between its source and build paths, and uses this to determine when it is safe to use relative paths. Because `add_subdirectory` supports arbitrary placement of the source and build directories, different local generators may have different relationships between their source and build paths. This can cause disagreement among rules written to `CMakeFiles/Makefile2`. Restore consistency by always using the root local generator to write rules to `CMakeFiles/Makefile2`. Relative paths should always be expressed w.r.t. the top-level build directory since that is the working directory in which the `make` tool processing the file will run. Fixes: #23814
Diffstat (limited to 'Tests/OutOfSource')
-rw-r--r--Tests/OutOfSource/CMakeLists.txt3
-rw-r--r--Tests/OutOfSource/SubInBuildCMakeLists.cmake1
2 files changed, 4 insertions, 0 deletions
diff --git a/Tests/OutOfSource/CMakeLists.txt b/Tests/OutOfSource/CMakeLists.txt
index 4687882..c82d077 100644
--- a/Tests/OutOfSource/CMakeLists.txt
+++ b/Tests/OutOfSource/CMakeLists.txt
@@ -16,3 +16,6 @@ configure_file(
)
set(KEN 1)
+
+configure_file(SubInBuildCMakeLists.cmake ${CMAKE_CURRENT_BINARY_DIR}/SubInBuild/CMakeLists.txt COPYONLY)
+add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/SubInBuild ${CMAKE_CURRENT_BINARY_DIR}/SubInBuild/Build)
diff --git a/Tests/OutOfSource/SubInBuildCMakeLists.cmake b/Tests/OutOfSource/SubInBuildCMakeLists.cmake
new file mode 100644
index 0000000..c2e2942
--- /dev/null
+++ b/Tests/OutOfSource/SubInBuildCMakeLists.cmake
@@ -0,0 +1 @@
+add_custom_target(SubInBuildCustom ALL)