summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/BuildDepends/BuildUnderSource.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-07-24 13:53:53 (GMT)
committerBrad King <brad.king@kitware.com>2019-07-24 15:37:31 (GMT)
commitd46bac5d38320907cc1f11a223fddd9a11c9b184 (patch)
treee38aa928a8ea7b7f8194740d813d1c074d04e36e /Tests/RunCMake/BuildDepends/BuildUnderSource.cmake
parent79bcf4e1655ffa38e8f4740b19ec3a14ac567eec (diff)
downloadCMake-d46bac5d38320907cc1f11a223fddd9a11c9b184.zip
CMake-d46bac5d38320907cc1f11a223fddd9a11c9b184.tar.gz
CMake-d46bac5d38320907cc1f11a223fddd9a11c9b184.tar.bz2
Makefile: Fix regression in dependencies on relative includes
Since commit a13a5c948e (Replace use of CollapseCombinedPath with CollapseFullPath, 2019-03-19, v3.15.0-rc1~361^2~1), one code path now calls `CollapseFullPath` with a base path that may be relative. Backport KWSys commit c6f8e24a3 (SystemTools: Fix CollapseFullPath with relative base path, 2019-07-24) to handle such base paths. This case occurs when a build tree is placed in a directory inside a source tree such that CMake is willing to generate a relative path from the build tree to the source tree. Add a test covering this case. Fixes: #19507
Diffstat (limited to 'Tests/RunCMake/BuildDepends/BuildUnderSource.cmake')
-rw-r--r--Tests/RunCMake/BuildDepends/BuildUnderSource.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/Tests/RunCMake/BuildDepends/BuildUnderSource.cmake b/Tests/RunCMake/BuildDepends/BuildUnderSource.cmake
new file mode 100644
index 0000000..aa2a44f
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/BuildUnderSource.cmake
@@ -0,0 +1,9 @@
+enable_language(C)
+include_directories(include)
+add_executable(BuildUnderSource BuildUnderSource.c)
+
+file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT "
+set(check_pairs
+ \"$<TARGET_FILE:BuildUnderSource>|${CMAKE_CURRENT_SOURCE_DIR}/include/BuildUnderSource.h\"
+ )
+")