summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CMP0118/GenInSubdir
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-03-17 16:44:48 (GMT)
committerBrad King <brad.king@kitware.com>2021-03-18 13:57:49 (GMT)
commit06feb845aab7127a3067567a8fffb5777eac8187 (patch)
tree8ffb21abe868bb96eff177bf3ff4eddb4554c69e /Tests/RunCMake/CMP0118/GenInSubdir
parentfab7fe7ef5a5462952297611c1dd668a603e3a36 (diff)
downloadCMake-06feb845aab7127a3067567a8fffb5777eac8187.zip
CMake-06feb845aab7127a3067567a8fffb5777eac8187.tar.gz
CMake-06feb845aab7127a3067567a8fffb5777eac8187.tar.bz2
CMP0118: Fix NEW behavior when looking up target sources
Under the CMP0118 NEW behavior, sources generated in one directory should be visible when added to targets in other directories. This was accidentally left out of commit 6624b65b3f (GENERATED prop: Add implementation for policy CMP0118 being set to NEW, 2020-11-09, v3.20.0-rc1~393^2~1). Fixes: #18399
Diffstat (limited to 'Tests/RunCMake/CMP0118/GenInSubdir')
-rw-r--r--Tests/RunCMake/CMP0118/GenInSubdir/CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMP0118/GenInSubdir/CMakeLists.txt b/Tests/RunCMake/CMP0118/GenInSubdir/CMakeLists.txt
new file mode 100644
index 0000000..3f1ce8d
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/GenInSubdir/CMakeLists.txt
@@ -0,0 +1,9 @@
+add_custom_command(
+ OUTPUT sub.txt
+ COMMAND ${CMAKE_COMMAND} -E touch sub.txt
+ VERBATIM
+ )
+add_custom_target(gen DEPENDS sub.txt)
+
+add_dependencies(top gen)
+target_sources(top PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/sub.txt)