summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-05-23 13:22:25 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-05-23 13:22:37 (GMT)
commitf03a80aefd4073bc1502c2e486fedfdbd8addfb6 (patch)
tree480503316d058e68c009be397034c60782c74a83 /Tests
parenta4faf7788cc40b17c48a9393cd15425ee65abfd9 (diff)
parent5a1af142f120ccc6834efcf786e346b06e0f05c6 (diff)
downloadCMake-f03a80aefd4073bc1502c2e486fedfdbd8addfb6.zip
CMake-f03a80aefd4073bc1502c2e486fedfdbd8addfb6.tar.gz
CMake-f03a80aefd4073bc1502c2e486fedfdbd8addfb6.tar.bz2
Merge topic 'genex-target-property-lifetime'
5a1af142f1 Genex: Fix value lifetimes in nested TARGET_PROPERTY evaluation Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3362
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-INCLUDE_DIRECTORIES.cmake18
2 files changed, 19 insertions, 0 deletions
diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
index 8abf70d..68a0172 100644
--- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
@@ -53,6 +53,7 @@ run_cmake_with_options(TARGET_FILE_BASE_NAME -DCMAKE_BUILD_TYPE:STRING=Debug)
run_cmake_with_options(TARGET_FILE_BASE_NAME-imported-target -DCMAKE_BUILD_TYPE:STRING=Debug)
run_cmake(TARGET_FILE_BASE_NAME-non-valid-target)
run_cmake(TARGET_LINKER_FILE_BASE_NAME-non-valid-target)
+run_cmake(TARGET_PROPERTY-INCLUDE_DIRECTORIES)
run_cmake(TARGET_PROPERTY-LOCATION)
run_cmake(TARGET_PROPERTY-SOURCES)
run_cmake(LINK_ONLY-not-linking)
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-INCLUDE_DIRECTORIES.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-INCLUDE_DIRECTORIES.cmake
new file mode 100644
index 0000000..cb6f4d8
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-INCLUDE_DIRECTORIES.cmake
@@ -0,0 +1,18 @@
+cmake_minimum_required(VERSION 3.14)
+enable_language(C)
+
+add_library(foo1 STATIC empty.c)
+target_include_directories(foo1 PUBLIC include)
+target_link_libraries(foo1 PRIVATE foo2 foo3 foo4)
+
+add_library(foo2 STATIC empty.c)
+target_include_directories(foo2 PUBLIC $<TARGET_PROPERTY:foo1,INCLUDE_DIRECTORIES>)
+
+add_library(foo3 STATIC empty.c)
+target_include_directories(foo3 PUBLIC $<TARGET_PROPERTY:foo2,INCLUDE_DIRECTORIES>)
+
+add_library(foo4 STATIC empty.c)
+target_include_directories(foo4 PUBLIC $<TARGET_PROPERTY:foo3,INCLUDE_DIRECTORIES>)
+
+# Evaluate a genex that looks up INCLUDE_DIRECTORIES on multiple targets.
+file(GENERATE OUTPUT out.txt CONTENT "$<TARGET_PROPERTY:foo4,INCLUDE_DIRECTORIES>")