From cc1520947608f5224a4fdfa94b5cb07e19e23600 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 30 Nov 2014 13:20:32 +0100 Subject: Tests: Split part of include_directories test to a generic location. The moved tests are related to paths in INTERFACE_INCLUDE_DIRECTORIES in general, and when exporting, and covering cases of the install location being within the build or source prefix etc. Other build properties containing paths should have similar tests, so this allows some parameterization while keeping the preparation of the various directory structures. --- Tests/RunCMake/CMakeLists.txt | 1 + .../BinInInstallPrefix-CMP0052-NEW-result.txt | 1 + .../BinInInstallPrefix-CMP0052-NEW-stderr.txt | 6 + .../BinInInstallPrefix-CMP0052-OLD-result.txt | 1 + .../BinInInstallPrefix-CMP0052-WARN-result.txt | 1 + .../BinInInstallPrefix-CMP0052-WARN-stderr.txt | 20 +++ .../BinaryDirectoryInInterface-result.txt | 1 + .../BinaryDirectoryInInterface-stderr.txt | 6 + .../IfacePaths/BinaryDirectoryInInterface.cmake | 11 ++ Tests/RunCMake/IfacePaths/CMakeLists.txt | 6 + .../IfacePaths/DirInInstallPrefix-result.txt | 1 + Tests/RunCMake/IfacePaths/DirInInstallPrefix.cmake | 9 ++ .../RunCMake/IfacePaths/InstallInBinDir-result.txt | 1 + .../RunCMake/IfacePaths/InstallInBinDir-stderr.txt | 6 + .../RunCMake/IfacePaths/InstallInSrcDir-result.txt | 1 + .../RunCMake/IfacePaths/InstallInSrcDir-stderr.txt | 6 + .../IfacePaths/InstallPrefixInInterface-result.txt | 1 + .../IfacePaths/InstallPrefixInInterface.cmake | 11 ++ .../InstallToPrefixInSrcDirInSource-result.txt | 1 + .../InstallToPrefixInSrcDirOutOfSource-result.txt | 1 + .../IfacePaths/RelativePathInGenex-result.txt | 1 + .../IfacePaths/RelativePathInGenex-stderr.txt | 5 + .../RunCMake/IfacePaths/RelativePathInGenex.cmake | 8 ++ .../IfacePaths/RelativePathInInterface-result.txt | 1 + .../IfacePaths/RelativePathInInterface-stderr.txt | 5 + .../IfacePaths/RelativePathInInterface.cmake | 11 ++ Tests/RunCMake/IfacePaths/RunCMakeTest.cmake | 143 +++++++++++++++++++++ .../SourceDirectoryInInterface-result.txt | 1 + .../SourceDirectoryInInterface-stderr.txt | 6 + .../IfacePaths/SourceDirectoryInInterface.cmake | 11 ++ .../SrcInInstallPrefix-CMP0052-NEW-result.txt | 1 + .../SrcInInstallPrefix-CMP0052-NEW-stderr.txt | 6 + .../SrcInInstallPrefix-CMP0052-OLD-result.txt | 1 + .../SrcInInstallPrefix-CMP0052-WARN-result.txt | 1 + .../SrcInInstallPrefix-CMP0052-WARN-stderr.txt | 20 +++ Tests/RunCMake/IfacePaths/empty.cpp | 0 Tests/RunCMake/IfacePaths/export-NOWARN-result.txt | 1 + Tests/RunCMake/IfacePaths/export-NOWARN.cmake | 62 +++++++++ .../BinInInstallPrefix-CMP0052-NEW-result.txt | 1 - .../BinInInstallPrefix-CMP0052-NEW-stderr.txt | 6 - .../BinInInstallPrefix-CMP0052-OLD-result.txt | 1 - .../BinInInstallPrefix-CMP0052-WARN-result.txt | 1 - .../BinInInstallPrefix-CMP0052-WARN-stderr.txt | 20 --- .../BinaryDirectoryInInterface-result.txt | 1 - .../BinaryDirectoryInInterface-stderr.txt | 6 - .../BinaryDirectoryInInterface.cmake | 11 -- Tests/RunCMake/include_directories/CMakeLists.txt | 5 +- .../DirInInstallPrefix-result.txt | 1 - .../include_directories/DirInInstallPrefix.cmake | 9 -- .../include_directories/InstallInBinDir-result.txt | 1 - .../include_directories/InstallInBinDir-stderr.txt | 6 - .../include_directories/InstallInSrcDir-result.txt | 1 - .../include_directories/InstallInSrcDir-stderr.txt | 6 - .../InstallPrefixInInterface-result.txt | 1 - .../InstallPrefixInInterface.cmake | 11 -- .../InstallToPrefixInSrcDirInSource-result.txt | 1 - .../InstallToPrefixInSrcDirOutOfSource-result.txt | 1 - .../RelativePathInGenex-result.txt | 1 - .../RelativePathInGenex-stderr.txt | 5 - .../include_directories/RelativePathInGenex.cmake | 8 -- .../RelativePathInInterface-result.txt | 1 - .../RelativePathInInterface-stderr.txt | 5 - .../RelativePathInInterface.cmake | 11 -- .../include_directories/RunCMakeTest.cmake | 141 -------------------- .../SourceDirectoryInInterface-result.txt | 1 - .../SourceDirectoryInInterface-stderr.txt | 6 - .../SourceDirectoryInInterface.cmake | 11 -- .../SrcInInstallPrefix-CMP0052-NEW-result.txt | 1 - .../SrcInInstallPrefix-CMP0052-NEW-stderr.txt | 6 - .../SrcInInstallPrefix-CMP0052-OLD-result.txt | 1 - .../SrcInInstallPrefix-CMP0052-WARN-result.txt | 1 - .../SrcInInstallPrefix-CMP0052-WARN-stderr.txt | 20 --- .../include_directories/export-NOWARN-result.txt | 1 - .../include_directories/export-NOWARN.cmake | 62 --------- 74 files changed, 377 insertions(+), 371 deletions(-) create mode 100644 Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-result.txt create mode 100644 Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-stderr.txt create mode 100644 Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-OLD-result.txt create mode 100644 Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-result.txt create mode 100644 Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-stderr.txt create mode 100644 Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-result.txt create mode 100644 Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-stderr.txt create mode 100644 Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface.cmake create mode 100644 Tests/RunCMake/IfacePaths/CMakeLists.txt create mode 100644 Tests/RunCMake/IfacePaths/DirInInstallPrefix-result.txt create mode 100644 Tests/RunCMake/IfacePaths/DirInInstallPrefix.cmake create mode 100644 Tests/RunCMake/IfacePaths/InstallInBinDir-result.txt create mode 100644 Tests/RunCMake/IfacePaths/InstallInBinDir-stderr.txt create mode 100644 Tests/RunCMake/IfacePaths/InstallInSrcDir-result.txt create mode 100644 Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr.txt create mode 100644 Tests/RunCMake/IfacePaths/InstallPrefixInInterface-result.txt create mode 100644 Tests/RunCMake/IfacePaths/InstallPrefixInInterface.cmake create mode 100644 Tests/RunCMake/IfacePaths/InstallToPrefixInSrcDirInSource-result.txt create mode 100644 Tests/RunCMake/IfacePaths/InstallToPrefixInSrcDirOutOfSource-result.txt create mode 100644 Tests/RunCMake/IfacePaths/RelativePathInGenex-result.txt create mode 100644 Tests/RunCMake/IfacePaths/RelativePathInGenex-stderr.txt create mode 100644 Tests/RunCMake/IfacePaths/RelativePathInGenex.cmake create mode 100644 Tests/RunCMake/IfacePaths/RelativePathInInterface-result.txt create mode 100644 Tests/RunCMake/IfacePaths/RelativePathInInterface-stderr.txt create mode 100644 Tests/RunCMake/IfacePaths/RelativePathInInterface.cmake create mode 100644 Tests/RunCMake/IfacePaths/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/IfacePaths/SourceDirectoryInInterface-result.txt create mode 100644 Tests/RunCMake/IfacePaths/SourceDirectoryInInterface-stderr.txt create mode 100644 Tests/RunCMake/IfacePaths/SourceDirectoryInInterface.cmake create mode 100644 Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-result.txt create mode 100644 Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-stderr.txt create mode 100644 Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-OLD-result.txt create mode 100644 Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-result.txt create mode 100644 Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-stderr.txt create mode 100644 Tests/RunCMake/IfacePaths/empty.cpp create mode 100644 Tests/RunCMake/IfacePaths/export-NOWARN-result.txt create mode 100644 Tests/RunCMake/IfacePaths/export-NOWARN.cmake delete mode 100644 Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-NEW-result.txt delete mode 100644 Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-NEW-stderr.txt delete mode 100644 Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-OLD-result.txt delete mode 100644 Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-WARN-result.txt delete mode 100644 Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-WARN-stderr.txt delete mode 100644 Tests/RunCMake/include_directories/BinaryDirectoryInInterface-result.txt delete mode 100644 Tests/RunCMake/include_directories/BinaryDirectoryInInterface-stderr.txt delete mode 100644 Tests/RunCMake/include_directories/BinaryDirectoryInInterface.cmake delete mode 100644 Tests/RunCMake/include_directories/DirInInstallPrefix-result.txt delete mode 100644 Tests/RunCMake/include_directories/DirInInstallPrefix.cmake delete mode 100644 Tests/RunCMake/include_directories/InstallInBinDir-result.txt delete mode 100644 Tests/RunCMake/include_directories/InstallInBinDir-stderr.txt delete mode 100644 Tests/RunCMake/include_directories/InstallInSrcDir-result.txt delete mode 100644 Tests/RunCMake/include_directories/InstallInSrcDir-stderr.txt delete mode 100644 Tests/RunCMake/include_directories/InstallPrefixInInterface-result.txt delete mode 100644 Tests/RunCMake/include_directories/InstallPrefixInInterface.cmake delete mode 100644 Tests/RunCMake/include_directories/InstallToPrefixInSrcDirInSource-result.txt delete mode 100644 Tests/RunCMake/include_directories/InstallToPrefixInSrcDirOutOfSource-result.txt delete mode 100644 Tests/RunCMake/include_directories/RelativePathInGenex-result.txt delete mode 100644 Tests/RunCMake/include_directories/RelativePathInGenex-stderr.txt delete mode 100644 Tests/RunCMake/include_directories/RelativePathInGenex.cmake delete mode 100644 Tests/RunCMake/include_directories/RelativePathInInterface-result.txt delete mode 100644 Tests/RunCMake/include_directories/RelativePathInInterface-stderr.txt delete mode 100644 Tests/RunCMake/include_directories/RelativePathInInterface.cmake delete mode 100644 Tests/RunCMake/include_directories/SourceDirectoryInInterface-result.txt delete mode 100644 Tests/RunCMake/include_directories/SourceDirectoryInInterface-stderr.txt delete mode 100644 Tests/RunCMake/include_directories/SourceDirectoryInInterface.cmake delete mode 100644 Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-NEW-result.txt delete mode 100644 Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-NEW-stderr.txt delete mode 100644 Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-OLD-result.txt delete mode 100644 Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-WARN-result.txt delete mode 100644 Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-WARN-stderr.txt delete mode 100644 Tests/RunCMake/include_directories/export-NOWARN-result.txt delete mode 100644 Tests/RunCMake/include_directories/export-NOWARN.cmake diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 2973fe9..3645735 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -188,6 +188,7 @@ add_RunCMake_test(CommandLine) add_RunCMake_test(install) add_RunCMake_test(CPackInstallProperties) add_RunCMake_test(ExternalProject) +add_RunCMake_test(IfacePaths) if(RPMBUILD) add_RunCMake_test(CPackRPM) diff --git a/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-result.txt b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-stderr.txt b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-stderr.txt new file mode 100644 index 0000000..09d225f --- /dev/null +++ b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-stderr.txt @@ -0,0 +1,6 @@ +CMake Error in CMakeLists.txt: + Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: + + ".*Tests/RunCMake/IfacePaths/prefix/BinInInstallPrefix-CMP0052-NEW-build/foo" + + which is prefixed in the build directory. diff --git a/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-OLD-result.txt b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-OLD-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-OLD-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-result.txt b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-stderr.txt b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-stderr.txt new file mode 100644 index 0000000..6c3a122 --- /dev/null +++ b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-stderr.txt @@ -0,0 +1,20 @@ +CMake Warning \(dev\) in CMakeLists.txt: + Policy CMP0052 is not set: Reject source and build dirs in installed + INTERFACE_INCLUDE_DIRECTORIES. Run "cmake --help-policy CMP0052" for + policy details. Use the cmake_policy command to set the policy and + suppress this warning. + + Directory: + + ".*Tests/RunCMake/IfacePaths/prefix/BinInInstallPrefix-CMP0052-WARN-build/foo" + + in INTERFACE_INCLUDE_DIRECTORIES of target "testTarget" is a subdirectory + of the install directory: + + ".*Tests/RunCMake/IfacePaths/prefix" + + however it is also a subdirectory of the build tree: + + ".*Tests/RunCMake/IfacePaths/prefix/BinInInstallPrefix-CMP0052-WARN-build" + +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-result.txt b/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-stderr.txt b/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-stderr.txt new file mode 100644 index 0000000..cb2cba4 --- /dev/null +++ b/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-stderr.txt @@ -0,0 +1,6 @@ +CMake Error in CMakeLists.txt: + Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: + + ".*RunCMake/IfacePaths/BinaryDirectoryInInterface-build/foo" + + 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..67ee7de --- /dev/null +++ b/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface.cmake @@ -0,0 +1,11 @@ + +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/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/IfacePaths/DirInInstallPrefix-result.txt b/Tests/RunCMake/IfacePaths/DirInInstallPrefix-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/IfacePaths/DirInInstallPrefix-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/IfacePaths/DirInInstallPrefix.cmake b/Tests/RunCMake/IfacePaths/DirInInstallPrefix.cmake new file mode 100644 index 0000000..fab7717 --- /dev/null +++ b/Tests/RunCMake/IfacePaths/DirInInstallPrefix.cmake @@ -0,0 +1,9 @@ +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/IfacePaths/InstallInBinDir-result.txt b/Tests/RunCMake/IfacePaths/InstallInBinDir-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/IfacePaths/InstallInBinDir-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/IfacePaths/InstallInBinDir-stderr.txt b/Tests/RunCMake/IfacePaths/InstallInBinDir-stderr.txt new file mode 100644 index 0000000..c71b375 --- /dev/null +++ b/Tests/RunCMake/IfacePaths/InstallInBinDir-stderr.txt @@ -0,0 +1,6 @@ +CMake Error in CMakeLists.txt: + Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: + + ".*Tests/RunCMake/IfacePaths/InstallInBinDir-build/foo" + + which is prefixed in the build directory. diff --git a/Tests/RunCMake/IfacePaths/InstallInSrcDir-result.txt b/Tests/RunCMake/IfacePaths/InstallInSrcDir-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/IfacePaths/InstallInSrcDir-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr.txt b/Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr.txt new file mode 100644 index 0000000..526ef61 --- /dev/null +++ b/Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr.txt @@ -0,0 +1,6 @@ +CMake Error in CMakeLists.txt: + Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: + + ".*Tests/RunCMake/IfacePaths/copy/foo" + + which is prefixed in the source directory. diff --git a/Tests/RunCMake/IfacePaths/InstallPrefixInInterface-result.txt b/Tests/RunCMake/IfacePaths/InstallPrefixInInterface-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/IfacePaths/InstallPrefixInInterface-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/IfacePaths/InstallPrefixInInterface.cmake b/Tests/RunCMake/IfacePaths/InstallPrefixInInterface.cmake new file mode 100644 index 0000000..8d777f5 --- /dev/null +++ b/Tests/RunCMake/IfacePaths/InstallPrefixInInterface.cmake @@ -0,0 +1,11 @@ + +enable_language(CXX) + +add_library(testTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp") +target_include_directories(testTarget INTERFACE "${CMAKE_INSTALL_PREFIX}/foo") + +install(TARGETS testTarget EXPORT testTargets + DESTINATION lib +) + +install(EXPORT testTargets DESTINATION lib/cmake) diff --git a/Tests/RunCMake/IfacePaths/InstallToPrefixInSrcDirInSource-result.txt b/Tests/RunCMake/IfacePaths/InstallToPrefixInSrcDirInSource-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/IfacePaths/InstallToPrefixInSrcDirInSource-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/IfacePaths/InstallToPrefixInSrcDirOutOfSource-result.txt b/Tests/RunCMake/IfacePaths/InstallToPrefixInSrcDirOutOfSource-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/IfacePaths/InstallToPrefixInSrcDirOutOfSource-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/IfacePaths/RelativePathInGenex-result.txt b/Tests/RunCMake/IfacePaths/RelativePathInGenex-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/IfacePaths/RelativePathInGenex-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/IfacePaths/RelativePathInGenex-stderr.txt b/Tests/RunCMake/IfacePaths/RelativePathInGenex-stderr.txt new file mode 100644 index 0000000..490c700 --- /dev/null +++ b/Tests/RunCMake/IfacePaths/RelativePathInGenex-stderr.txt @@ -0,0 +1,5 @@ +CMake Error in CMakeLists.txt: + Target "testTarget" contains relative path in its + INTERFACE_INCLUDE_DIRECTORIES: + + "foo" diff --git a/Tests/RunCMake/IfacePaths/RelativePathInGenex.cmake b/Tests/RunCMake/IfacePaths/RelativePathInGenex.cmake new file mode 100644 index 0000000..070a381 --- /dev/null +++ b/Tests/RunCMake/IfacePaths/RelativePathInGenex.cmake @@ -0,0 +1,8 @@ + +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/IfacePaths/RelativePathInInterface-result.txt b/Tests/RunCMake/IfacePaths/RelativePathInInterface-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/IfacePaths/RelativePathInInterface-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/IfacePaths/RelativePathInInterface-stderr.txt b/Tests/RunCMake/IfacePaths/RelativePathInInterface-stderr.txt new file mode 100644 index 0000000..f6cdb53 --- /dev/null +++ b/Tests/RunCMake/IfacePaths/RelativePathInInterface-stderr.txt @@ -0,0 +1,5 @@ +CMake Error in CMakeLists.txt: + Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains + relative path: + + "foo" diff --git a/Tests/RunCMake/IfacePaths/RelativePathInInterface.cmake b/Tests/RunCMake/IfacePaths/RelativePathInInterface.cmake new file mode 100644 index 0000000..4c4727d --- /dev/null +++ b/Tests/RunCMake/IfacePaths/RelativePathInInterface.cmake @@ -0,0 +1,11 @@ + +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/IfacePaths/RunCMakeTest.cmake b/Tests/RunCMake/IfacePaths/RunCMakeTest.cmake new file mode 100644 index 0000000..4c9a703 --- /dev/null +++ b/Tests/RunCMake/IfacePaths/RunCMakeTest.cmake @@ -0,0 +1,143 @@ +include(RunCMake) + +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 (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/IfacePaths/SourceDirectoryInInterface-result.txt b/Tests/RunCMake/IfacePaths/SourceDirectoryInInterface-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/IfacePaths/SourceDirectoryInInterface-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/IfacePaths/SourceDirectoryInInterface-stderr.txt b/Tests/RunCMake/IfacePaths/SourceDirectoryInInterface-stderr.txt new file mode 100644 index 0000000..97a94b1 --- /dev/null +++ b/Tests/RunCMake/IfacePaths/SourceDirectoryInInterface-stderr.txt @@ -0,0 +1,6 @@ +CMake Error in CMakeLists.txt: + Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: + + ".*RunCMake/IfacePaths/foo" + + 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..f814a3c --- /dev/null +++ b/Tests/RunCMake/IfacePaths/SourceDirectoryInInterface.cmake @@ -0,0 +1,11 @@ + +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/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-result.txt b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-stderr.txt b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-stderr.txt new file mode 100644 index 0000000..ab95537 --- /dev/null +++ b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-stderr.txt @@ -0,0 +1,6 @@ +CMake Error in CMakeLists.txt: + Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: + + ".*Tests/RunCMake/IfacePaths/prefix/src/foo" + + which is prefixed in the source directory. diff --git a/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-OLD-result.txt b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-OLD-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-OLD-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-result.txt b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-stderr.txt b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-stderr.txt new file mode 100644 index 0000000..23683e8 --- /dev/null +++ b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-stderr.txt @@ -0,0 +1,20 @@ +CMake Warning \(dev\) in CMakeLists.txt: + Policy CMP0052 is not set: Reject source and build dirs in installed + INTERFACE_INCLUDE_DIRECTORIES. Run "cmake --help-policy CMP0052" for + policy details. Use the cmake_policy command to set the policy and + suppress this warning. + + Directory: + + ".*Tests/RunCMake/IfacePaths/prefix/src/foo" + + in INTERFACE_INCLUDE_DIRECTORIES of target "testTarget" is a subdirectory + of the install directory: + + ".*Tests/RunCMake/IfacePaths/prefix" + + however it is also a subdirectory of the source tree: + + ".*Tests/RunCMake/IfacePaths/prefix/src" + +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/IfacePaths/empty.cpp b/Tests/RunCMake/IfacePaths/empty.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Tests/RunCMake/IfacePaths/export-NOWARN-result.txt b/Tests/RunCMake/IfacePaths/export-NOWARN-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/IfacePaths/export-NOWARN-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/IfacePaths/export-NOWARN.cmake b/Tests/RunCMake/IfacePaths/export-NOWARN.cmake new file mode 100644 index 0000000..50720a0 --- /dev/null +++ b/Tests/RunCMake/IfacePaths/export-NOWARN.cmake @@ -0,0 +1,62 @@ +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 $/include/subdir) + +set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $/include/subdir>) +set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $) +set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $>) +set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $/include>) + +# 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 $/include/subdir) + +target_include_directories(foo INTERFACE $) +target_include_directories(foo INTERFACE $>) + +install(TARGETS foo EXPORT FooTargets DESTINATION lib) +install(EXPORT FooTargets DESTINATION lib/cmake) + +install(TARGETS foo EXPORT FooTargets2 + DESTINATION lib + INCLUDES DESTINATION include # No warning. Implicit install prefix. +) +install(EXPORT FooTargets2 DESTINATION lib/cmake) + +install(TARGETS foo EXPORT FooTargets3 + DESTINATION lib + INCLUDES DESTINATION $include +) +install(EXPORT FooTargets3 DESTINATION lib/cmake) + +install(TARGETS foo EXPORT FooTargets4 + DESTINATION lib + INCLUDES DESTINATION $ +) +install(EXPORT FooTargets4 DESTINATION lib/cmake) + +install(TARGETS foo EXPORT FooTargets5 + DESTINATION lib + # The $<0:> is evaluated at export time, leaving 'include' behind, which should be treated as above. + INCLUDES DESTINATION $include> +) +install(EXPORT FooTargets5 DESTINATION lib/cmake) + +install(TARGETS foo EXPORT FooTargets6 + DESTINATION lib + INCLUDES DESTINATION $> +) +install(EXPORT FooTargets6 DESTINATION lib/cmake) + +install(TARGETS foo EXPORT FooTargets7 + DESTINATION lib + INCLUDES DESTINATION include$<0:> +) +install(EXPORT FooTargets7 DESTINATION lib/cmake) + +install(TARGETS foo EXPORT FooTargets8 + DESTINATION lib + INCLUDES DESTINATION $<0:>include +) +install(EXPORT FooTargets8 DESTINATION lib/cmake) diff --git a/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-NEW-result.txt b/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-NEW-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-NEW-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-NEW-stderr.txt b/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-NEW-stderr.txt deleted file mode 100644 index f0adc9f..0000000 --- a/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-NEW-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Error in CMakeLists.txt: - Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: - - ".*Tests/RunCMake/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/include_directories/BinInInstallPrefix-CMP0052-OLD-result.txt deleted file mode 100644 index 573541a..0000000 --- a/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-OLD-result.txt +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-WARN-result.txt b/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-WARN-result.txt deleted file mode 100644 index 573541a..0000000 --- a/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-WARN-result.txt +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-WARN-stderr.txt b/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-WARN-stderr.txt deleted file mode 100644 index 054bff5..0000000 --- a/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-WARN-stderr.txt +++ /dev/null @@ -1,20 +0,0 @@ -CMake Warning \(dev\) in CMakeLists.txt: - Policy CMP0052 is not set: Reject source and build dirs in installed - INTERFACE_INCLUDE_DIRECTORIES. Run "cmake --help-policy CMP0052" for - policy details. Use the cmake_policy command to set the policy and - suppress this warning. - - Directory: - - ".*Tests/RunCMake/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" - - however it is also a subdirectory of the build tree: - - ".*Tests/RunCMake/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/BinaryDirectoryInInterface-result.txt b/Tests/RunCMake/include_directories/BinaryDirectoryInInterface-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/include_directories/BinaryDirectoryInInterface-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/include_directories/BinaryDirectoryInInterface-stderr.txt b/Tests/RunCMake/include_directories/BinaryDirectoryInInterface-stderr.txt deleted file mode 100644 index 0d4379e..0000000 --- a/Tests/RunCMake/include_directories/BinaryDirectoryInInterface-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Error in CMakeLists.txt: - Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: - - ".*RunCMake/include_directories/BinaryDirectoryInInterface-build/foo" - - which is prefixed in the build directory. 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-result.txt b/Tests/RunCMake/include_directories/DirInInstallPrefix-result.txt deleted file mode 100644 index 573541a..0000000 --- a/Tests/RunCMake/include_directories/DirInInstallPrefix-result.txt +++ /dev/null @@ -1 +0,0 @@ -0 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/InstallInBinDir-result.txt b/Tests/RunCMake/include_directories/InstallInBinDir-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/include_directories/InstallInBinDir-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/include_directories/InstallInBinDir-stderr.txt b/Tests/RunCMake/include_directories/InstallInBinDir-stderr.txt deleted file mode 100644 index 254fae1..0000000 --- a/Tests/RunCMake/include_directories/InstallInBinDir-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Error in CMakeLists.txt: - Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: - - ".*Tests/RunCMake/include_directories/InstallInBinDir-build/foo" - - which is prefixed in the build directory. diff --git a/Tests/RunCMake/include_directories/InstallInSrcDir-result.txt b/Tests/RunCMake/include_directories/InstallInSrcDir-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/include_directories/InstallInSrcDir-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/include_directories/InstallInSrcDir-stderr.txt b/Tests/RunCMake/include_directories/InstallInSrcDir-stderr.txt deleted file mode 100644 index 7be3044..0000000 --- a/Tests/RunCMake/include_directories/InstallInSrcDir-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Error in CMakeLists.txt: - Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: - - ".*Tests/RunCMake/include_directories/copy/foo" - - which is prefixed in the source directory. diff --git a/Tests/RunCMake/include_directories/InstallPrefixInInterface-result.txt b/Tests/RunCMake/include_directories/InstallPrefixInInterface-result.txt deleted file mode 100644 index 573541a..0000000 --- a/Tests/RunCMake/include_directories/InstallPrefixInInterface-result.txt +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/Tests/RunCMake/include_directories/InstallPrefixInInterface.cmake b/Tests/RunCMake/include_directories/InstallPrefixInInterface.cmake deleted file mode 100644 index 8d777f5..0000000 --- a/Tests/RunCMake/include_directories/InstallPrefixInInterface.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_INSTALL_PREFIX}/foo") - -install(TARGETS testTarget EXPORT testTargets - DESTINATION lib -) - -install(EXPORT testTargets DESTINATION lib/cmake) diff --git a/Tests/RunCMake/include_directories/InstallToPrefixInSrcDirInSource-result.txt b/Tests/RunCMake/include_directories/InstallToPrefixInSrcDirInSource-result.txt deleted file mode 100644 index 573541a..0000000 --- a/Tests/RunCMake/include_directories/InstallToPrefixInSrcDirInSource-result.txt +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/Tests/RunCMake/include_directories/InstallToPrefixInSrcDirOutOfSource-result.txt b/Tests/RunCMake/include_directories/InstallToPrefixInSrcDirOutOfSource-result.txt deleted file mode 100644 index 573541a..0000000 --- a/Tests/RunCMake/include_directories/InstallToPrefixInSrcDirOutOfSource-result.txt +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/Tests/RunCMake/include_directories/RelativePathInGenex-result.txt b/Tests/RunCMake/include_directories/RelativePathInGenex-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/include_directories/RelativePathInGenex-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/include_directories/RelativePathInGenex-stderr.txt b/Tests/RunCMake/include_directories/RelativePathInGenex-stderr.txt deleted file mode 100644 index 490c700..0000000 --- a/Tests/RunCMake/include_directories/RelativePathInGenex-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -CMake Error in CMakeLists.txt: - Target "testTarget" contains relative path in its - INTERFACE_INCLUDE_DIRECTORIES: - - "foo" 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-result.txt b/Tests/RunCMake/include_directories/RelativePathInInterface-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/include_directories/RelativePathInInterface-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/include_directories/RelativePathInInterface-stderr.txt b/Tests/RunCMake/include_directories/RelativePathInInterface-stderr.txt deleted file mode 100644 index f6cdb53..0000000 --- a/Tests/RunCMake/include_directories/RelativePathInInterface-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -CMake Error in CMakeLists.txt: - Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains - relative path: - - "foo" 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-result.txt b/Tests/RunCMake/include_directories/SourceDirectoryInInterface-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/include_directories/SourceDirectoryInInterface-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/include_directories/SourceDirectoryInInterface-stderr.txt b/Tests/RunCMake/include_directories/SourceDirectoryInInterface-stderr.txt deleted file mode 100644 index 9346b99..0000000 --- a/Tests/RunCMake/include_directories/SourceDirectoryInInterface-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Error in CMakeLists.txt: - Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: - - ".*RunCMake/include_directories/foo" - - which is prefixed in the source directory. 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/include_directories/SrcInInstallPrefix-CMP0052-NEW-result.txt b/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-NEW-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-NEW-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-NEW-stderr.txt b/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-NEW-stderr.txt deleted file mode 100644 index afa43e0..0000000 --- a/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-NEW-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Error in CMakeLists.txt: - Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: - - ".*Tests/RunCMake/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/include_directories/SrcInInstallPrefix-CMP0052-OLD-result.txt deleted file mode 100644 index 573541a..0000000 --- a/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-OLD-result.txt +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-WARN-result.txt b/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-WARN-result.txt deleted file mode 100644 index 573541a..0000000 --- a/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-WARN-result.txt +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-WARN-stderr.txt b/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-WARN-stderr.txt deleted file mode 100644 index 0b13fd8..0000000 --- a/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-WARN-stderr.txt +++ /dev/null @@ -1,20 +0,0 @@ -CMake Warning \(dev\) in CMakeLists.txt: - Policy CMP0052 is not set: Reject source and build dirs in installed - INTERFACE_INCLUDE_DIRECTORIES. Run "cmake --help-policy CMP0052" for - policy details. Use the cmake_policy command to set the policy and - suppress this warning. - - Directory: - - ".*Tests/RunCMake/include_directories/prefix/src/foo" - - in INTERFACE_INCLUDE_DIRECTORIES of target "testTarget" is a subdirectory - of the install directory: - - ".*Tests/RunCMake/include_directories/prefix" - - however it is also a subdirectory of the source tree: - - ".*Tests/RunCMake/include_directories/prefix/src" - -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/include_directories/export-NOWARN-result.txt b/Tests/RunCMake/include_directories/export-NOWARN-result.txt deleted file mode 100644 index 573541a..0000000 --- a/Tests/RunCMake/include_directories/export-NOWARN-result.txt +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/Tests/RunCMake/include_directories/export-NOWARN.cmake b/Tests/RunCMake/include_directories/export-NOWARN.cmake deleted file mode 100644 index 50720a0..0000000 --- a/Tests/RunCMake/include_directories/export-NOWARN.cmake +++ /dev/null @@ -1,62 +0,0 @@ -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 $/include/subdir) - -set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $/include/subdir>) -set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $) -set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $>) -set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $/include>) - -# 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 $/include/subdir) - -target_include_directories(foo INTERFACE $) -target_include_directories(foo INTERFACE $>) - -install(TARGETS foo EXPORT FooTargets DESTINATION lib) -install(EXPORT FooTargets DESTINATION lib/cmake) - -install(TARGETS foo EXPORT FooTargets2 - DESTINATION lib - INCLUDES DESTINATION include # No warning. Implicit install prefix. -) -install(EXPORT FooTargets2 DESTINATION lib/cmake) - -install(TARGETS foo EXPORT FooTargets3 - DESTINATION lib - INCLUDES DESTINATION $include -) -install(EXPORT FooTargets3 DESTINATION lib/cmake) - -install(TARGETS foo EXPORT FooTargets4 - DESTINATION lib - INCLUDES DESTINATION $ -) -install(EXPORT FooTargets4 DESTINATION lib/cmake) - -install(TARGETS foo EXPORT FooTargets5 - DESTINATION lib - # The $<0:> is evaluated at export time, leaving 'include' behind, which should be treated as above. - INCLUDES DESTINATION $include> -) -install(EXPORT FooTargets5 DESTINATION lib/cmake) - -install(TARGETS foo EXPORT FooTargets6 - DESTINATION lib - INCLUDES DESTINATION $> -) -install(EXPORT FooTargets6 DESTINATION lib/cmake) - -install(TARGETS foo EXPORT FooTargets7 - DESTINATION lib - INCLUDES DESTINATION include$<0:> -) -install(EXPORT FooTargets7 DESTINATION lib/cmake) - -install(TARGETS foo EXPORT FooTargets8 - DESTINATION lib - INCLUDES DESTINATION $<0:>include -) -install(EXPORT FooTargets8 DESTINATION lib/cmake) -- cgit v0.12 From d9f8390db6ab0d776eb39b840a3b096b5422229f Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 30 Nov 2014 13:42:00 +0100 Subject: Tests: Run IfacePaths tests with a parameter. Run the tests for the INCLUDE_DIRECTORIES INTERFACE property in a specific build location, and update the stderr expectation to match the new output. --- Tests/RunCMake/CMakeLists.txt | 4 ++- .../BinInInstallPrefix-CMP0052-NEW-stderr.txt | 2 +- .../BinInInstallPrefix-CMP0052-WARN-stderr.txt | 6 ++--- .../BinaryDirectoryInInterface-stderr.txt | 2 +- .../RunCMake/IfacePaths/InstallInBinDir-stderr.txt | 2 +- .../RunCMake/IfacePaths/InstallInSrcDir-stderr.txt | 2 +- Tests/RunCMake/IfacePaths/RunCMakeTest.cmake | 30 +++++++++++++++------- .../SrcInInstallPrefix-CMP0052-NEW-stderr.txt | 2 +- .../SrcInInstallPrefix-CMP0052-WARN-stderr.txt | 6 ++--- 9 files changed, 35 insertions(+), 21 deletions(-) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 3645735..71507b8 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -188,7 +188,9 @@ add_RunCMake_test(CommandLine) add_RunCMake_test(install) add_RunCMake_test(CPackInstallProperties) add_RunCMake_test(ExternalProject) -add_RunCMake_test(IfacePaths) + +set(IfacePaths_INCLUDE_DIRECTORIES_ARGS -DTEST_PROP=INCLUDE_DIRECTORIES) +add_RunCMake_test(IfacePaths_INCLUDE_DIRECTORIES TEST_DIR IfacePaths) if(RPMBUILD) add_RunCMake_test(CPackRPM) diff --git a/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-stderr.txt b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-stderr.txt index 09d225f..f2d749b 100644 --- a/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-stderr.txt +++ b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-stderr.txt @@ -1,6 +1,6 @@ CMake Error in CMakeLists.txt: Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: - ".*Tests/RunCMake/IfacePaths/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/IfacePaths/BinInInstallPrefix-CMP0052-WARN-stderr.txt b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-stderr.txt index 6c3a122..3d83892 100644 --- a/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-stderr.txt +++ b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-stderr.txt @@ -6,15 +6,15 @@ CMake Warning \(dev\) in CMakeLists.txt: Directory: - ".*Tests/RunCMake/IfacePaths/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/IfacePaths/prefix" + ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix" however it is also a subdirectory of the build tree: - ".*Tests/RunCMake/IfacePaths/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/IfacePaths/BinaryDirectoryInInterface-stderr.txt b/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-stderr.txt index cb2cba4..ed7cd58 100644 --- a/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-stderr.txt +++ b/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-stderr.txt @@ -1,6 +1,6 @@ CMake Error in CMakeLists.txt: Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: - ".*RunCMake/IfacePaths/BinaryDirectoryInInterface-build/foo" + ".*RunCMake/IfacePaths_INCLUDE_DIRECTORIES/BinaryDirectoryInInterface-build/foo" which is prefixed in the build directory. diff --git a/Tests/RunCMake/IfacePaths/InstallInBinDir-stderr.txt b/Tests/RunCMake/IfacePaths/InstallInBinDir-stderr.txt index c71b375..3d60831 100644 --- a/Tests/RunCMake/IfacePaths/InstallInBinDir-stderr.txt +++ b/Tests/RunCMake/IfacePaths/InstallInBinDir-stderr.txt @@ -1,6 +1,6 @@ CMake Error in CMakeLists.txt: Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: - ".*Tests/RunCMake/IfacePaths/InstallInBinDir-build/foo" + ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/InstallInBinDir-build/foo" which is prefixed in the build directory. diff --git a/Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr.txt b/Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr.txt index 526ef61..11994dd 100644 --- a/Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr.txt +++ b/Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr.txt @@ -1,6 +1,6 @@ CMake Error in CMakeLists.txt: Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: - ".*Tests/RunCMake/IfacePaths/copy/foo" + ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/copy/foo" which is prefixed in the source directory. diff --git a/Tests/RunCMake/IfacePaths/RunCMakeTest.cmake b/Tests/RunCMake/IfacePaths/RunCMakeTest.cmake index 4c9a703..8febf18 100644 --- a/Tests/RunCMake/IfacePaths/RunCMakeTest.cmake +++ b/Tests/RunCMake/IfacePaths/RunCMakeTest.cmake @@ -1,5 +1,10 @@ include(RunCMake) +macro(run_cmake test) + list(APPEND RunCMake_TEST_OPTIONS -DTEST_PROP=${TEST_PROP}) + _run_cmake(${test}) +endmacro() + run_cmake(RelativePathInInterface) run_cmake(RelativePathInGenex) run_cmake(export-NOWARN) @@ -57,12 +62,15 @@ configure_file( COPYONLY ) -foreach(policyStatus "" NEW OLD) - if (NOT "${policyStatus}" STREQUAL "") - set(policyOption -DCMAKE_POLICY_DEFAULT_CMP0052=${policyStatus}) - else() - unset(policyOption) - set(policyStatus WARN) +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} @@ -73,16 +81,20 @@ foreach(policyStatus "" NEW OLD) # 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}) + 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-CMP0052-${policyStatus}) + 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") diff --git a/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-stderr.txt b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-stderr.txt index ab95537..ed5df34 100644 --- a/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-stderr.txt +++ b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-stderr.txt @@ -1,6 +1,6 @@ CMake Error in CMakeLists.txt: Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: - ".*Tests/RunCMake/IfacePaths/prefix/src/foo" + ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix/src/foo" which is prefixed in the source directory. diff --git a/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-stderr.txt b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-stderr.txt index 23683e8..cb5a51c 100644 --- a/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-stderr.txt +++ b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-stderr.txt @@ -6,15 +6,15 @@ CMake Warning \(dev\) in CMakeLists.txt: Directory: - ".*Tests/RunCMake/IfacePaths/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/IfacePaths/prefix" + ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix" however it is also a subdirectory of the source tree: - ".*Tests/RunCMake/IfacePaths/prefix/src" + ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix/src" This warning is for project developers. Use -Wno-dev to suppress it. -- cgit v0.12 From 736bcb9664b714b91e8a2a573451e0453716f4da Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 30 Nov 2014 13:54:18 +0100 Subject: Tests: Move IfacePaths test stderr files. Rename the files with a property-specific name, so that additional properties can be easily tested. --- .../BinInInstallPrefix-CMP0052-NEW-stderr.txt | 6 ------ ...Prefix-CMP0052-NEW-stderr_INCLUDE_DIRECTORIES.txt | 6 ++++++ .../BinInInstallPrefix-CMP0052-WARN-stderr.txt | 20 -------------------- ...refix-CMP0052-WARN-stderr_INCLUDE_DIRECTORIES.txt | 20 ++++++++++++++++++++ .../IfacePaths/BinaryDirectoryInInterface-stderr.txt | 6 ------ ...rectoryInInterface-stderr_INCLUDE_DIRECTORIES.txt | 6 ++++++ Tests/RunCMake/IfacePaths/InstallInBinDir-stderr.txt | 6 ------ .../InstallInBinDir-stderr_INCLUDE_DIRECTORIES.txt | 6 ++++++ Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr.txt | 6 ------ .../InstallInSrcDir-stderr_INCLUDE_DIRECTORIES.txt | 6 ++++++ .../IfacePaths/RelativePathInGenex-stderr.txt | 5 ----- ...elativePathInGenex-stderr_INCLUDE_DIRECTORIES.txt | 5 +++++ .../IfacePaths/RelativePathInInterface-stderr.txt | 5 ----- ...ivePathInInterface-stderr_INCLUDE_DIRECTORIES.txt | 5 +++++ Tests/RunCMake/IfacePaths/RunCMakeTest.cmake | 1 + .../IfacePaths/SourceDirectoryInInterface-stderr.txt | 6 ------ ...rectoryInInterface-stderr_INCLUDE_DIRECTORIES.txt | 6 ++++++ .../SrcInInstallPrefix-CMP0052-NEW-stderr.txt | 6 ------ ...Prefix-CMP0052-NEW-stderr_INCLUDE_DIRECTORIES.txt | 6 ++++++ .../SrcInInstallPrefix-CMP0052-WARN-stderr.txt | 20 -------------------- ...refix-CMP0052-WARN-stderr_INCLUDE_DIRECTORIES.txt | 20 ++++++++++++++++++++ 21 files changed, 87 insertions(+), 86 deletions(-) delete mode 100644 Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-stderr.txt create mode 100644 Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-stderr_INCLUDE_DIRECTORIES.txt delete mode 100644 Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-stderr.txt create mode 100644 Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-stderr_INCLUDE_DIRECTORIES.txt delete mode 100644 Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-stderr.txt create mode 100644 Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-stderr_INCLUDE_DIRECTORIES.txt delete mode 100644 Tests/RunCMake/IfacePaths/InstallInBinDir-stderr.txt create mode 100644 Tests/RunCMake/IfacePaths/InstallInBinDir-stderr_INCLUDE_DIRECTORIES.txt delete mode 100644 Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr.txt create mode 100644 Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr_INCLUDE_DIRECTORIES.txt delete mode 100644 Tests/RunCMake/IfacePaths/RelativePathInGenex-stderr.txt create mode 100644 Tests/RunCMake/IfacePaths/RelativePathInGenex-stderr_INCLUDE_DIRECTORIES.txt delete mode 100644 Tests/RunCMake/IfacePaths/RelativePathInInterface-stderr.txt create mode 100644 Tests/RunCMake/IfacePaths/RelativePathInInterface-stderr_INCLUDE_DIRECTORIES.txt delete mode 100644 Tests/RunCMake/IfacePaths/SourceDirectoryInInterface-stderr.txt create mode 100644 Tests/RunCMake/IfacePaths/SourceDirectoryInInterface-stderr_INCLUDE_DIRECTORIES.txt delete mode 100644 Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-stderr.txt create mode 100644 Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-stderr_INCLUDE_DIRECTORIES.txt delete mode 100644 Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-stderr.txt create mode 100644 Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-stderr_INCLUDE_DIRECTORIES.txt diff --git a/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-stderr.txt b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-stderr.txt deleted file mode 100644 index f2d749b..0000000 --- a/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Error in CMakeLists.txt: - Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: - - ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix/BinInInstallPrefix-CMP0052-NEW-build/foo" - - which is prefixed in the build directory. diff --git a/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-stderr_INCLUDE_DIRECTORIES.txt b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-stderr_INCLUDE_DIRECTORIES.txt new file mode 100644 index 0000000..f2d749b --- /dev/null +++ b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-stderr_INCLUDE_DIRECTORIES.txt @@ -0,0 +1,6 @@ +CMake Error in CMakeLists.txt: + Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: + + ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix/BinInInstallPrefix-CMP0052-NEW-build/foo" + + which is prefixed in the build directory. diff --git a/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-stderr.txt b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-stderr.txt deleted file mode 100644 index 3d83892..0000000 --- a/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-stderr.txt +++ /dev/null @@ -1,20 +0,0 @@ -CMake Warning \(dev\) in CMakeLists.txt: - Policy CMP0052 is not set: Reject source and build dirs in installed - INTERFACE_INCLUDE_DIRECTORIES. Run "cmake --help-policy CMP0052" for - policy details. Use the cmake_policy command to set the policy and - suppress this warning. - - Directory: - - ".*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/IfacePaths_INCLUDE_DIRECTORIES/prefix" - - however it is also a subdirectory of the build tree: - - ".*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/IfacePaths/BinInInstallPrefix-CMP0052-WARN-stderr_INCLUDE_DIRECTORIES.txt b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-stderr_INCLUDE_DIRECTORIES.txt new file mode 100644 index 0000000..3d83892 --- /dev/null +++ b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-stderr_INCLUDE_DIRECTORIES.txt @@ -0,0 +1,20 @@ +CMake Warning \(dev\) in CMakeLists.txt: + Policy CMP0052 is not set: Reject source and build dirs in installed + INTERFACE_INCLUDE_DIRECTORIES. Run "cmake --help-policy CMP0052" for + policy details. Use the cmake_policy command to set the policy and + suppress this warning. + + Directory: + + ".*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/IfacePaths_INCLUDE_DIRECTORIES/prefix" + + however it is also a subdirectory of the build tree: + + ".*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/IfacePaths/BinaryDirectoryInInterface-stderr.txt b/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-stderr.txt deleted file mode 100644 index ed7cd58..0000000 --- a/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Error in CMakeLists.txt: - Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: - - ".*RunCMake/IfacePaths_INCLUDE_DIRECTORIES/BinaryDirectoryInInterface-build/foo" - - which is prefixed in the build directory. diff --git a/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-stderr_INCLUDE_DIRECTORIES.txt b/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-stderr_INCLUDE_DIRECTORIES.txt new file mode 100644 index 0000000..ed7cd58 --- /dev/null +++ b/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-stderr_INCLUDE_DIRECTORIES.txt @@ -0,0 +1,6 @@ +CMake Error in CMakeLists.txt: + Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: + + ".*RunCMake/IfacePaths_INCLUDE_DIRECTORIES/BinaryDirectoryInInterface-build/foo" + + which is prefixed in the build directory. diff --git a/Tests/RunCMake/IfacePaths/InstallInBinDir-stderr.txt b/Tests/RunCMake/IfacePaths/InstallInBinDir-stderr.txt deleted file mode 100644 index 3d60831..0000000 --- a/Tests/RunCMake/IfacePaths/InstallInBinDir-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Error in CMakeLists.txt: - Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: - - ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/InstallInBinDir-build/foo" - - which is prefixed in the build directory. diff --git a/Tests/RunCMake/IfacePaths/InstallInBinDir-stderr_INCLUDE_DIRECTORIES.txt b/Tests/RunCMake/IfacePaths/InstallInBinDir-stderr_INCLUDE_DIRECTORIES.txt new file mode 100644 index 0000000..3d60831 --- /dev/null +++ b/Tests/RunCMake/IfacePaths/InstallInBinDir-stderr_INCLUDE_DIRECTORIES.txt @@ -0,0 +1,6 @@ +CMake Error in CMakeLists.txt: + Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: + + ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/InstallInBinDir-build/foo" + + which is prefixed in the build directory. diff --git a/Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr.txt b/Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr.txt deleted file mode 100644 index 11994dd..0000000 --- a/Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Error in CMakeLists.txt: - Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: - - ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/copy/foo" - - which is prefixed in the source directory. diff --git a/Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr_INCLUDE_DIRECTORIES.txt b/Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr_INCLUDE_DIRECTORIES.txt new file mode 100644 index 0000000..11994dd --- /dev/null +++ b/Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr_INCLUDE_DIRECTORIES.txt @@ -0,0 +1,6 @@ +CMake Error in CMakeLists.txt: + Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: + + ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/copy/foo" + + which is prefixed in the source directory. diff --git a/Tests/RunCMake/IfacePaths/RelativePathInGenex-stderr.txt b/Tests/RunCMake/IfacePaths/RelativePathInGenex-stderr.txt deleted file mode 100644 index 490c700..0000000 --- a/Tests/RunCMake/IfacePaths/RelativePathInGenex-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -CMake Error in CMakeLists.txt: - Target "testTarget" contains relative path in its - INTERFACE_INCLUDE_DIRECTORIES: - - "foo" diff --git a/Tests/RunCMake/IfacePaths/RelativePathInGenex-stderr_INCLUDE_DIRECTORIES.txt b/Tests/RunCMake/IfacePaths/RelativePathInGenex-stderr_INCLUDE_DIRECTORIES.txt new file mode 100644 index 0000000..490c700 --- /dev/null +++ b/Tests/RunCMake/IfacePaths/RelativePathInGenex-stderr_INCLUDE_DIRECTORIES.txt @@ -0,0 +1,5 @@ +CMake Error in CMakeLists.txt: + Target "testTarget" contains relative path in its + INTERFACE_INCLUDE_DIRECTORIES: + + "foo" diff --git a/Tests/RunCMake/IfacePaths/RelativePathInInterface-stderr.txt b/Tests/RunCMake/IfacePaths/RelativePathInInterface-stderr.txt deleted file mode 100644 index f6cdb53..0000000 --- a/Tests/RunCMake/IfacePaths/RelativePathInInterface-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -CMake Error in CMakeLists.txt: - Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains - relative path: - - "foo" diff --git a/Tests/RunCMake/IfacePaths/RelativePathInInterface-stderr_INCLUDE_DIRECTORIES.txt b/Tests/RunCMake/IfacePaths/RelativePathInInterface-stderr_INCLUDE_DIRECTORIES.txt new file mode 100644 index 0000000..f6cdb53 --- /dev/null +++ b/Tests/RunCMake/IfacePaths/RelativePathInInterface-stderr_INCLUDE_DIRECTORIES.txt @@ -0,0 +1,5 @@ +CMake Error in CMakeLists.txt: + Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains + relative path: + + "foo" diff --git a/Tests/RunCMake/IfacePaths/RunCMakeTest.cmake b/Tests/RunCMake/IfacePaths/RunCMakeTest.cmake index 8febf18..489e3df 100644 --- a/Tests/RunCMake/IfacePaths/RunCMakeTest.cmake +++ b/Tests/RunCMake/IfacePaths/RunCMakeTest.cmake @@ -2,6 +2,7 @@ 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() diff --git a/Tests/RunCMake/IfacePaths/SourceDirectoryInInterface-stderr.txt b/Tests/RunCMake/IfacePaths/SourceDirectoryInInterface-stderr.txt deleted file mode 100644 index 97a94b1..0000000 --- a/Tests/RunCMake/IfacePaths/SourceDirectoryInInterface-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Error in CMakeLists.txt: - Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: - - ".*RunCMake/IfacePaths/foo" - - which is prefixed in the source directory. diff --git a/Tests/RunCMake/IfacePaths/SourceDirectoryInInterface-stderr_INCLUDE_DIRECTORIES.txt b/Tests/RunCMake/IfacePaths/SourceDirectoryInInterface-stderr_INCLUDE_DIRECTORIES.txt new file mode 100644 index 0000000..97a94b1 --- /dev/null +++ b/Tests/RunCMake/IfacePaths/SourceDirectoryInInterface-stderr_INCLUDE_DIRECTORIES.txt @@ -0,0 +1,6 @@ +CMake Error in CMakeLists.txt: + Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: + + ".*RunCMake/IfacePaths/foo" + + which is prefixed in the source directory. diff --git a/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-stderr.txt b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-stderr.txt deleted file mode 100644 index ed5df34..0000000 --- a/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Error in CMakeLists.txt: - Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: - - ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix/src/foo" - - which is prefixed in the source directory. diff --git a/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-stderr_INCLUDE_DIRECTORIES.txt b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-stderr_INCLUDE_DIRECTORIES.txt new file mode 100644 index 0000000..ed5df34 --- /dev/null +++ b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-stderr_INCLUDE_DIRECTORIES.txt @@ -0,0 +1,6 @@ +CMake Error in CMakeLists.txt: + Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path: + + ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix/src/foo" + + which is prefixed in the source directory. diff --git a/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-stderr.txt b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-stderr.txt deleted file mode 100644 index cb5a51c..0000000 --- a/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-stderr.txt +++ /dev/null @@ -1,20 +0,0 @@ -CMake Warning \(dev\) in CMakeLists.txt: - Policy CMP0052 is not set: Reject source and build dirs in installed - INTERFACE_INCLUDE_DIRECTORIES. Run "cmake --help-policy CMP0052" for - policy details. Use the cmake_policy command to set the policy and - suppress this warning. - - Directory: - - ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix/src/foo" - - in INTERFACE_INCLUDE_DIRECTORIES of target "testTarget" is a subdirectory - of the install directory: - - ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix" - - however it is also a subdirectory of the source tree: - - ".*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-CMP0052-WARN-stderr_INCLUDE_DIRECTORIES.txt b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-stderr_INCLUDE_DIRECTORIES.txt new file mode 100644 index 0000000..cb5a51c --- /dev/null +++ b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-stderr_INCLUDE_DIRECTORIES.txt @@ -0,0 +1,20 @@ +CMake Warning \(dev\) in CMakeLists.txt: + Policy CMP0052 is not set: Reject source and build dirs in installed + INTERFACE_INCLUDE_DIRECTORIES. Run "cmake --help-policy CMP0052" for + policy details. Use the cmake_policy command to set the policy and + suppress this warning. + + Directory: + + ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix/src/foo" + + in INTERFACE_INCLUDE_DIRECTORIES of target "testTarget" is a subdirectory + of the install directory: + + ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix" + + however it is also a subdirectory of the source tree: + + ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix/src" + +This warning is for project developers. Use -Wno-dev to suppress it. -- cgit v0.12 From 6da65b3907419df28484c570f24d0da3593a0e5a Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 28 Nov 2014 18:58:38 +0100 Subject: Allow export of targets with INTERFACE_SOURCES. Use the same rules for paths in source and binary dirs in installed INTERFACE_SOURCES as are used for INTERFACE_INCLUDE_DIRECTORIES. --- Help/command/target_sources.rst | 4 - Help/prop_tgt/INTERFACE_SOURCES.rst | 4 - Source/cmExportBuildFileGenerator.cxx | 13 +- Source/cmExportFileGenerator.cxx | 136 ++++++++++++++------- Source/cmExportFileGenerator.h | 5 + Source/cmExportInstallFileGenerator.cxx | 28 +++-- Tests/ExportImport/Export/Interface/CMakeLists.txt | 12 +- .../Export/Interface/source_target.cpp | 13 ++ .../Export/Interface/source_target_for_install.cpp | 13 ++ Tests/ExportImport/Import/Interface/CMakeLists.txt | 8 ++ .../Import/Interface/source_target_test.cpp | 7 ++ Tests/RunCMake/CMakeLists.txt | 3 + .../IfacePaths/BinInInstallPrefix-result.txt | 1 + .../BinInInstallPrefix-stderr_SOURCES.txt | 6 + .../BinaryDirectoryInInterface-stderr_SOURCES.txt | 6 + .../IfacePaths/BinaryDirectoryInInterface.cmake | 6 +- Tests/RunCMake/IfacePaths/DirInInstallPrefix.cmake | 7 +- .../IfacePaths/InstallInBinDir-stderr_SOURCES.txt | 6 + .../IfacePaths/InstallInSrcDir-stderr_SOURCES.txt | 6 + .../RelativePathInGenex-stderr_SOURCES.txt | 4 + .../RunCMake/IfacePaths/RelativePathInGenex.cmake | 7 +- .../RelativePathInInterface-stderr_SOURCES.txt | 4 + .../IfacePaths/RelativePathInInterface.cmake | 7 +- .../SourceDirectoryInInterface-stderr_SOURCES.txt | 6 + .../IfacePaths/SourceDirectoryInInterface.cmake | 6 +- .../IfacePaths/SrcInInstallPrefix-result.txt | 1 + .../SrcInInstallPrefix-stderr_SOURCES.txt | 6 + Tests/RunCMake/IfacePaths/export-NOWARN.cmake | 15 +++ .../RunCMake/TargetSources/ExportBuild-result.txt | 2 +- .../RunCMake/TargetSources/ExportBuild-stderr.txt | 1 - .../TargetSources/ExportInstall-result.txt | 1 - .../TargetSources/ExportInstall-stderr.txt | 1 - Tests/RunCMake/TargetSources/ExportInstall.cmake | 6 - Tests/RunCMake/TargetSources/RunCMakeTest.cmake | 1 - 34 files changed, 261 insertions(+), 91 deletions(-) create mode 100644 Tests/ExportImport/Export/Interface/source_target.cpp create mode 100644 Tests/ExportImport/Export/Interface/source_target_for_install.cpp create mode 100644 Tests/ExportImport/Import/Interface/source_target_test.cpp create mode 100644 Tests/RunCMake/IfacePaths/BinInInstallPrefix-result.txt create mode 100644 Tests/RunCMake/IfacePaths/BinInInstallPrefix-stderr_SOURCES.txt create mode 100644 Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-stderr_SOURCES.txt create mode 100644 Tests/RunCMake/IfacePaths/InstallInBinDir-stderr_SOURCES.txt create mode 100644 Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr_SOURCES.txt create mode 100644 Tests/RunCMake/IfacePaths/RelativePathInGenex-stderr_SOURCES.txt create mode 100644 Tests/RunCMake/IfacePaths/RelativePathInInterface-stderr_SOURCES.txt create mode 100644 Tests/RunCMake/IfacePaths/SourceDirectoryInInterface-stderr_SOURCES.txt create mode 100644 Tests/RunCMake/IfacePaths/SrcInInstallPrefix-result.txt create mode 100644 Tests/RunCMake/IfacePaths/SrcInInstallPrefix-stderr_SOURCES.txt delete mode 100644 Tests/RunCMake/TargetSources/ExportBuild-stderr.txt delete mode 100644 Tests/RunCMake/TargetSources/ExportInstall-result.txt delete mode 100644 Tests/RunCMake/TargetSources/ExportInstall-stderr.txt delete mode 100644 Tests/RunCMake/TargetSources/ExportInstall.cmake diff --git a/Help/command/target_sources.rst b/Help/command/target_sources.rst index 832240a..d6f148d 100644 --- a/Help/command/target_sources.rst +++ b/Help/command/target_sources.rst @@ -22,10 +22,6 @@ items will populate the :prop_tgt:`SOURCES` property of following arguments specify sources. Repeated calls for the same ```` append items in the order called. -Targets with :prop_tgt:`INTERFACE_SOURCES` may not be exported with the -:command:`export` or :command:`install(EXPORT)` commands. This limitation may be -lifted in a future version of CMake. - Arguments to ``target_sources`` may use "generator expressions" with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual for available expressions. See the :manual:`cmake-buildsystem(7)` diff --git a/Help/prop_tgt/INTERFACE_SOURCES.rst b/Help/prop_tgt/INTERFACE_SOURCES.rst index 696ee95..a224b68 100644 --- a/Help/prop_tgt/INTERFACE_SOURCES.rst +++ b/Help/prop_tgt/INTERFACE_SOURCES.rst @@ -12,10 +12,6 @@ When target dependencies are specified using :command:`target_link_libraries`, CMake will read this property from all target dependencies to determine the sources of the consumer. -Targets with ``INTERFACE_SOURCES`` may not be exported with the -:command:`export` or :command:`install(EXPORT)` commands. This limitation may be -lifted in a future version of CMake. - Contents of ``INTERFACE_SOURCES`` may use "generator expressions" with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual for available expressions. See the :manual:`cmake-buildsystem(7)` diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx index a28ec48..b1203dd 100644 --- a/Source/cmExportBuildFileGenerator.cxx +++ b/Source/cmExportBuildFileGenerator.cxx @@ -68,16 +68,6 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os) tei != this->Exports.end(); ++tei) { cmTarget* te = *tei; - if (te->GetProperty("INTERFACE_SOURCES")) - { - std::ostringstream e; - e << "Target \"" - << te->GetName() - << "\" has a populated INTERFACE_SOURCES property. This is not " - "currently supported."; - cmSystemTools::Error(e.str().c_str()); - return false; - } this->GenerateImportTargetCode(os, te); te->AppendBuildInterfaceIncludes(); @@ -87,6 +77,9 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os) this->PopulateInterfaceProperty("INTERFACE_INCLUDE_DIRECTORIES", te, cmGeneratorExpression::BuildInterface, properties, missingTargets); + this->PopulateInterfaceProperty("INTERFACE_SOURCES", te, + cmGeneratorExpression::BuildInterface, + properties, missingTargets); this->PopulateInterfaceProperty("INTERFACE_COMPILE_DEFINITIONS", te, cmGeneratorExpression::BuildInterface, properties, missingTargets); diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index af4ce8b..71728be 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -224,7 +224,7 @@ static bool isSubDirectory(const char* a, const char* b) //---------------------------------------------------------------------------- static bool checkInterfaceDirs(const std::string &prepro, - cmTarget *target) + cmTarget *target, const std::string& prop) { const char* installDir = target->GetMakefile()->GetSafeDefinition("CMAKE_INSTALL_PREFIX"); @@ -250,20 +250,27 @@ static bool checkInterfaceDirs(const std::string &prepro, std::ostringstream e; if (genexPos != std::string::npos) { - switch (target->GetPolicyStatusCMP0041()) + if (prop == "INTERFACE_INCLUDE_DIRECTORIES") { - case cmPolicies::WARN: - messageType = cmake::WARNING; - e << target->GetMakefile()->GetPolicies() - ->GetPolicyWarning(cmPolicies::CMP0041) << "\n"; - break; - case cmPolicies::OLD: - continue; - case cmPolicies::REQUIRED_IF_USED: - case cmPolicies::REQUIRED_ALWAYS: - case cmPolicies::NEW: - hadFatalError = true; - break; // Issue fatal message. + switch (target->GetPolicyStatusCMP0041()) + { + case cmPolicies::WARN: + messageType = cmake::WARNING; + e << target->GetMakefile()->GetPolicies() + ->GetPolicyWarning(cmPolicies::CMP0041) << "\n"; + break; + case cmPolicies::OLD: + continue; + case cmPolicies::REQUIRED_IF_USED: + case cmPolicies::REQUIRED_ALWAYS: + case cmPolicies::NEW: + hadFatalError = true; + break; // Issue fatal message. + } + } + else + { + hadFatalError = true; } } if (cmHasLiteralPrefix(li->c_str(), "${_IMPORT_PREFIX}")) @@ -272,8 +279,8 @@ static bool checkInterfaceDirs(const std::string &prepro, } if (!cmSystemTools::FileIsFullPath(li->c_str())) { - e << "Target \"" << target->GetName() << "\" " - "INTERFACE_INCLUDE_DIRECTORIES property contains relative path:\n" + e << "Target \"" << target->GetName() << "\" " << prop << + " property contains relative path:\n" " \"" << *li << "\""; target->GetMakefile()->IssueMessage(messageType, e.str()); } @@ -289,32 +296,35 @@ static bool checkInterfaceDirs(const std::string &prepro, (!inBinary || isSubDirectory(installDir, topBinaryDir)) && (!inSource || isSubDirectory(installDir, topSourceDir)); - if (!shouldContinue) + if (prop == "INTERFACE_INCLUDE_DIRECTORIES") { - switch(target->GetPolicyStatusCMP0052()) + if (!shouldContinue) { - case cmPolicies::WARN: + switch(target->GetPolicyStatusCMP0052()) { - std::ostringstream s; - s << target->GetMakefile()->GetPolicies() - ->GetPolicyWarning(cmPolicies::CMP0052) << "\n"; - s << "Directory:\n \"" << *li << "\"\nin " - "INTERFACE_INCLUDE_DIRECTORIES of target \"" - << target->GetName() << "\" is a subdirectory of the install " - "directory:\n \"" << installDir << "\"\nhowever it is also " - "a subdirectory of the " << (inBinary ? "build" : "source") - << " tree:\n \"" << (inBinary ? topBinaryDir : topSourceDir) - << "\"" << std::endl; - target->GetMakefile()->IssueMessage(cmake::AUTHOR_WARNING, - s.str()); + case cmPolicies::WARN: + { + std::ostringstream s; + s << target->GetMakefile()->GetPolicies() + ->GetPolicyWarning(cmPolicies::CMP0052) << "\n"; + s << "Directory:\n \"" << *li << "\"\nin " + "INTERFACE_INCLUDE_DIRECTORIES of target \"" + << target->GetName() << "\" is a subdirectory of the install " + "directory:\n \"" << installDir << "\"\nhowever it is also " + "a subdirectory of the " << (inBinary ? "build" : "source") + << " tree:\n \"" << (inBinary ? topBinaryDir : topSourceDir) + << "\"" << std::endl; + target->GetMakefile()->IssueMessage(cmake::AUTHOR_WARNING, + s.str()); + } + case cmPolicies::OLD: + shouldContinue = true; + break; + case cmPolicies::REQUIRED_ALWAYS: + case cmPolicies::REQUIRED_IF_USED: + case cmPolicies::NEW: + break; } - case cmPolicies::OLD: - shouldContinue = true; - break; - case cmPolicies::REQUIRED_ALWAYS: - case cmPolicies::REQUIRED_IF_USED: - case cmPolicies::NEW: - break; } } if (shouldContinue) @@ -324,8 +334,8 @@ static bool checkInterfaceDirs(const std::string &prepro, } if (inBinary) { - e << "Target \"" << target->GetName() << "\" " - "INTERFACE_INCLUDE_DIRECTORIES property contains path:\n" + e << "Target \"" << target->GetName() << "\" " << prop << + " property contains path:\n" " \"" << *li << "\"\nwhich is prefixed in the build directory."; target->GetMakefile()->IssueMessage(messageType, e.str()); } @@ -333,8 +343,8 @@ static bool checkInterfaceDirs(const std::string &prepro, { if (inSource) { - e << "Target \"" << target->GetName() << "\" " - "INTERFACE_INCLUDE_DIRECTORIES property contains path:\n" + e << "Target \"" << target->GetName() << "\" " << prop << + " property contains path:\n" " \"" << *li << "\"\nwhich is prefixed in the source directory."; target->GetMakefile()->IssueMessage(messageType, e.str()); } @@ -365,6 +375,46 @@ static void prefixItems(std::string &exportDirs) } //---------------------------------------------------------------------------- +void cmExportFileGenerator::PopulateSourcesInterface( + cmTargetExport *tei, + cmGeneratorExpression::PreprocessContext preprocessRule, + ImportPropertyMap &properties, + std::vector &missingTargets) +{ + cmTarget *target = tei->Target; + assert(preprocessRule == cmGeneratorExpression::InstallInterface); + + const char *propName = "INTERFACE_SOURCES"; + const char *input = target->GetProperty(propName); + + if (!input) + { + return; + } + + if (!*input) + { + properties[propName] = ""; + return; + } + + std::string prepro = cmGeneratorExpression::Preprocess(input, + preprocessRule, + true); + if (!prepro.empty()) + { + this->ResolveTargetsInGeneratorExpressions(prepro, target, + missingTargets); + + if (!checkInterfaceDirs(prepro, target, propName)) + { + return; + } + properties[propName] = prepro; + } +} + +//---------------------------------------------------------------------------- void cmExportFileGenerator::PopulateIncludeDirectoriesInterface( cmTargetExport *tei, cmGeneratorExpression::PreprocessContext preprocessRule, @@ -424,7 +474,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface( this->ResolveTargetsInGeneratorExpressions(prepro, target, missingTargets); - if (!checkInterfaceDirs(prepro, target)) + if (!checkInterfaceDirs(prepro, target, propName)) { return; } diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h index 919924e..b6f4166 100644 --- a/Source/cmExportFileGenerator.h +++ b/Source/cmExportFileGenerator.h @@ -139,6 +139,11 @@ protected: cmGeneratorExpression::PreprocessContext preprocessRule, ImportPropertyMap &properties, std::vector &missingTargets); + void PopulateSourcesInterface( + cmTargetExport *target, + cmGeneratorExpression::PreprocessContext preprocessRule, + ImportPropertyMap &properties, + std::vector &missingTargets); void SetImportLinkInterface(const std::string& config, std::string const& suffix, diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index 98ed818..a0d9013 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -123,6 +123,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os) bool require2_8_12 = false; bool require3_0_0 = false; + bool require3_1_0 = false; bool requiresConfigFiles = false; // Create all the imported targets. for(std::vector::const_iterator @@ -131,17 +132,6 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os) { cmTarget* te = (*tei)->Target; - if (te->GetProperty("INTERFACE_SOURCES")) - { - std::ostringstream e; - e << "Target \"" - << te->GetName() - << "\" has a populated INTERFACE_SOURCES property. This is not " - "currently supported."; - cmSystemTools::Error(e.str().c_str()); - return false; - } - requiresConfigFiles = requiresConfigFiles || te->GetType() != cmTarget::INTERFACE_LIBRARY; @@ -152,6 +142,9 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os) this->PopulateIncludeDirectoriesInterface(*tei, cmGeneratorExpression::InstallInterface, properties, missingTargets); + this->PopulateSourcesInterface(*tei, + cmGeneratorExpression::InstallInterface, + properties, missingTargets); this->PopulateInterfaceProperty("INTERFACE_SYSTEM_INCLUDE_DIRECTORIES", te, cmGeneratorExpression::InstallInterface, @@ -190,6 +183,13 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os) { require3_0_0 = true; } + if(te->GetProperty("INTERFACE_SOURCES")) + { + // We can only generate INTERFACE_SOURCES in CMake 3.3, but CMake 3.1 + // can consume them. + require3_1_0 = true; + } + this->PopulateInterfaceProperty("INTERFACE_POSITION_INDEPENDENT_CODE", te, properties); this->PopulateCompatibleInterfaceProperties(te, properties); @@ -197,7 +197,11 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os) this->GenerateInterfaceProperties(te, os, properties); } - if (require3_0_0) + if (require3_1_0) + { + this->GenerateRequiredCMakeVersion(os, "3.1.0"); + } + else if (require3_0_0) { this->GenerateRequiredCMakeVersion(os, "3.0.0"); } 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 + $ + $/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/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 71507b8..2de82a7 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -192,6 +192,9 @@ 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/IfacePaths/BinInInstallPrefix-result.txt b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-result.txt @@ -0,0 +1 @@ +1 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/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 index 67ee7de..7001f3f 100644 --- a/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface.cmake +++ b/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface.cmake @@ -2,7 +2,11 @@ enable_language(CXX) add_library(testTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp") -target_include_directories(testTarget INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/foo") +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 diff --git a/Tests/RunCMake/IfacePaths/DirInInstallPrefix.cmake b/Tests/RunCMake/IfacePaths/DirInInstallPrefix.cmake index fab7717..f5f3005 100644 --- a/Tests/RunCMake/IfacePaths/DirInInstallPrefix.cmake +++ b/Tests/RunCMake/IfacePaths/DirInInstallPrefix.cmake @@ -1,6 +1,11 @@ enable_language(CXX) add_library(testTarget empty.cpp) -target_include_directories(testTarget INTERFACE "${CMAKE_INSTALL_PREFIX}/dir") + +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 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/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/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 index 070a381..489c3a1 100644 --- a/Tests/RunCMake/IfacePaths/RelativePathInGenex.cmake +++ b/Tests/RunCMake/IfacePaths/RelativePathInGenex.cmake @@ -2,7 +2,12 @@ enable_language(CXX) add_library(testTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp") -set_property(TARGET testTarget PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<1:foo>") + +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/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 index 4c4727d..e974aac 100644 --- a/Tests/RunCMake/IfacePaths/RelativePathInInterface.cmake +++ b/Tests/RunCMake/IfacePaths/RelativePathInInterface.cmake @@ -2,8 +2,11 @@ enable_language(CXX) add_library(testTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp") -set_property(TARGET testTarget PROPERTY INTERFACE_INCLUDE_DIRECTORIES "foo") - +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 ) 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 index f814a3c..d80cbec 100644 --- a/Tests/RunCMake/IfacePaths/SourceDirectoryInInterface.cmake +++ b/Tests/RunCMake/IfacePaths/SourceDirectoryInInterface.cmake @@ -2,7 +2,11 @@ enable_language(CXX) add_library(testTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp") -target_include_directories(testTarget INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/foo") +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 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/export-NOWARN.cmake b/Tests/RunCMake/IfacePaths/export-NOWARN.cmake index 50720a0..592572c 100644 --- a/Tests/RunCMake/IfacePaths/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 $/include/subdir) +set_property(TARGET foo APPEND PROPERTY INTERFACE_SOURCES $<0:>/include/subdir/empty.cpp) +set_property(TARGET foo APPEND PROPERTY INTERFACE_SOURCES $/include/subdir/empty.cpp) set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $/include/subdir>) set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $) set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $>) set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $/include>) +set_property(TARGET foo APPEND PROPERTY INTERFACE_SOURCES $/include/subdir/empty.cpp>) +set_property(TARGET foo APPEND PROPERTY INTERFACE_SOURCES $) +set_property(TARGET foo APPEND PROPERTY INTERFACE_SOURCES $>) +set_property(TARGET foo APPEND PROPERTY INTERFACE_SOURCES $/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 $/include/subdir) +target_sources(foo INTERFACE $<0:>/include/subdir/empty.cpp) +target_sources(foo INTERFACE $/include/subdir/empty.cpp) target_include_directories(foo INTERFACE $) target_include_directories(foo INTERFACE $>) +target_sources(foo INTERFACE $) +target_sources(foo INTERFACE $>) + +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-result.txt b/Tests/RunCMake/TargetSources/ExportInstall-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/TargetSources/ExportInstall-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 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) -- cgit v0.12 From f7e33820b628f39ae2e0ba3d25279545dfe18f73 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 5 Feb 2015 20:40:51 +0100 Subject: Add release notes for export-interface-source-files. --- Help/release/dev/export-interface-source-files.rst | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Help/release/dev/export-interface-source-files.rst diff --git a/Help/release/dev/export-interface-source-files.rst b/Help/release/dev/export-interface-source-files.rst new file mode 100644 index 0000000..00dcd25 --- /dev/null +++ b/Help/release/dev/export-interface-source-files.rst @@ -0,0 +1,6 @@ +export-interface-source-files +----------------------------- + +* It is now possible to export targets which populate the + :prop_tgt:`INTERFACE_SOURCES` target property using the + :command:`install(EXPORT)` and :command:`export()` commands. -- cgit v0.12