summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/ExportImport/Export/CMakeLists.txt12
-rw-r--r--Tests/ExportImport/Export/Interface/CMakeLists.txt12
-rw-r--r--Tests/ExportImport/Export/Interface/source_target.cpp13
-rw-r--r--Tests/ExportImport/Export/Interface/source_target_for_install.cpp13
-rw-r--r--Tests/ExportImport/Export/testLibPerConfigDest.c1
-rw-r--r--Tests/ExportImport/Import/A/CMakeLists.txt2
-rw-r--r--Tests/ExportImport/Import/A/imp_testExe1.c2
-rw-r--r--Tests/ExportImport/Import/Interface/CMakeLists.txt8
-rw-r--r--Tests/ExportImport/Import/Interface/source_target_test.cpp7
-rw-r--r--Tests/RunCMake/CMakeLists.txt6
-rw-r--r--Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-result.txt (renamed from Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-NEW-result.txt)0
-rw-r--r--Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-stderr_INCLUDE_DIRECTORIES.txt (renamed from Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-NEW-stderr.txt)2
-rw-r--r--Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-OLD-result.txt (renamed from Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-OLD-result.txt)0
-rw-r--r--Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-result.txt (renamed from Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-WARN-result.txt)0
-rw-r--r--Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-stderr_INCLUDE_DIRECTORIES.txt (renamed from Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-WARN-stderr.txt)6
-rw-r--r--Tests/RunCMake/IfacePaths/BinInInstallPrefix-result.txt (renamed from Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-NEW-result.txt)0
-rw-r--r--Tests/RunCMake/IfacePaths/BinInInstallPrefix-stderr_SOURCES.txt6
-rw-r--r--Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-result.txt (renamed from Tests/RunCMake/include_directories/BinaryDirectoryInInterface-result.txt)0
-rw-r--r--Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-stderr_INCLUDE_DIRECTORIES.txt (renamed from Tests/RunCMake/include_directories/InstallInBinDir-stderr.txt)2
-rw-r--r--Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-stderr_SOURCES.txt6
-rw-r--r--Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface.cmake15
-rw-r--r--Tests/RunCMake/IfacePaths/CMakeLists.txt6
-rw-r--r--Tests/RunCMake/IfacePaths/DirInInstallPrefix-result.txt (renamed from Tests/RunCMake/include_directories/DirInInstallPrefix-result.txt)0
-rw-r--r--Tests/RunCMake/IfacePaths/DirInInstallPrefix.cmake14
-rw-r--r--Tests/RunCMake/IfacePaths/InstallInBinDir-result.txt (renamed from Tests/RunCMake/include_directories/InstallInBinDir-result.txt)0
-rw-r--r--Tests/RunCMake/IfacePaths/InstallInBinDir-stderr_INCLUDE_DIRECTORIES.txt (renamed from Tests/RunCMake/include_directories/BinaryDirectoryInInterface-stderr.txt)2
-rw-r--r--Tests/RunCMake/IfacePaths/InstallInBinDir-stderr_SOURCES.txt6
-rw-r--r--Tests/RunCMake/IfacePaths/InstallInSrcDir-result.txt (renamed from Tests/RunCMake/include_directories/InstallInSrcDir-result.txt)0
-rw-r--r--Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr_INCLUDE_DIRECTORIES.txt (renamed from Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-NEW-stderr.txt)2
-rw-r--r--Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr_SOURCES.txt6
-rw-r--r--Tests/RunCMake/IfacePaths/InstallPrefixInInterface-result.txt (renamed from Tests/RunCMake/include_directories/InstallPrefixInInterface-result.txt)0
-rw-r--r--Tests/RunCMake/IfacePaths/InstallPrefixInInterface.cmake (renamed from Tests/RunCMake/include_directories/InstallPrefixInInterface.cmake)0
-rw-r--r--Tests/RunCMake/IfacePaths/InstallToPrefixInSrcDirInSource-result.txt (renamed from Tests/RunCMake/include_directories/InstallToPrefixInSrcDirInSource-result.txt)0
-rw-r--r--Tests/RunCMake/IfacePaths/InstallToPrefixInSrcDirOutOfSource-result.txt (renamed from Tests/RunCMake/include_directories/InstallToPrefixInSrcDirOutOfSource-result.txt)0
-rw-r--r--Tests/RunCMake/IfacePaths/RelativePathInGenex-result.txt (renamed from Tests/RunCMake/include_directories/RelativePathInGenex-result.txt)0
-rw-r--r--Tests/RunCMake/IfacePaths/RelativePathInGenex-stderr_INCLUDE_DIRECTORIES.txt (renamed from Tests/RunCMake/include_directories/RelativePathInGenex-stderr.txt)0
-rw-r--r--Tests/RunCMake/IfacePaths/RelativePathInGenex-stderr_SOURCES.txt4
-rw-r--r--Tests/RunCMake/IfacePaths/RelativePathInGenex.cmake13
-rw-r--r--Tests/RunCMake/IfacePaths/RelativePathInInterface-result.txt (renamed from Tests/RunCMake/include_directories/RelativePathInInterface-result.txt)0
-rw-r--r--Tests/RunCMake/IfacePaths/RelativePathInInterface-stderr_INCLUDE_DIRECTORIES.txt (renamed from Tests/RunCMake/include_directories/RelativePathInInterface-stderr.txt)0
-rw-r--r--Tests/RunCMake/IfacePaths/RelativePathInInterface-stderr_SOURCES.txt4
-rw-r--r--Tests/RunCMake/IfacePaths/RelativePathInInterface.cmake14
-rw-r--r--Tests/RunCMake/IfacePaths/RunCMakeTest.cmake156
-rw-r--r--Tests/RunCMake/IfacePaths/SourceDirectoryInInterface-result.txt (renamed from Tests/RunCMake/include_directories/SourceDirectoryInInterface-result.txt)0
-rw-r--r--Tests/RunCMake/IfacePaths/SourceDirectoryInInterface-stderr_INCLUDE_DIRECTORIES.txt (renamed from Tests/RunCMake/include_directories/SourceDirectoryInInterface-stderr.txt)2
-rw-r--r--Tests/RunCMake/IfacePaths/SourceDirectoryInInterface-stderr_SOURCES.txt6
-rw-r--r--Tests/RunCMake/IfacePaths/SourceDirectoryInInterface.cmake15
-rw-r--r--Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-result.txt (renamed from Tests/RunCMake/TargetSources/ExportInstall-result.txt)0
-rw-r--r--Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-stderr_INCLUDE_DIRECTORIES.txt (renamed from Tests/RunCMake/include_directories/InstallInSrcDir-stderr.txt)2
-rw-r--r--Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-OLD-result.txt (renamed from Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-OLD-result.txt)0
-rw-r--r--Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-result.txt (renamed from Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-WARN-result.txt)0
-rw-r--r--Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-stderr_INCLUDE_DIRECTORIES.txt (renamed from Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-WARN-stderr.txt)6
-rw-r--r--Tests/RunCMake/IfacePaths/SrcInInstallPrefix-result.txt1
-rw-r--r--Tests/RunCMake/IfacePaths/SrcInInstallPrefix-stderr_SOURCES.txt6
-rw-r--r--Tests/RunCMake/IfacePaths/empty.cpp0
-rw-r--r--Tests/RunCMake/IfacePaths/export-NOWARN-result.txt (renamed from Tests/RunCMake/include_directories/export-NOWARN-result.txt)0
-rw-r--r--Tests/RunCMake/IfacePaths/export-NOWARN.cmake (renamed from Tests/RunCMake/include_directories/export-NOWARN.cmake)15
-rw-r--r--Tests/RunCMake/TargetSources/ExportBuild-result.txt2
-rw-r--r--Tests/RunCMake/TargetSources/ExportBuild-stderr.txt1
-rw-r--r--Tests/RunCMake/TargetSources/ExportInstall-stderr.txt1
-rw-r--r--Tests/RunCMake/TargetSources/ExportInstall.cmake6
-rw-r--r--Tests/RunCMake/TargetSources/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/include_directories/BinaryDirectoryInInterface.cmake11
-rw-r--r--Tests/RunCMake/include_directories/CMakeLists.txt5
-rw-r--r--Tests/RunCMake/include_directories/DirInInstallPrefix.cmake9
-rw-r--r--Tests/RunCMake/include_directories/RelativePathInGenex.cmake8
-rw-r--r--Tests/RunCMake/include_directories/RelativePathInInterface.cmake11
-rw-r--r--Tests/RunCMake/include_directories/RunCMakeTest.cmake141
-rw-r--r--Tests/RunCMake/include_directories/SourceDirectoryInInterface.cmake11
-rw-r--r--Tests/RunCMake/install/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/install/TARGETS-DESTINATION-bad-result.txt1
-rw-r--r--Tests/RunCMake/install/TARGETS-DESTINATION-bad-stderr.txt6
-rw-r--r--Tests/RunCMake/install/TARGETS-DESTINATION-bad.cmake3
-rw-r--r--Tests/RunCMake/install/empty.c0
74 files changed, 390 insertions, 221 deletions
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt
index e130eca..0df42d9 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -68,6 +68,11 @@ add_library(testLib5 SHARED testLib5.c)
add_library(testLib6 STATIC testLib6.cxx testLib6c.c)
+add_library(testLibPerConfigDest STATIC testLibPerConfigDest.c)
+install(TARGETS testLibPerConfigDest EXPORT exp
+ DESTINATION lib/$<$<BOOL:$<CONFIG>>:$<CONFIG>>$<$<NOT:$<BOOL:$<CONFIG>>>:NoConfig>
+ )
+
# Work-around: Visual Studio 6 does not support per-target object files.
set(VS6)
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
@@ -446,9 +451,9 @@ install(
cmp0022NEW cmp0022OLD
systemlib
EXPORT exp
- RUNTIME DESTINATION bin
- LIBRARY DESTINATION lib NAMELINK_SKIP
- ARCHIVE DESTINATION lib
+ RUNTIME DESTINATION $<1:bin>
+ LIBRARY DESTINATION $<1:lib> NAMELINK_SKIP
+ ARCHIVE DESTINATION $<1:lib>
FRAMEWORK DESTINATION Frameworks
BUNDLE DESTINATION Applications
)
@@ -503,6 +508,7 @@ export(TARGETS testExe1 testLib1 testLib2 testLib3
export(TARGETS testExe2 testLib4 testLib5 testLib6 testExe3 testExe2lib
testLib4lib testLib4libdbg testLib4libopt
testLibCycleA testLibCycleB
+ testLibPerConfigDest
NAMESPACE bld_
APPEND FILE ExportBuildTree.cmake
)
diff --git a/Tests/ExportImport/Export/Interface/CMakeLists.txt b/Tests/ExportImport/Export/Interface/CMakeLists.txt
index 523fc29..00a5375 100644
--- a/Tests/ExportImport/Export/Interface/CMakeLists.txt
+++ b/Tests/ExportImport/Export/Interface/CMakeLists.txt
@@ -29,7 +29,17 @@ target_compile_features(use_auto_type INTERFACE cxx_auto_type)
add_library(use_c_restrict INTERFACE)
target_compile_features(use_c_restrict INTERFACE c_restrict)
-install(TARGETS headeronly sharediface use_auto_type use_c_restrict
+add_library(source_target INTERFACE)
+target_sources(source_target INTERFACE
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/source_target.cpp>
+ $<INSTALL_INTERFACE:$<INSTALL_PREFIX>/src/source_target_for_install.cpp>
+)
+install(FILES
+ source_target_for_install.cpp
+ DESTINATION src
+)
+
+install(TARGETS headeronly sharediface use_auto_type use_c_restrict source_target
EXPORT expInterface
)
install(TARGETS sharedlib
diff --git a/Tests/ExportImport/Export/Interface/source_target.cpp b/Tests/ExportImport/Export/Interface/source_target.cpp
new file mode 100644
index 0000000..037191c
--- /dev/null
+++ b/Tests/ExportImport/Export/Interface/source_target.cpp
@@ -0,0 +1,13 @@
+
+#ifndef USE_FROM_BUILD_DIR
+#error Expected define USE_FROM_BUILD_DIR
+#endif
+
+#ifdef USE_FROM_INSTALL_DIR
+#error Unexpected define USE_FROM_INSTALL_DIR
+#endif
+
+int source_symbol()
+{
+ return 42;
+}
diff --git a/Tests/ExportImport/Export/Interface/source_target_for_install.cpp b/Tests/ExportImport/Export/Interface/source_target_for_install.cpp
new file mode 100644
index 0000000..64514ed
--- /dev/null
+++ b/Tests/ExportImport/Export/Interface/source_target_for_install.cpp
@@ -0,0 +1,13 @@
+
+#ifdef USE_FROM_BUILD_DIR
+#error Unexpected define USE_FROM_BUILD_DIR
+#endif
+
+#ifndef USE_FROM_INSTALL_DIR
+#error Expected define USE_FROM_INSTALL_DIR
+#endif
+
+int source_symbol()
+{
+ return 42;
+}
diff --git a/Tests/ExportImport/Export/testLibPerConfigDest.c b/Tests/ExportImport/Export/testLibPerConfigDest.c
new file mode 100644
index 0000000..c7113fc
--- /dev/null
+++ b/Tests/ExportImport/Export/testLibPerConfigDest.c
@@ -0,0 +1 @@
+int testLibPerConfigDest(void) { return 0; }
diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt
index 358776b..ced7b03 100644
--- a/Tests/ExportImport/Import/A/CMakeLists.txt
+++ b/Tests/ExportImport/Import/A/CMakeLists.txt
@@ -34,6 +34,7 @@ target_link_libraries(imp_testExe1
exp_testLib5
exp_testLib6
exp_testLibCycleA
+ exp_testLibPerConfigDest
)
# Try building a plugin to an executable imported from the install tree.
@@ -66,6 +67,7 @@ target_link_libraries(imp_testExe1b
bld_testLib5
bld_testLib6
bld_testLibCycleA
+ bld_testLibPerConfigDest
)
add_custom_target(check_testLib1_genex ALL
diff --git a/Tests/ExportImport/Import/A/imp_testExe1.c b/Tests/ExportImport/Import/A/imp_testExe1.c
index 451998a..150fcef 100644
--- a/Tests/ExportImport/Import/A/imp_testExe1.c
+++ b/Tests/ExportImport/Import/A/imp_testExe1.c
@@ -7,6 +7,7 @@ extern int testLib4lib();
extern int testLib5();
extern int testLib6();
extern int testLibCycleA1();
+extern int testLibPerConfigDest();
/* Switch a symbol between debug and optimized builds to make sure the
proper library is found from the testLib4 link interface. */
@@ -21,5 +22,6 @@ int main()
{
return (testLib2() + generated_by_testExe1() + testLib3() + testLib4()
+ testLib5() + testLib6() + testLibCycleA1()
+ + testLibPerConfigDest()
+ generated_by_testExe3() + testLib4lib() + testLib4libcfg());
}
diff --git a/Tests/ExportImport/Import/Interface/CMakeLists.txt b/Tests/ExportImport/Import/Interface/CMakeLists.txt
index 4028405..51d518e 100644
--- a/Tests/ExportImport/Import/Interface/CMakeLists.txt
+++ b/Tests/ExportImport/Import/Interface/CMakeLists.txt
@@ -82,6 +82,14 @@ endmacro()
do_try_compile(bld)
+add_executable(source_target_test_bld source_target_test.cpp)
+target_link_libraries(source_target_test_bld bld::source_target)
+target_compile_definitions(source_target_test_bld PRIVATE USE_FROM_BUILD_DIR)
+
+add_executable(source_target_test_exp source_target_test.cpp)
+target_link_libraries(source_target_test_exp exp::source_target)
+target_compile_definitions(source_target_test_exp PRIVATE USE_FROM_INSTALL_DIR)
+
add_executable(headeronlytest_exp headeronlytest.cpp)
target_link_libraries(headeronlytest_exp exp::headeronly)
diff --git a/Tests/ExportImport/Import/Interface/source_target_test.cpp b/Tests/ExportImport/Import/Interface/source_target_test.cpp
new file mode 100644
index 0000000..0e8ec5f
--- /dev/null
+++ b/Tests/ExportImport/Import/Interface/source_target_test.cpp
@@ -0,0 +1,7 @@
+
+extern int source_symbol();
+
+int main()
+{
+ return source_symbol() - 42;
+}
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 2973fe9..2de82a7 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -189,6 +189,12 @@ add_RunCMake_test(install)
add_RunCMake_test(CPackInstallProperties)
add_RunCMake_test(ExternalProject)
+set(IfacePaths_INCLUDE_DIRECTORIES_ARGS -DTEST_PROP=INCLUDE_DIRECTORIES)
+add_RunCMake_test(IfacePaths_INCLUDE_DIRECTORIES TEST_DIR IfacePaths)
+
+set(IfacePaths_SOURCES_ARGS -DTEST_PROP=SOURCES)
+add_RunCMake_test(IfacePaths_SOURCES TEST_DIR IfacePaths)
+
if(RPMBUILD)
add_RunCMake_test(CPackRPM)
endif()
diff --git a/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-NEW-result.txt b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-NEW-result.txt
+++ b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-result.txt
diff --git a/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-NEW-stderr.txt b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-stderr_INCLUDE_DIRECTORIES.txt
index f0adc9f..f2d749b 100644
--- a/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-NEW-stderr.txt
+++ b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-stderr_INCLUDE_DIRECTORIES.txt
@@ -1,6 +1,6 @@
CMake Error in CMakeLists.txt:
Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path:
- ".*Tests/RunCMake/include_directories/prefix/BinInInstallPrefix-CMP0052-NEW-build/foo"
+ ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix/BinInInstallPrefix-CMP0052-NEW-build/foo"
which is prefixed in the build directory.
diff --git a/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-OLD-result.txt b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-OLD-result.txt
index 573541a..573541a 100644
--- a/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-OLD-result.txt
+++ b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-OLD-result.txt
diff --git a/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-WARN-result.txt b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-result.txt
index 573541a..573541a 100644
--- a/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-WARN-result.txt
+++ b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-result.txt
diff --git a/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-WARN-stderr.txt b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-stderr_INCLUDE_DIRECTORIES.txt
index 054bff5..3d83892 100644
--- a/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-WARN-stderr.txt
+++ b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-stderr_INCLUDE_DIRECTORIES.txt
@@ -6,15 +6,15 @@ CMake Warning \(dev\) in CMakeLists.txt:
Directory:
- ".*Tests/RunCMake/include_directories/prefix/BinInInstallPrefix-CMP0052-WARN-build/foo"
+ ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix/BinInInstallPrefix-CMP0052-WARN-build/foo"
in INTERFACE_INCLUDE_DIRECTORIES of target "testTarget" is a subdirectory
of the install directory:
- ".*Tests/RunCMake/include_directories/prefix"
+ ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix"
however it is also a subdirectory of the build tree:
- ".*Tests/RunCMake/include_directories/prefix/BinInInstallPrefix-CMP0052-WARN-build"
+ ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix/BinInInstallPrefix-CMP0052-WARN-build"
This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-NEW-result.txt b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-NEW-result.txt
+++ b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-result.txt
diff --git a/Tests/RunCMake/IfacePaths/BinInInstallPrefix-stderr_SOURCES.txt b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-stderr_SOURCES.txt
new file mode 100644
index 0000000..239c069
--- /dev/null
+++ b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-stderr_SOURCES.txt
@@ -0,0 +1,6 @@
+CMake Error in CMakeLists.txt:
+ Target "testTarget" INTERFACE_SOURCES property contains path:
+
+ ".*Tests/RunCMake/IfacePaths_SOURCES/prefix/BinInInstallPrefix-build/empty.cpp"
+
+ which is prefixed in the build directory.
diff --git a/Tests/RunCMake/include_directories/BinaryDirectoryInInterface-result.txt b/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/include_directories/BinaryDirectoryInInterface-result.txt
+++ b/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-result.txt
diff --git a/Tests/RunCMake/include_directories/InstallInBinDir-stderr.txt b/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-stderr_INCLUDE_DIRECTORIES.txt
index 254fae1..ed7cd58 100644
--- a/Tests/RunCMake/include_directories/InstallInBinDir-stderr.txt
+++ b/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-stderr_INCLUDE_DIRECTORIES.txt
@@ -1,6 +1,6 @@
CMake Error in CMakeLists.txt:
Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path:
- ".*Tests/RunCMake/include_directories/InstallInBinDir-build/foo"
+ ".*RunCMake/IfacePaths_INCLUDE_DIRECTORIES/BinaryDirectoryInInterface-build/foo"
which is prefixed in the build directory.
diff --git a/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-stderr_SOURCES.txt b/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-stderr_SOURCES.txt
new file mode 100644
index 0000000..e931a01
--- /dev/null
+++ b/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-stderr_SOURCES.txt
@@ -0,0 +1,6 @@
+CMake Error in CMakeLists.txt:
+ Target "testTarget" INTERFACE_SOURCES property contains path:
+
+ ".*Tests/RunCMake/IfacePaths_SOURCES/BinaryDirectoryInInterface-build/empty.cpp"
+
+ which is prefixed in the build directory.
diff --git a/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface.cmake b/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface.cmake
new file mode 100644
index 0000000..7001f3f
--- /dev/null
+++ b/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface.cmake
@@ -0,0 +1,15 @@
+
+enable_language(CXX)
+
+add_library(testTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp")
+if (TEST_PROP STREQUAL INCLUDE_DIRECTORIES)
+ set_property(TARGET testTarget PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/foo")
+else()
+ set_property(TARGET testTarget PROPERTY INTERFACE_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/empty.cpp")
+endif()
+
+install(TARGETS testTarget EXPORT testTargets
+ DESTINATION lib
+)
+
+install(EXPORT testTargets DESTINATION lib/cmake)
diff --git a/Tests/RunCMake/IfacePaths/CMakeLists.txt b/Tests/RunCMake/IfacePaths/CMakeLists.txt
new file mode 100644
index 0000000..5cd4825
--- /dev/null
+++ b/Tests/RunCMake/IfacePaths/CMakeLists.txt
@@ -0,0 +1,6 @@
+cmake_minimum_required(VERSION 3.0)
+project(${RunCMake_TEST} NONE)
+if(NOT TEST_FILE)
+ set(TEST_FILE ${RunCMake_TEST}.cmake)
+endif()
+include(${TEST_FILE})
diff --git a/Tests/RunCMake/include_directories/DirInInstallPrefix-result.txt b/Tests/RunCMake/IfacePaths/DirInInstallPrefix-result.txt
index 573541a..573541a 100644
--- a/Tests/RunCMake/include_directories/DirInInstallPrefix-result.txt
+++ b/Tests/RunCMake/IfacePaths/DirInInstallPrefix-result.txt
diff --git a/Tests/RunCMake/IfacePaths/DirInInstallPrefix.cmake b/Tests/RunCMake/IfacePaths/DirInInstallPrefix.cmake
new file mode 100644
index 0000000..f5f3005
--- /dev/null
+++ b/Tests/RunCMake/IfacePaths/DirInInstallPrefix.cmake
@@ -0,0 +1,14 @@
+enable_language(CXX)
+add_library(testTarget empty.cpp)
+
+if (TEST_PROP STREQUAL INCLUDE_DIRECTORIES)
+ set_property(TARGET testTarget PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/dir")
+else()
+ set_property(TARGET testTarget PROPERTY INTERFACE_SOURCES "${CMAKE_INSTALL_PREFIX}/empty.cpp")
+endif()
+
+install(TARGETS testTarget EXPORT testTargets
+ DESTINATION lib
+)
+
+install(EXPORT testTargets DESTINATION lib/cmake)
diff --git a/Tests/RunCMake/include_directories/InstallInBinDir-result.txt b/Tests/RunCMake/IfacePaths/InstallInBinDir-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/include_directories/InstallInBinDir-result.txt
+++ b/Tests/RunCMake/IfacePaths/InstallInBinDir-result.txt
diff --git a/Tests/RunCMake/include_directories/BinaryDirectoryInInterface-stderr.txt b/Tests/RunCMake/IfacePaths/InstallInBinDir-stderr_INCLUDE_DIRECTORIES.txt
index 0d4379e..3d60831 100644
--- a/Tests/RunCMake/include_directories/BinaryDirectoryInInterface-stderr.txt
+++ b/Tests/RunCMake/IfacePaths/InstallInBinDir-stderr_INCLUDE_DIRECTORIES.txt
@@ -1,6 +1,6 @@
CMake Error in CMakeLists.txt:
Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path:
- ".*RunCMake/include_directories/BinaryDirectoryInInterface-build/foo"
+ ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/InstallInBinDir-build/foo"
which is prefixed in the build directory.
diff --git a/Tests/RunCMake/IfacePaths/InstallInBinDir-stderr_SOURCES.txt b/Tests/RunCMake/IfacePaths/InstallInBinDir-stderr_SOURCES.txt
new file mode 100644
index 0000000..c79d598
--- /dev/null
+++ b/Tests/RunCMake/IfacePaths/InstallInBinDir-stderr_SOURCES.txt
@@ -0,0 +1,6 @@
+CMake Error in CMakeLists.txt:
+ Target "testTarget" INTERFACE_SOURCES property contains path:
+
+ ".*Tests/RunCMake/IfacePaths_SOURCES/InstallInBinDir-build/empty.cpp"
+
+ which is prefixed in the build directory.
diff --git a/Tests/RunCMake/include_directories/InstallInSrcDir-result.txt b/Tests/RunCMake/IfacePaths/InstallInSrcDir-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/include_directories/InstallInSrcDir-result.txt
+++ b/Tests/RunCMake/IfacePaths/InstallInSrcDir-result.txt
diff --git a/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-NEW-stderr.txt b/Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr_INCLUDE_DIRECTORIES.txt
index afa43e0..11994dd 100644
--- a/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-NEW-stderr.txt
+++ b/Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr_INCLUDE_DIRECTORIES.txt
@@ -1,6 +1,6 @@
CMake Error in CMakeLists.txt:
Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path:
- ".*Tests/RunCMake/include_directories/prefix/src/foo"
+ ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/copy/foo"
which is prefixed in the source directory.
diff --git a/Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr_SOURCES.txt b/Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr_SOURCES.txt
new file mode 100644
index 0000000..e71921e
--- /dev/null
+++ b/Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr_SOURCES.txt
@@ -0,0 +1,6 @@
+CMake Error in CMakeLists.txt:
+ Target "testTarget" INTERFACE_SOURCES property contains path:
+
+ ".*Tests/RunCMake/IfacePaths_SOURCES/copy/empty.cpp"
+
+ which is prefixed in the source directory.
diff --git a/Tests/RunCMake/include_directories/InstallPrefixInInterface-result.txt b/Tests/RunCMake/IfacePaths/InstallPrefixInInterface-result.txt
index 573541a..573541a 100644
--- a/Tests/RunCMake/include_directories/InstallPrefixInInterface-result.txt
+++ b/Tests/RunCMake/IfacePaths/InstallPrefixInInterface-result.txt
diff --git a/Tests/RunCMake/include_directories/InstallPrefixInInterface.cmake b/Tests/RunCMake/IfacePaths/InstallPrefixInInterface.cmake
index 8d777f5..8d777f5 100644
--- a/Tests/RunCMake/include_directories/InstallPrefixInInterface.cmake
+++ b/Tests/RunCMake/IfacePaths/InstallPrefixInInterface.cmake
diff --git a/Tests/RunCMake/include_directories/InstallToPrefixInSrcDirInSource-result.txt b/Tests/RunCMake/IfacePaths/InstallToPrefixInSrcDirInSource-result.txt
index 573541a..573541a 100644
--- a/Tests/RunCMake/include_directories/InstallToPrefixInSrcDirInSource-result.txt
+++ b/Tests/RunCMake/IfacePaths/InstallToPrefixInSrcDirInSource-result.txt
diff --git a/Tests/RunCMake/include_directories/InstallToPrefixInSrcDirOutOfSource-result.txt b/Tests/RunCMake/IfacePaths/InstallToPrefixInSrcDirOutOfSource-result.txt
index 573541a..573541a 100644
--- a/Tests/RunCMake/include_directories/InstallToPrefixInSrcDirOutOfSource-result.txt
+++ b/Tests/RunCMake/IfacePaths/InstallToPrefixInSrcDirOutOfSource-result.txt
diff --git a/Tests/RunCMake/include_directories/RelativePathInGenex-result.txt b/Tests/RunCMake/IfacePaths/RelativePathInGenex-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/include_directories/RelativePathInGenex-result.txt
+++ b/Tests/RunCMake/IfacePaths/RelativePathInGenex-result.txt
diff --git a/Tests/RunCMake/include_directories/RelativePathInGenex-stderr.txt b/Tests/RunCMake/IfacePaths/RelativePathInGenex-stderr_INCLUDE_DIRECTORIES.txt
index 490c700..490c700 100644
--- a/Tests/RunCMake/include_directories/RelativePathInGenex-stderr.txt
+++ b/Tests/RunCMake/IfacePaths/RelativePathInGenex-stderr_INCLUDE_DIRECTORIES.txt
diff --git a/Tests/RunCMake/IfacePaths/RelativePathInGenex-stderr_SOURCES.txt b/Tests/RunCMake/IfacePaths/RelativePathInGenex-stderr_SOURCES.txt
new file mode 100644
index 0000000..2311af9
--- /dev/null
+++ b/Tests/RunCMake/IfacePaths/RelativePathInGenex-stderr_SOURCES.txt
@@ -0,0 +1,4 @@
+CMake Error in CMakeLists.txt:
+ Target "testTarget" contains relative path in its INTERFACE_SOURCES:
+
+ "empty.cpp"
diff --git a/Tests/RunCMake/IfacePaths/RelativePathInGenex.cmake b/Tests/RunCMake/IfacePaths/RelativePathInGenex.cmake
new file mode 100644
index 0000000..489c3a1
--- /dev/null
+++ b/Tests/RunCMake/IfacePaths/RelativePathInGenex.cmake
@@ -0,0 +1,13 @@
+
+enable_language(CXX)
+
+add_library(testTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp")
+
+if (TEST_PROP STREQUAL INCLUDE_DIRECTORIES)
+ set_property(TARGET testTarget PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<1:foo>")
+else()
+ set_property(TARGET testTarget PROPERTY INTERFACE_SOURCES "$<1:empty.cpp>")
+endif()
+
+add_library(userTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp")
+target_link_libraries(userTarget testTarget)
diff --git a/Tests/RunCMake/include_directories/RelativePathInInterface-result.txt b/Tests/RunCMake/IfacePaths/RelativePathInInterface-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/include_directories/RelativePathInInterface-result.txt
+++ b/Tests/RunCMake/IfacePaths/RelativePathInInterface-result.txt
diff --git a/Tests/RunCMake/include_directories/RelativePathInInterface-stderr.txt b/Tests/RunCMake/IfacePaths/RelativePathInInterface-stderr_INCLUDE_DIRECTORIES.txt
index f6cdb53..f6cdb53 100644
--- a/Tests/RunCMake/include_directories/RelativePathInInterface-stderr.txt
+++ b/Tests/RunCMake/IfacePaths/RelativePathInInterface-stderr_INCLUDE_DIRECTORIES.txt
diff --git a/Tests/RunCMake/IfacePaths/RelativePathInInterface-stderr_SOURCES.txt b/Tests/RunCMake/IfacePaths/RelativePathInInterface-stderr_SOURCES.txt
new file mode 100644
index 0000000..f0f002c
--- /dev/null
+++ b/Tests/RunCMake/IfacePaths/RelativePathInInterface-stderr_SOURCES.txt
@@ -0,0 +1,4 @@
+CMake Error in CMakeLists.txt:
+ Target "testTarget" INTERFACE_SOURCES property contains relative path:
+
+ "empty.cpp"
diff --git a/Tests/RunCMake/IfacePaths/RelativePathInInterface.cmake b/Tests/RunCMake/IfacePaths/RelativePathInInterface.cmake
new file mode 100644
index 0000000..e974aac
--- /dev/null
+++ b/Tests/RunCMake/IfacePaths/RelativePathInInterface.cmake
@@ -0,0 +1,14 @@
+
+enable_language(CXX)
+
+add_library(testTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp")
+if (TEST_PROP STREQUAL INCLUDE_DIRECTORIES)
+ set_property(TARGET testTarget PROPERTY INTERFACE_INCLUDE_DIRECTORIES "foo")
+else()
+ set_property(TARGET testTarget PROPERTY INTERFACE_SOURCES "empty.cpp")
+endif()
+install(TARGETS testTarget EXPORT testTargets
+ DESTINATION lib
+)
+
+install(EXPORT testTargets DESTINATION lib/cmake)
diff --git a/Tests/RunCMake/IfacePaths/RunCMakeTest.cmake b/Tests/RunCMake/IfacePaths/RunCMakeTest.cmake
new file mode 100644
index 0000000..489e3df
--- /dev/null
+++ b/Tests/RunCMake/IfacePaths/RunCMakeTest.cmake
@@ -0,0 +1,156 @@
+include(RunCMake)
+
+macro(run_cmake test)
+ list(APPEND RunCMake_TEST_OPTIONS -DTEST_PROP=${TEST_PROP})
+ set(RunCMake-stderr-file ${test}-stderr_${TEST_PROP}.txt)
+ _run_cmake(${test})
+endmacro()
+
+run_cmake(RelativePathInInterface)
+run_cmake(RelativePathInGenex)
+run_cmake(export-NOWARN)
+run_cmake(SourceDirectoryInInterface)
+run_cmake(BinaryDirectoryInInterface)
+
+set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/DirInInstallPrefix/prefix")
+run_cmake(DirInInstallPrefix)
+
+configure_file(
+ "${RunCMake_SOURCE_DIR}/CMakeLists.txt"
+ "${RunCMake_BINARY_DIR}/copy/CMakeLists.txt"
+ COPYONLY
+)
+configure_file(
+ "${RunCMake_SOURCE_DIR}/empty.cpp"
+ "${RunCMake_BINARY_DIR}/copy/empty.cpp"
+ COPYONLY
+)
+configure_file(
+ "${RunCMake_SOURCE_DIR}/SourceDirectoryInInterface.cmake"
+ "${RunCMake_BINARY_DIR}/copy/SourceDirectoryInInterface.cmake"
+ COPYONLY
+)
+set(RunCMake_TEST_OPTIONS
+ "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/copy/SourceDirectoryInInterface/prefix"
+ "-DTEST_FILE=${RunCMake_BINARY_DIR}/copy/SourceDirectoryInInterface.cmake"
+ )
+set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/copy")
+run_cmake(InstallInSrcDir)
+unset(RunCMake_TEST_SOURCE_DIR)
+
+set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/InstallInBinDir-build/prefix")
+set(RunCMake_TEST_OPTIONS
+ "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/InstallInBinDir-build/prefix"
+ "-DTEST_FILE=${RunCMake_SOURCE_DIR}/BinaryDirectoryInInterface.cmake"
+ )
+set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/InstallInBinDir-build")
+run_cmake(InstallInBinDir)
+unset(RunCMake_TEST_BINARY_DIR)
+
+configure_file(
+ "${RunCMake_SOURCE_DIR}/CMakeLists.txt"
+ "${RunCMake_BINARY_DIR}/prefix/src/CMakeLists.txt"
+ COPYONLY
+)
+configure_file(
+ "${RunCMake_SOURCE_DIR}/empty.cpp"
+ "${RunCMake_BINARY_DIR}/prefix/src/empty.cpp"
+ COPYONLY
+)
+configure_file(
+ "${RunCMake_SOURCE_DIR}/SourceDirectoryInInterface.cmake"
+ "${RunCMake_BINARY_DIR}/prefix/src/SourceDirectoryInInterface.cmake"
+ COPYONLY
+)
+
+foreach(policyStatus NEW OLD "")
+ if (TEST_PROP STREQUAL INCLUDE_DIRECTORIES)
+ if (NOT "${policyStatus}" STREQUAL "")
+ set(policyOption -DCMAKE_POLICY_DEFAULT_CMP0052=${policyStatus})
+ else()
+ unset(policyOption)
+ set(policyStatus WARN)
+ endif()
+ set(policySuffix -CMP0052-${policyStatus})
+ endif()
+ set(RunCMake_TEST_OPTIONS
+ "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/prefix" ${policyOption}
+ "-DTEST_FILE=${RunCMake_SOURCE_DIR}/BinaryDirectoryInInterface.cmake"
+ )
+ # Set the RunCMake_TEST_SOURCE_DIR here to the copy too. This is needed to run
+ # the test suite in-source properly. Otherwise the install directory would be
+ # a subdirectory or the source directory, which is allowed and tested separately
+ # below.
+ set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/prefix/src")
+ set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/prefix/BinInInstallPrefix${policySuffix}-build")
+ run_cmake(BinInInstallPrefix${policySuffix})
+ unset(RunCMake_TEST_BINARY_DIR)
+
+ set(RunCMake_TEST_OPTIONS
+ "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/prefix" ${policyOption}
+ "-DTEST_FILE=${RunCMake_BINARY_DIR}/prefix/src/SourceDirectoryInInterface.cmake"
+ )
+ run_cmake(SrcInInstallPrefix${policySuffix})
+ unset(RunCMake_TEST_SOURCE_DIR)
+
+ if (NOT TEST_PROP STREQUAL INCLUDE_DIRECTORIES)
+ break()
+ endif()
+endforeach()
+
+set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/InstallPrefixInInterface-build/prefix")
+run_cmake(InstallPrefixInInterface)
+
+configure_file(
+ "${RunCMake_SOURCE_DIR}/CMakeLists.txt"
+ "${RunCMake_BINARY_DIR}/installToSrc/CMakeLists.txt"
+ COPYONLY
+)
+configure_file(
+ "${RunCMake_SOURCE_DIR}/empty.cpp"
+ "${RunCMake_BINARY_DIR}/installToSrc/empty.cpp"
+ COPYONLY
+)
+configure_file(
+ "${RunCMake_SOURCE_DIR}/InstallPrefixInInterface.cmake"
+ "${RunCMake_BINARY_DIR}/installToSrc/InstallPrefixInInterface.cmake"
+ COPYONLY
+)
+set(RunCMake_TEST_OPTIONS
+ "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/installToSrc/InstallPrefixInInterface/prefix"
+ "-DTEST_FILE=${RunCMake_BINARY_DIR}/installToSrc/InstallPrefixInInterface.cmake"
+ )
+set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/installToSrc")
+run_cmake(InstallToPrefixInSrcDirOutOfSource)
+unset(RunCMake_TEST_SOURCE_DIR)
+
+
+file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}/installToSrcInSrc")
+set(RunCMake_TEST_NO_CLEAN ON)
+
+configure_file(
+ "${RunCMake_SOURCE_DIR}/CMakeLists.txt"
+ "${RunCMake_BINARY_DIR}/installToSrcInSrc/CMakeLists.txt"
+ COPYONLY
+)
+configure_file(
+ "${RunCMake_SOURCE_DIR}/empty.cpp"
+ "${RunCMake_BINARY_DIR}/installToSrcInSrc/empty.cpp"
+ COPYONLY
+)
+configure_file(
+ "${RunCMake_SOURCE_DIR}/InstallPrefixInInterface.cmake"
+ "${RunCMake_BINARY_DIR}/installToSrcInSrc/InstallPrefixInInterface.cmake"
+ COPYONLY
+)
+
+set(RunCMake_TEST_OPTIONS
+ "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/installToSrcInSrc/InstallPrefixInInterface/prefix"
+ "-DTEST_FILE=${RunCMake_BINARY_DIR}/installToSrcInSrc/InstallPrefixInInterface.cmake"
+ )
+set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/installToSrcInSrc")
+set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/installToSrcInSrc")
+run_cmake(InstallToPrefixInSrcDirInSource)
+unset(RunCMake_TEST_SOURCE_DIR)
+unset(RunCMake_TEST_BINARY_DIR)
+unset(RunCMake_TEST_NO_CLEAN)
diff --git a/Tests/RunCMake/include_directories/SourceDirectoryInInterface-result.txt b/Tests/RunCMake/IfacePaths/SourceDirectoryInInterface-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/include_directories/SourceDirectoryInInterface-result.txt
+++ b/Tests/RunCMake/IfacePaths/SourceDirectoryInInterface-result.txt
diff --git a/Tests/RunCMake/include_directories/SourceDirectoryInInterface-stderr.txt b/Tests/RunCMake/IfacePaths/SourceDirectoryInInterface-stderr_INCLUDE_DIRECTORIES.txt
index 9346b99..97a94b1 100644
--- a/Tests/RunCMake/include_directories/SourceDirectoryInInterface-stderr.txt
+++ b/Tests/RunCMake/IfacePaths/SourceDirectoryInInterface-stderr_INCLUDE_DIRECTORIES.txt
@@ -1,6 +1,6 @@
CMake Error in CMakeLists.txt:
Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path:
- ".*RunCMake/include_directories/foo"
+ ".*RunCMake/IfacePaths/foo"
which is prefixed in the source directory.
diff --git a/Tests/RunCMake/IfacePaths/SourceDirectoryInInterface-stderr_SOURCES.txt b/Tests/RunCMake/IfacePaths/SourceDirectoryInInterface-stderr_SOURCES.txt
new file mode 100644
index 0000000..c5157ad
--- /dev/null
+++ b/Tests/RunCMake/IfacePaths/SourceDirectoryInInterface-stderr_SOURCES.txt
@@ -0,0 +1,6 @@
+CMake Error in CMakeLists.txt:
+ Target "testTarget" INTERFACE_SOURCES property contains path:
+
+ ".*Tests/RunCMake/IfacePaths/empty.cpp"
+
+ which is prefixed in the source directory.
diff --git a/Tests/RunCMake/IfacePaths/SourceDirectoryInInterface.cmake b/Tests/RunCMake/IfacePaths/SourceDirectoryInInterface.cmake
new file mode 100644
index 0000000..d80cbec
--- /dev/null
+++ b/Tests/RunCMake/IfacePaths/SourceDirectoryInInterface.cmake
@@ -0,0 +1,15 @@
+
+enable_language(CXX)
+
+add_library(testTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp")
+if (TEST_PROP STREQUAL INCLUDE_DIRECTORIES)
+ set_property(TARGET testTarget PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/foo")
+else()
+ set_property(TARGET testTarget PROPERTY INTERFACE_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp")
+endif()
+
+install(TARGETS testTarget EXPORT testTargets
+ DESTINATION lib
+)
+
+install(EXPORT testTargets DESTINATION lib/cmake)
diff --git a/Tests/RunCMake/TargetSources/ExportInstall-result.txt b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/TargetSources/ExportInstall-result.txt
+++ b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-result.txt
diff --git a/Tests/RunCMake/include_directories/InstallInSrcDir-stderr.txt b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-stderr_INCLUDE_DIRECTORIES.txt
index 7be3044..ed5df34 100644
--- a/Tests/RunCMake/include_directories/InstallInSrcDir-stderr.txt
+++ b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-stderr_INCLUDE_DIRECTORIES.txt
@@ -1,6 +1,6 @@
CMake Error in CMakeLists.txt:
Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path:
- ".*Tests/RunCMake/include_directories/copy/foo"
+ ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix/src/foo"
which is prefixed in the source directory.
diff --git a/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-OLD-result.txt b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-OLD-result.txt
index 573541a..573541a 100644
--- a/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-OLD-result.txt
+++ b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-OLD-result.txt
diff --git a/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-WARN-result.txt b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-result.txt
index 573541a..573541a 100644
--- a/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-WARN-result.txt
+++ b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-result.txt
diff --git a/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-WARN-stderr.txt b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-stderr_INCLUDE_DIRECTORIES.txt
index 0b13fd8..cb5a51c 100644
--- a/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-WARN-stderr.txt
+++ b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-stderr_INCLUDE_DIRECTORIES.txt
@@ -6,15 +6,15 @@ CMake Warning \(dev\) in CMakeLists.txt:
Directory:
- ".*Tests/RunCMake/include_directories/prefix/src/foo"
+ ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix/src/foo"
in INTERFACE_INCLUDE_DIRECTORIES of target "testTarget" is a subdirectory
of the install directory:
- ".*Tests/RunCMake/include_directories/prefix"
+ ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix"
however it is also a subdirectory of the source tree:
- ".*Tests/RunCMake/include_directories/prefix/src"
+ ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix/src"
This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-result.txt b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-stderr_SOURCES.txt b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-stderr_SOURCES.txt
new file mode 100644
index 0000000..48f2485
--- /dev/null
+++ b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-stderr_SOURCES.txt
@@ -0,0 +1,6 @@
+CMake Error in CMakeLists.txt:
+ Target "testTarget" INTERFACE_SOURCES property contains path:
+
+ ".*Tests/RunCMake/IfacePaths_SOURCES/prefix/src/empty.cpp"
+
+ which is prefixed in the source directory.
diff --git a/Tests/RunCMake/IfacePaths/empty.cpp b/Tests/RunCMake/IfacePaths/empty.cpp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/IfacePaths/empty.cpp
diff --git a/Tests/RunCMake/include_directories/export-NOWARN-result.txt b/Tests/RunCMake/IfacePaths/export-NOWARN-result.txt
index 573541a..573541a 100644
--- a/Tests/RunCMake/include_directories/export-NOWARN-result.txt
+++ b/Tests/RunCMake/IfacePaths/export-NOWARN-result.txt
diff --git a/Tests/RunCMake/include_directories/export-NOWARN.cmake b/Tests/RunCMake/IfacePaths/export-NOWARN.cmake
index 50720a0..592572c 100644
--- a/Tests/RunCMake/include_directories/export-NOWARN.cmake
+++ b/Tests/RunCMake/IfacePaths/export-NOWARN.cmake
@@ -1,19 +1,34 @@
enable_language(CXX)
add_library(foo empty.cpp)
+
set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<0:>/include/subdir)
set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<INSTALL_PREFIX>/include/subdir)
+set_property(TARGET foo APPEND PROPERTY INTERFACE_SOURCES $<0:>/include/subdir/empty.cpp)
+set_property(TARGET foo APPEND PROPERTY INTERFACE_SOURCES $<INSTALL_PREFIX>/include/subdir/empty.cpp)
set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/subdir>)
set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<INSTALL_INTERFACE:include/subdir>)
set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<INSTALL_INTERFACE:include/$<0:>>)
set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<INSTALL_INTERFACE:$<0:>/include>)
+set_property(TARGET foo APPEND PROPERTY INTERFACE_SOURCES $<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/subdir/empty.cpp>)
+set_property(TARGET foo APPEND PROPERTY INTERFACE_SOURCES $<INSTALL_INTERFACE:include/subdir/empty.cpp>)
+set_property(TARGET foo APPEND PROPERTY INTERFACE_SOURCES $<INSTALL_INTERFACE:include/subdir/empty.cpp$<0:>>)
+set_property(TARGET foo APPEND PROPERTY INTERFACE_SOURCES $<INSTALL_INTERFACE:$<0:>/include/subdir/empty.cpp>)
# target_include_directories(foo INTERFACE include/subdir) # Does and should warn. INSTALL_INTERFACE must not list src dir paths.
target_include_directories(foo INTERFACE $<0:>/include/subdir) # Does not and should not should warn, because it starts with a genex.
target_include_directories(foo INTERFACE $<INSTALL_PREFIX>/include/subdir)
+target_sources(foo INTERFACE $<0:>/include/subdir/empty.cpp)
+target_sources(foo INTERFACE $<INSTALL_PREFIX>/include/subdir/empty.cpp)
target_include_directories(foo INTERFACE $<INSTALL_INTERFACE:include/subdir>)
target_include_directories(foo INTERFACE $<INSTALL_INTERFACE:include/$<0:>>)
+target_sources(foo INTERFACE $<INSTALL_INTERFACE:include/subdir/empty.cpp>)
+target_sources(foo INTERFACE $<INSTALL_INTERFACE:include/subdir/empty.cpp$<0:>>)
+
+install(FILES include/subdir/empty.cpp
+ DESTINATION include/subdir
+)
install(TARGETS foo EXPORT FooTargets DESTINATION lib)
install(EXPORT FooTargets DESTINATION lib/cmake)
diff --git a/Tests/RunCMake/TargetSources/ExportBuild-result.txt b/Tests/RunCMake/TargetSources/ExportBuild-result.txt
index d00491f..573541a 100644
--- a/Tests/RunCMake/TargetSources/ExportBuild-result.txt
+++ b/Tests/RunCMake/TargetSources/ExportBuild-result.txt
@@ -1 +1 @@
-1
+0
diff --git a/Tests/RunCMake/TargetSources/ExportBuild-stderr.txt b/Tests/RunCMake/TargetSources/ExportBuild-stderr.txt
deleted file mode 100644
index 0d65a55..0000000
--- a/Tests/RunCMake/TargetSources/ExportBuild-stderr.txt
+++ /dev/null
@@ -1 +0,0 @@
-CMake Error: Target "iface" has a populated INTERFACE_SOURCES property. This is not currently supported.
diff --git a/Tests/RunCMake/TargetSources/ExportInstall-stderr.txt b/Tests/RunCMake/TargetSources/ExportInstall-stderr.txt
deleted file mode 100644
index 0d65a55..0000000
--- a/Tests/RunCMake/TargetSources/ExportInstall-stderr.txt
+++ /dev/null
@@ -1 +0,0 @@
-CMake Error: Target "iface" has a populated INTERFACE_SOURCES property. This is not currently supported.
diff --git a/Tests/RunCMake/TargetSources/ExportInstall.cmake b/Tests/RunCMake/TargetSources/ExportInstall.cmake
deleted file mode 100644
index 8e7c9f9..0000000
--- a/Tests/RunCMake/TargetSources/ExportInstall.cmake
+++ /dev/null
@@ -1,6 +0,0 @@
-
-add_library(iface INTERFACE)
-target_sources(iface INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/empty_1.cpp")
-
-install(TARGETS iface EXPORT exp)
-install(EXPORT exp DESTINATION cmake)
diff --git a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
index 1b4ef0b..4416ef9 100644
--- a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
+++ b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
@@ -10,4 +10,3 @@ endif()
run_cmake(CMP0026-LOCATION)
run_cmake(RelativePathInInterface)
run_cmake(ExportBuild)
-run_cmake(ExportInstall)
diff --git a/Tests/RunCMake/include_directories/BinaryDirectoryInInterface.cmake b/Tests/RunCMake/include_directories/BinaryDirectoryInInterface.cmake
deleted file mode 100644
index 67ee7de..0000000
--- a/Tests/RunCMake/include_directories/BinaryDirectoryInInterface.cmake
+++ /dev/null
@@ -1,11 +0,0 @@
-
-enable_language(CXX)
-
-add_library(testTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp")
-target_include_directories(testTarget INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/foo")
-
-install(TARGETS testTarget EXPORT testTargets
- DESTINATION lib
-)
-
-install(EXPORT testTargets DESTINATION lib/cmake)
diff --git a/Tests/RunCMake/include_directories/CMakeLists.txt b/Tests/RunCMake/include_directories/CMakeLists.txt
index 5cd4825..2897109 100644
--- a/Tests/RunCMake/include_directories/CMakeLists.txt
+++ b/Tests/RunCMake/include_directories/CMakeLists.txt
@@ -1,6 +1,3 @@
cmake_minimum_required(VERSION 3.0)
project(${RunCMake_TEST} NONE)
-if(NOT TEST_FILE)
- set(TEST_FILE ${RunCMake_TEST}.cmake)
-endif()
-include(${TEST_FILE})
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/include_directories/DirInInstallPrefix.cmake b/Tests/RunCMake/include_directories/DirInInstallPrefix.cmake
deleted file mode 100644
index fab7717..0000000
--- a/Tests/RunCMake/include_directories/DirInInstallPrefix.cmake
+++ /dev/null
@@ -1,9 +0,0 @@
-enable_language(CXX)
-add_library(testTarget empty.cpp)
-target_include_directories(testTarget INTERFACE "${CMAKE_INSTALL_PREFIX}/dir")
-
-install(TARGETS testTarget EXPORT testTargets
- DESTINATION lib
-)
-
-install(EXPORT testTargets DESTINATION lib/cmake)
diff --git a/Tests/RunCMake/include_directories/RelativePathInGenex.cmake b/Tests/RunCMake/include_directories/RelativePathInGenex.cmake
deleted file mode 100644
index 070a381..0000000
--- a/Tests/RunCMake/include_directories/RelativePathInGenex.cmake
+++ /dev/null
@@ -1,8 +0,0 @@
-
-enable_language(CXX)
-
-add_library(testTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp")
-set_property(TARGET testTarget PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<1:foo>")
-
-add_library(userTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp")
-target_link_libraries(userTarget testTarget)
diff --git a/Tests/RunCMake/include_directories/RelativePathInInterface.cmake b/Tests/RunCMake/include_directories/RelativePathInInterface.cmake
deleted file mode 100644
index 4c4727d..0000000
--- a/Tests/RunCMake/include_directories/RelativePathInInterface.cmake
+++ /dev/null
@@ -1,11 +0,0 @@
-
-enable_language(CXX)
-
-add_library(testTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp")
-set_property(TARGET testTarget PROPERTY INTERFACE_INCLUDE_DIRECTORIES "foo")
-
-install(TARGETS testTarget EXPORT testTargets
- DESTINATION lib
-)
-
-install(EXPORT testTargets DESTINATION lib/cmake)
diff --git a/Tests/RunCMake/include_directories/RunCMakeTest.cmake b/Tests/RunCMake/include_directories/RunCMakeTest.cmake
index fa76f24..3f624f8 100644
--- a/Tests/RunCMake/include_directories/RunCMakeTest.cmake
+++ b/Tests/RunCMake/include_directories/RunCMakeTest.cmake
@@ -3,148 +3,7 @@ include(RunCMake)
run_cmake(NotFoundContent)
run_cmake(DebugIncludes)
run_cmake(TID-bad-target)
-run_cmake(SourceDirectoryInInterface)
-run_cmake(BinaryDirectoryInInterface)
-run_cmake(RelativePathInInterface)
run_cmake(ImportedTarget)
-run_cmake(RelativePathInGenex)
run_cmake(CMP0021)
run_cmake(install_config)
run_cmake(incomplete-genex)
-run_cmake(export-NOWARN)
-
-set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/DirInInstallPrefix/prefix")
-run_cmake(DirInInstallPrefix)
-
-configure_file(
- "${RunCMake_SOURCE_DIR}/CMakeLists.txt"
- "${RunCMake_BINARY_DIR}/copy/CMakeLists.txt"
- COPYONLY
-)
-configure_file(
- "${RunCMake_SOURCE_DIR}/empty.cpp"
- "${RunCMake_BINARY_DIR}/copy/empty.cpp"
- COPYONLY
-)
-configure_file(
- "${RunCMake_SOURCE_DIR}/SourceDirectoryInInterface.cmake"
- "${RunCMake_BINARY_DIR}/copy/SourceDirectoryInInterface.cmake"
- COPYONLY
-)
-set(RunCMake_TEST_OPTIONS
- "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/copy/SourceDirectoryInInterface/prefix"
- "-DTEST_FILE=${RunCMake_BINARY_DIR}/copy/SourceDirectoryInInterface.cmake"
- )
-set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/copy")
-run_cmake(InstallInSrcDir)
-unset(RunCMake_TEST_SOURCE_DIR)
-
-set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/InstallInBinDir-build/prefix")
-set(RunCMake_TEST_OPTIONS
- "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/InstallInBinDir-build/prefix"
- "-DTEST_FILE=${RunCMake_SOURCE_DIR}/BinaryDirectoryInInterface.cmake"
- )
-set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/InstallInBinDir-build")
-run_cmake(InstallInBinDir)
-unset(RunCMake_TEST_BINARY_DIR)
-
-configure_file(
- "${RunCMake_SOURCE_DIR}/CMakeLists.txt"
- "${RunCMake_BINARY_DIR}/prefix/src/CMakeLists.txt"
- COPYONLY
-)
-configure_file(
- "${RunCMake_SOURCE_DIR}/empty.cpp"
- "${RunCMake_BINARY_DIR}/prefix/src/empty.cpp"
- COPYONLY
-)
-configure_file(
- "${RunCMake_SOURCE_DIR}/SourceDirectoryInInterface.cmake"
- "${RunCMake_BINARY_DIR}/prefix/src/SourceDirectoryInInterface.cmake"
- COPYONLY
-)
-
-foreach(policyStatus "" NEW OLD)
- if (NOT "${policyStatus}" STREQUAL "")
- set(policyOption -DCMAKE_POLICY_DEFAULT_CMP0052=${policyStatus})
- else()
- unset(policyOption)
- set(policyStatus WARN)
- endif()
- set(RunCMake_TEST_OPTIONS
- "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/prefix" ${policyOption}
- "-DTEST_FILE=${RunCMake_SOURCE_DIR}/BinaryDirectoryInInterface.cmake"
- )
- # Set the RunCMake_TEST_SOURCE_DIR here to the copy too. This is needed to run
- # the test suite in-source properly. Otherwise the install directory would be
- # a subdirectory or the source directory, which is allowed and tested separately
- # below.
- set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/prefix/src")
- set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/prefix/BinInInstallPrefix-CMP0052-${policyStatus}-build")
- run_cmake(BinInInstallPrefix-CMP0052-${policyStatus})
- unset(RunCMake_TEST_BINARY_DIR)
-
- set(RunCMake_TEST_OPTIONS
- "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/prefix" ${policyOption}
- "-DTEST_FILE=${RunCMake_BINARY_DIR}/prefix/src/SourceDirectoryInInterface.cmake"
- )
- run_cmake(SrcInInstallPrefix-CMP0052-${policyStatus})
- unset(RunCMake_TEST_SOURCE_DIR)
-endforeach()
-
-set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/InstallPrefixInInterface-build/prefix")
-run_cmake(InstallPrefixInInterface)
-
-configure_file(
- "${RunCMake_SOURCE_DIR}/CMakeLists.txt"
- "${RunCMake_BINARY_DIR}/installToSrc/CMakeLists.txt"
- COPYONLY
-)
-configure_file(
- "${RunCMake_SOURCE_DIR}/empty.cpp"
- "${RunCMake_BINARY_DIR}/installToSrc/empty.cpp"
- COPYONLY
-)
-configure_file(
- "${RunCMake_SOURCE_DIR}/InstallPrefixInInterface.cmake"
- "${RunCMake_BINARY_DIR}/installToSrc/InstallPrefixInInterface.cmake"
- COPYONLY
-)
-set(RunCMake_TEST_OPTIONS
- "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/installToSrc/InstallPrefixInInterface/prefix"
- "-DTEST_FILE=${RunCMake_BINARY_DIR}/installToSrc/InstallPrefixInInterface.cmake"
- )
-set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/installToSrc")
-run_cmake(InstallToPrefixInSrcDirOutOfSource)
-unset(RunCMake_TEST_SOURCE_DIR)
-
-
-file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}/installToSrcInSrc")
-set(RunCMake_TEST_NO_CLEAN ON)
-
-configure_file(
- "${RunCMake_SOURCE_DIR}/CMakeLists.txt"
- "${RunCMake_BINARY_DIR}/installToSrcInSrc/CMakeLists.txt"
- COPYONLY
-)
-configure_file(
- "${RunCMake_SOURCE_DIR}/empty.cpp"
- "${RunCMake_BINARY_DIR}/installToSrcInSrc/empty.cpp"
- COPYONLY
-)
-configure_file(
- "${RunCMake_SOURCE_DIR}/InstallPrefixInInterface.cmake"
- "${RunCMake_BINARY_DIR}/installToSrcInSrc/InstallPrefixInInterface.cmake"
- COPYONLY
-)
-
-set(RunCMake_TEST_OPTIONS
- "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/installToSrcInSrc/InstallPrefixInInterface/prefix"
- "-DTEST_FILE=${RunCMake_BINARY_DIR}/installToSrcInSrc/InstallPrefixInInterface.cmake"
- )
-set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/installToSrcInSrc")
-set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/installToSrcInSrc")
-run_cmake(InstallToPrefixInSrcDirInSource)
-unset(RunCMake_TEST_SOURCE_DIR)
-unset(RunCMake_TEST_BINARY_DIR)
-unset(RunCMake_TEST_NO_CLEAN)
diff --git a/Tests/RunCMake/include_directories/SourceDirectoryInInterface.cmake b/Tests/RunCMake/include_directories/SourceDirectoryInInterface.cmake
deleted file mode 100644
index f814a3c..0000000
--- a/Tests/RunCMake/include_directories/SourceDirectoryInInterface.cmake
+++ /dev/null
@@ -1,11 +0,0 @@
-
-enable_language(CXX)
-
-add_library(testTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp")
-target_include_directories(testTarget INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/foo")
-
-install(TARGETS testTarget EXPORT testTargets
- DESTINATION lib
-)
-
-install(EXPORT testTargets DESTINATION lib/cmake)
diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake
index 53b91f3..7149603 100644
--- a/Tests/RunCMake/install/RunCMakeTest.cmake
+++ b/Tests/RunCMake/install/RunCMakeTest.cmake
@@ -6,3 +6,4 @@ run_cmake(DIRECTORY-message-lazy)
run_cmake(SkipInstallRulesWarning)
run_cmake(SkipInstallRulesNoWarning1)
run_cmake(SkipInstallRulesNoWarning2)
+run_cmake(TARGETS-DESTINATION-bad)
diff --git a/Tests/RunCMake/install/TARGETS-DESTINATION-bad-result.txt b/Tests/RunCMake/install/TARGETS-DESTINATION-bad-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/install/TARGETS-DESTINATION-bad-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/install/TARGETS-DESTINATION-bad-stderr.txt b/Tests/RunCMake/install/TARGETS-DESTINATION-bad-stderr.txt
new file mode 100644
index 0000000..9844158
--- /dev/null
+++ b/Tests/RunCMake/install/TARGETS-DESTINATION-bad-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<NOTAGENEX>
+
+ Expression did not evaluate to a known generator expression
diff --git a/Tests/RunCMake/install/TARGETS-DESTINATION-bad.cmake b/Tests/RunCMake/install/TARGETS-DESTINATION-bad.cmake
new file mode 100644
index 0000000..feff52df
--- /dev/null
+++ b/Tests/RunCMake/install/TARGETS-DESTINATION-bad.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+add_library(empty empty.c)
+install(TARGETS empty DESTINATION $<NOTAGENEX>)
diff --git a/Tests/RunCMake/install/empty.c b/Tests/RunCMake/install/empty.c
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/install/empty.c