From 7d07569e4daa861f06546ae423b115068d3f6613 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Tue, 19 Oct 2021 15:42:11 -0400 Subject: Tests/RunCMake: Merge TargetSources into target_sources --- Tests/RunCMake/CMakeLists.txt | 1 - .../AddCustomTargetCheckProperty.cmake | 16 ----------- .../TargetSources/AddCustomTargetGenx.cmake | 2 -- .../AddCustomTargetInterfaceSources-result.txt | 1 - .../AddCustomTargetInterfaceSources-stderr.txt | 4 --- .../AddCustomTargetInterfaceSources.cmake | 2 -- .../AddCustomTargetPrivateSources.cmake | 2 -- .../AddCustomTargetPublicSources-result.txt | 1 - .../AddCustomTargetPublicSources-stderr.txt | 4 --- .../AddCustomTargetPublicSources.cmake | 2 -- .../AddCustomTargetSources-result.txt | 1 - .../AddCustomTargetSources-stderr.txt | 4 --- .../TargetSources/AddCustomTargetSources.cmake | 2 -- .../TargetSources/CMP0026-LOCATION-result.txt | 1 - .../TargetSources/CMP0026-LOCATION-stderr.txt | 10 ------- .../RunCMake/TargetSources/CMP0026-LOCATION.cmake | 13 --------- .../RunCMake/TargetSources/CMP0076-OLD-result.txt | 1 - .../RunCMake/TargetSources/CMP0076-OLD-stderr.txt | 4 --- Tests/RunCMake/TargetSources/CMP0076-OLD.cmake | 10 ------- .../RunCMake/TargetSources/CMP0076-WARN-result.txt | 1 - .../RunCMake/TargetSources/CMP0076-WARN-stderr.txt | 21 --------------- Tests/RunCMake/TargetSources/CMP0076-WARN.cmake | 8 ------ .../TargetSources/CMP0076-WARN/CMakeLists.txt | 3 --- .../TargetSources/CMP0076-WARN/subdir_empty_1.cpp | 7 ----- Tests/RunCMake/TargetSources/CMakeLists.txt | 3 --- .../TargetSources/ConfigNotAllowed-result.txt | 1 - .../TargetSources/ConfigNotAllowed-stderr.txt | 12 --------- .../RunCMake/TargetSources/ConfigNotAllowed.cmake | 2 -- .../RunCMake/TargetSources/ExportBuild-result.txt | 1 - Tests/RunCMake/TargetSources/ExportBuild.cmake | 5 ---- .../RunCMake/TargetSources/OriginDebug-result.txt | 1 - .../RunCMake/TargetSources/OriginDebug-stderr.txt | 31 ---------------------- Tests/RunCMake/TargetSources/OriginDebug.cmake | 20 -------------- .../RelativePathInInterface-stdout.txt | 1 - .../TargetSources/RelativePathInInterface.cmake | 10 ------- .../RelativePathInSubdirGenEx-stdout.txt | 1 - .../TargetSources/RelativePathInSubdirGenEx.cmake | 10 ------- .../RelativePathInSubdirGenEx/CMakeLists.txt | 4 --- .../RelativePathInSubdirGenEx/subdir_empty_1.cpp | 7 ----- .../RelativePathInSubdirInclude-stdout.txt | 1 - .../RelativePathInSubdirInclude.cmake | 8 ------ .../RelativePathInSubdirInclude/CMakeLists.txt | 3 --- .../RelativePathInSubdirInclude/subdir_empty_1.cpp | 7 ----- .../RelativePathInSubdirInterface-stdout.txt | 1 - .../RelativePathInSubdirInterface.cmake | 11 -------- .../RelativePathInSubdirInterface/CMakeLists.txt | 5 ---- .../subdir_empty_1.cpp | 7 ----- .../subdir_empty_2.cpp | 7 ----- .../RelativePathInSubdirPrivate-stdout.txt | 1 - .../RelativePathInSubdirPrivate.cmake | 8 ------ .../RelativePathInSubdirPrivate/CMakeLists.txt | 5 ---- .../RelativePathInSubdirPrivate/subdir_empty_1.cpp | 7 ----- .../RelativePathInSubdirPrivate/subdir_empty_2.cpp | 7 ----- Tests/RunCMake/TargetSources/RunCMakeTest.cmake | 22 --------------- Tests/RunCMake/TargetSources/empty_1.cpp | 7 ----- Tests/RunCMake/TargetSources/empty_2.cpp | 7 ----- Tests/RunCMake/TargetSources/empty_3.cpp | 7 ----- Tests/RunCMake/TargetSources/empty_4.cpp | 7 ----- Tests/RunCMake/TargetSources/main.cpp | 5 ---- .../AddCustomTargetCheckProperty.cmake | 16 +++++++++++ .../target_sources/AddCustomTargetGenx.cmake | 2 ++ .../AddCustomTargetInterfaceSources-result.txt | 1 + .../AddCustomTargetInterfaceSources-stderr.txt | 4 +++ .../AddCustomTargetInterfaceSources.cmake | 2 ++ .../AddCustomTargetPrivateSources.cmake | 2 ++ .../AddCustomTargetPublicSources-result.txt | 1 + .../AddCustomTargetPublicSources-stderr.txt | 4 +++ .../AddCustomTargetPublicSources.cmake | 2 ++ .../AddCustomTargetSources-result.txt | 1 + .../AddCustomTargetSources-stderr.txt | 4 +++ .../target_sources/AddCustomTargetSources.cmake | 2 ++ .../target_sources/CMP0026-LOCATION-result.txt | 1 + .../target_sources/CMP0026-LOCATION-stderr.txt | 10 +++++++ .../RunCMake/target_sources/CMP0026-LOCATION.cmake | 14 ++++++++++ .../RunCMake/target_sources/CMP0076-OLD-result.txt | 1 + .../RunCMake/target_sources/CMP0076-OLD-stderr.txt | 4 +++ Tests/RunCMake/target_sources/CMP0076-OLD.cmake | 10 +++++++ .../target_sources/CMP0076-WARN-result.txt | 1 + .../target_sources/CMP0076-WARN-stderr.txt | 21 +++++++++++++++ Tests/RunCMake/target_sources/CMP0076-WARN.cmake | 8 ++++++ .../target_sources/CMP0076-WARN/CMakeLists.txt | 3 +++ .../target_sources/CMP0076-WARN/subdir_empty_1.cpp | 7 +++++ Tests/RunCMake/target_sources/CMakeLists.txt | 2 -- .../target_sources/ConfigNotAllowed-result.txt | 1 + .../target_sources/ConfigNotAllowed-stderr.txt | 12 +++++++++ .../RunCMake/target_sources/ConfigNotAllowed.cmake | 2 ++ .../RunCMake/target_sources/EmptyKeywordArgs.cmake | 5 ++++ .../RunCMake/target_sources/ExportBuild-result.txt | 1 + Tests/RunCMake/target_sources/ExportBuild.cmake | 5 ++++ .../RunCMake/target_sources/OriginDebug-result.txt | 1 + .../RunCMake/target_sources/OriginDebug-stderr.txt | 31 ++++++++++++++++++++++ Tests/RunCMake/target_sources/OriginDebug.cmake | 20 ++++++++++++++ .../RelativePathInInterface-stdout.txt | 1 + .../target_sources/RelativePathInInterface.cmake | 11 ++++++++ .../RelativePathInSubdirGenEx-stdout.txt | 1 + .../target_sources/RelativePathInSubdirGenEx.cmake | 11 ++++++++ .../RelativePathInSubdirGenEx/CMakeLists.txt | 4 +++ .../RelativePathInSubdirGenEx/subdir_empty_1.cpp | 7 +++++ .../RelativePathInSubdirInclude-stdout.txt | 1 + .../RelativePathInSubdirInclude.cmake | 9 +++++++ .../RelativePathInSubdirInclude/CMakeLists.txt | 3 +++ .../RelativePathInSubdirInclude/subdir_empty_1.cpp | 7 +++++ .../RelativePathInSubdirInterface-stdout.txt | 1 + .../RelativePathInSubdirInterface.cmake | 12 +++++++++ .../RelativePathInSubdirInterface/CMakeLists.txt | 5 ++++ .../subdir_empty_1.cpp | 7 +++++ .../subdir_empty_2.cpp | 7 +++++ .../RelativePathInSubdirPrivate-stdout.txt | 1 + .../RelativePathInSubdirPrivate.cmake | 9 +++++++ .../RelativePathInSubdirPrivate/CMakeLists.txt | 5 ++++ .../RelativePathInSubdirPrivate/subdir_empty_1.cpp | 7 +++++ .../RelativePathInSubdirPrivate/subdir_empty_2.cpp | 7 +++++ Tests/RunCMake/target_sources/RunCMakeTest.cmake | 22 ++++++++++++++- Tests/RunCMake/target_sources/empty_1.cpp | 7 +++++ Tests/RunCMake/target_sources/empty_2.cpp | 7 +++++ Tests/RunCMake/target_sources/empty_3.cpp | 7 +++++ Tests/RunCMake/target_sources/empty_4.cpp | 7 +++++ .../target_sources/empty_keyword_args.cmake | 5 ---- Tests/RunCMake/target_sources/main.cpp | 5 ++++ 119 files changed, 369 insertions(+), 371 deletions(-) delete mode 100644 Tests/RunCMake/TargetSources/AddCustomTargetCheckProperty.cmake delete mode 100644 Tests/RunCMake/TargetSources/AddCustomTargetGenx.cmake delete mode 100644 Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources-result.txt delete mode 100644 Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources-stderr.txt delete mode 100644 Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources.cmake delete mode 100644 Tests/RunCMake/TargetSources/AddCustomTargetPrivateSources.cmake delete mode 100644 Tests/RunCMake/TargetSources/AddCustomTargetPublicSources-result.txt delete mode 100644 Tests/RunCMake/TargetSources/AddCustomTargetPublicSources-stderr.txt delete mode 100644 Tests/RunCMake/TargetSources/AddCustomTargetPublicSources.cmake delete mode 100644 Tests/RunCMake/TargetSources/AddCustomTargetSources-result.txt delete mode 100644 Tests/RunCMake/TargetSources/AddCustomTargetSources-stderr.txt delete mode 100644 Tests/RunCMake/TargetSources/AddCustomTargetSources.cmake delete mode 100644 Tests/RunCMake/TargetSources/CMP0026-LOCATION-result.txt delete mode 100644 Tests/RunCMake/TargetSources/CMP0026-LOCATION-stderr.txt delete mode 100644 Tests/RunCMake/TargetSources/CMP0026-LOCATION.cmake delete mode 100644 Tests/RunCMake/TargetSources/CMP0076-OLD-result.txt delete mode 100644 Tests/RunCMake/TargetSources/CMP0076-OLD-stderr.txt delete mode 100644 Tests/RunCMake/TargetSources/CMP0076-OLD.cmake delete mode 100644 Tests/RunCMake/TargetSources/CMP0076-WARN-result.txt delete mode 100644 Tests/RunCMake/TargetSources/CMP0076-WARN-stderr.txt delete mode 100644 Tests/RunCMake/TargetSources/CMP0076-WARN.cmake delete mode 100644 Tests/RunCMake/TargetSources/CMP0076-WARN/CMakeLists.txt delete mode 100644 Tests/RunCMake/TargetSources/CMP0076-WARN/subdir_empty_1.cpp delete mode 100644 Tests/RunCMake/TargetSources/CMakeLists.txt delete mode 100644 Tests/RunCMake/TargetSources/ConfigNotAllowed-result.txt delete mode 100644 Tests/RunCMake/TargetSources/ConfigNotAllowed-stderr.txt delete mode 100644 Tests/RunCMake/TargetSources/ConfigNotAllowed.cmake delete mode 100644 Tests/RunCMake/TargetSources/ExportBuild-result.txt delete mode 100644 Tests/RunCMake/TargetSources/ExportBuild.cmake delete mode 100644 Tests/RunCMake/TargetSources/OriginDebug-result.txt delete mode 100644 Tests/RunCMake/TargetSources/OriginDebug-stderr.txt delete mode 100644 Tests/RunCMake/TargetSources/OriginDebug.cmake delete mode 100644 Tests/RunCMake/TargetSources/RelativePathInInterface-stdout.txt delete mode 100644 Tests/RunCMake/TargetSources/RelativePathInInterface.cmake delete mode 100644 Tests/RunCMake/TargetSources/RelativePathInSubdirGenEx-stdout.txt delete mode 100644 Tests/RunCMake/TargetSources/RelativePathInSubdirGenEx.cmake delete mode 100644 Tests/RunCMake/TargetSources/RelativePathInSubdirGenEx/CMakeLists.txt delete mode 100644 Tests/RunCMake/TargetSources/RelativePathInSubdirGenEx/subdir_empty_1.cpp delete mode 100644 Tests/RunCMake/TargetSources/RelativePathInSubdirInclude-stdout.txt delete mode 100644 Tests/RunCMake/TargetSources/RelativePathInSubdirInclude.cmake delete mode 100644 Tests/RunCMake/TargetSources/RelativePathInSubdirInclude/CMakeLists.txt delete mode 100644 Tests/RunCMake/TargetSources/RelativePathInSubdirInclude/subdir_empty_1.cpp delete mode 100644 Tests/RunCMake/TargetSources/RelativePathInSubdirInterface-stdout.txt delete mode 100644 Tests/RunCMake/TargetSources/RelativePathInSubdirInterface.cmake delete mode 100644 Tests/RunCMake/TargetSources/RelativePathInSubdirInterface/CMakeLists.txt delete mode 100644 Tests/RunCMake/TargetSources/RelativePathInSubdirInterface/subdir_empty_1.cpp delete mode 100644 Tests/RunCMake/TargetSources/RelativePathInSubdirInterface/subdir_empty_2.cpp delete mode 100644 Tests/RunCMake/TargetSources/RelativePathInSubdirPrivate-stdout.txt delete mode 100644 Tests/RunCMake/TargetSources/RelativePathInSubdirPrivate.cmake delete mode 100644 Tests/RunCMake/TargetSources/RelativePathInSubdirPrivate/CMakeLists.txt delete mode 100644 Tests/RunCMake/TargetSources/RelativePathInSubdirPrivate/subdir_empty_1.cpp delete mode 100644 Tests/RunCMake/TargetSources/RelativePathInSubdirPrivate/subdir_empty_2.cpp delete mode 100644 Tests/RunCMake/TargetSources/RunCMakeTest.cmake delete mode 100644 Tests/RunCMake/TargetSources/empty_1.cpp delete mode 100644 Tests/RunCMake/TargetSources/empty_2.cpp delete mode 100644 Tests/RunCMake/TargetSources/empty_3.cpp delete mode 100644 Tests/RunCMake/TargetSources/empty_4.cpp delete mode 100644 Tests/RunCMake/TargetSources/main.cpp create mode 100644 Tests/RunCMake/target_sources/AddCustomTargetCheckProperty.cmake create mode 100644 Tests/RunCMake/target_sources/AddCustomTargetGenx.cmake create mode 100644 Tests/RunCMake/target_sources/AddCustomTargetInterfaceSources-result.txt create mode 100644 Tests/RunCMake/target_sources/AddCustomTargetInterfaceSources-stderr.txt create mode 100644 Tests/RunCMake/target_sources/AddCustomTargetInterfaceSources.cmake create mode 100644 Tests/RunCMake/target_sources/AddCustomTargetPrivateSources.cmake create mode 100644 Tests/RunCMake/target_sources/AddCustomTargetPublicSources-result.txt create mode 100644 Tests/RunCMake/target_sources/AddCustomTargetPublicSources-stderr.txt create mode 100644 Tests/RunCMake/target_sources/AddCustomTargetPublicSources.cmake create mode 100644 Tests/RunCMake/target_sources/AddCustomTargetSources-result.txt create mode 100644 Tests/RunCMake/target_sources/AddCustomTargetSources-stderr.txt create mode 100644 Tests/RunCMake/target_sources/AddCustomTargetSources.cmake create mode 100644 Tests/RunCMake/target_sources/CMP0026-LOCATION-result.txt create mode 100644 Tests/RunCMake/target_sources/CMP0026-LOCATION-stderr.txt create mode 100644 Tests/RunCMake/target_sources/CMP0026-LOCATION.cmake create mode 100644 Tests/RunCMake/target_sources/CMP0076-OLD-result.txt create mode 100644 Tests/RunCMake/target_sources/CMP0076-OLD-stderr.txt create mode 100644 Tests/RunCMake/target_sources/CMP0076-OLD.cmake create mode 100644 Tests/RunCMake/target_sources/CMP0076-WARN-result.txt create mode 100644 Tests/RunCMake/target_sources/CMP0076-WARN-stderr.txt create mode 100644 Tests/RunCMake/target_sources/CMP0076-WARN.cmake create mode 100644 Tests/RunCMake/target_sources/CMP0076-WARN/CMakeLists.txt create mode 100644 Tests/RunCMake/target_sources/CMP0076-WARN/subdir_empty_1.cpp create mode 100644 Tests/RunCMake/target_sources/ConfigNotAllowed-result.txt create mode 100644 Tests/RunCMake/target_sources/ConfigNotAllowed-stderr.txt create mode 100644 Tests/RunCMake/target_sources/ConfigNotAllowed.cmake create mode 100644 Tests/RunCMake/target_sources/EmptyKeywordArgs.cmake create mode 100644 Tests/RunCMake/target_sources/ExportBuild-result.txt create mode 100644 Tests/RunCMake/target_sources/ExportBuild.cmake create mode 100644 Tests/RunCMake/target_sources/OriginDebug-result.txt create mode 100644 Tests/RunCMake/target_sources/OriginDebug-stderr.txt create mode 100644 Tests/RunCMake/target_sources/OriginDebug.cmake create mode 100644 Tests/RunCMake/target_sources/RelativePathInInterface-stdout.txt create mode 100644 Tests/RunCMake/target_sources/RelativePathInInterface.cmake create mode 100644 Tests/RunCMake/target_sources/RelativePathInSubdirGenEx-stdout.txt create mode 100644 Tests/RunCMake/target_sources/RelativePathInSubdirGenEx.cmake create mode 100644 Tests/RunCMake/target_sources/RelativePathInSubdirGenEx/CMakeLists.txt create mode 100644 Tests/RunCMake/target_sources/RelativePathInSubdirGenEx/subdir_empty_1.cpp create mode 100644 Tests/RunCMake/target_sources/RelativePathInSubdirInclude-stdout.txt create mode 100644 Tests/RunCMake/target_sources/RelativePathInSubdirInclude.cmake create mode 100644 Tests/RunCMake/target_sources/RelativePathInSubdirInclude/CMakeLists.txt create mode 100644 Tests/RunCMake/target_sources/RelativePathInSubdirInclude/subdir_empty_1.cpp create mode 100644 Tests/RunCMake/target_sources/RelativePathInSubdirInterface-stdout.txt create mode 100644 Tests/RunCMake/target_sources/RelativePathInSubdirInterface.cmake create mode 100644 Tests/RunCMake/target_sources/RelativePathInSubdirInterface/CMakeLists.txt create mode 100644 Tests/RunCMake/target_sources/RelativePathInSubdirInterface/subdir_empty_1.cpp create mode 100644 Tests/RunCMake/target_sources/RelativePathInSubdirInterface/subdir_empty_2.cpp create mode 100644 Tests/RunCMake/target_sources/RelativePathInSubdirPrivate-stdout.txt create mode 100644 Tests/RunCMake/target_sources/RelativePathInSubdirPrivate.cmake create mode 100644 Tests/RunCMake/target_sources/RelativePathInSubdirPrivate/CMakeLists.txt create mode 100644 Tests/RunCMake/target_sources/RelativePathInSubdirPrivate/subdir_empty_1.cpp create mode 100644 Tests/RunCMake/target_sources/RelativePathInSubdirPrivate/subdir_empty_2.cpp create mode 100644 Tests/RunCMake/target_sources/empty_1.cpp create mode 100644 Tests/RunCMake/target_sources/empty_2.cpp create mode 100644 Tests/RunCMake/target_sources/empty_3.cpp create mode 100644 Tests/RunCMake/target_sources/empty_4.cpp delete mode 100644 Tests/RunCMake/target_sources/empty_keyword_args.cmake create mode 100644 Tests/RunCMake/target_sources/main.cpp diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index c87c1b6..c566b42 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -347,7 +347,6 @@ endif() add_RunCMake_test(ScriptMode) add_RunCMake_test(Swift -DCMAKE_Swift_COMPILER=${CMAKE_Swift_COMPILER}) add_RunCMake_test(TargetObjects) -add_RunCMake_test(TargetSources) add_RunCMake_test(TargetProperties) add_RunCMake_test(ToolchainFile) add_RunCMake_test(find_dependency) diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetCheckProperty.cmake b/Tests/RunCMake/TargetSources/AddCustomTargetCheckProperty.cmake deleted file mode 100644 index 1787e87..0000000 --- a/Tests/RunCMake/TargetSources/AddCustomTargetCheckProperty.cmake +++ /dev/null @@ -1,16 +0,0 @@ -add_custom_target(target1 ALL) -target_sources(target1 PRIVATE main.cpp) -get_property(actualProp1 TARGET target1 PROPERTY SOURCES) -set(desiredProp1 main.cpp) -if(NOT desiredProp1 STREQUAL actualProp1) - message("source property not set. desired: \"${desiredProp1}\" actual: \"${actualProp1}\"") -endif() - -add_custom_target(target2 ALL SOURCES main.cpp) -target_sources(target2 PRIVATE empty_1.cpp empty_2.cpp) -target_sources(target2 PRIVATE empty_3.cpp) -get_property(actualProp2 TARGET target2 PROPERTY SOURCES) -set(desiredProp2 main.cpp empty_1.cpp empty_2.cpp empty_3.cpp) -if (NOT desiredProp2 STREQUAL actualProp2) - message("source property not set. desired: \"${desiredProp2}\" actual: \"${actualProp2}\"") -endif() diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetGenx.cmake b/Tests/RunCMake/TargetSources/AddCustomTargetGenx.cmake deleted file mode 100644 index 0078eab..0000000 --- a/Tests/RunCMake/TargetSources/AddCustomTargetGenx.cmake +++ /dev/null @@ -1,2 +0,0 @@ -add_custom_target(target ALL) -target_sources(target PRIVATE $) diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources-result.txt b/Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources-stderr.txt b/Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources-stderr.txt deleted file mode 100644 index 9334bf6..0000000 --- a/Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Error at AddCustomTargetInterfaceSources.cmake:2 \(target_sources\): - target_sources may only set PRIVATE properties on custom targets -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources.cmake b/Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources.cmake deleted file mode 100644 index 42a8ca2..0000000 --- a/Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources.cmake +++ /dev/null @@ -1,2 +0,0 @@ -add_custom_target(target ALL) -target_sources(target INTERFACE main.cpp) diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetPrivateSources.cmake b/Tests/RunCMake/TargetSources/AddCustomTargetPrivateSources.cmake deleted file mode 100644 index 11f0258..0000000 --- a/Tests/RunCMake/TargetSources/AddCustomTargetPrivateSources.cmake +++ /dev/null @@ -1,2 +0,0 @@ -add_custom_target(target ALL) -target_sources(target PRIVATE main.cpp) diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetPublicSources-result.txt b/Tests/RunCMake/TargetSources/AddCustomTargetPublicSources-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/TargetSources/AddCustomTargetPublicSources-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetPublicSources-stderr.txt b/Tests/RunCMake/TargetSources/AddCustomTargetPublicSources-stderr.txt deleted file mode 100644 index afba4be..0000000 --- a/Tests/RunCMake/TargetSources/AddCustomTargetPublicSources-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Error at AddCustomTargetPublicSources.cmake:2 \(target_sources\): - target_sources may only set PRIVATE properties on custom targets -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetPublicSources.cmake b/Tests/RunCMake/TargetSources/AddCustomTargetPublicSources.cmake deleted file mode 100644 index d9e82c0..0000000 --- a/Tests/RunCMake/TargetSources/AddCustomTargetPublicSources.cmake +++ /dev/null @@ -1,2 +0,0 @@ -add_custom_target(target ALL) -target_sources(target PUBLIC main.cpp) diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetSources-result.txt b/Tests/RunCMake/TargetSources/AddCustomTargetSources-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/TargetSources/AddCustomTargetSources-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetSources-stderr.txt b/Tests/RunCMake/TargetSources/AddCustomTargetSources-stderr.txt deleted file mode 100644 index 4a153e9..0000000 --- a/Tests/RunCMake/TargetSources/AddCustomTargetSources-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Error at AddCustomTargetSources.cmake:2 \(target_sources\): - target_sources called with invalid arguments -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetSources.cmake b/Tests/RunCMake/TargetSources/AddCustomTargetSources.cmake deleted file mode 100644 index dd688d3..0000000 --- a/Tests/RunCMake/TargetSources/AddCustomTargetSources.cmake +++ /dev/null @@ -1,2 +0,0 @@ -add_custom_target(target ALL) -target_sources(target main.cpp) diff --git a/Tests/RunCMake/TargetSources/CMP0026-LOCATION-result.txt b/Tests/RunCMake/TargetSources/CMP0026-LOCATION-result.txt deleted file mode 100644 index 573541a..0000000 --- a/Tests/RunCMake/TargetSources/CMP0026-LOCATION-result.txt +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/Tests/RunCMake/TargetSources/CMP0026-LOCATION-stderr.txt b/Tests/RunCMake/TargetSources/CMP0026-LOCATION-stderr.txt deleted file mode 100644 index d7ccedb..0000000 --- a/Tests/RunCMake/TargetSources/CMP0026-LOCATION-stderr.txt +++ /dev/null @@ -1,10 +0,0 @@ -^CMake Deprecation Warning at CMP0026-LOCATION.cmake:[0-9]+ \(cmake_policy\): - The OLD behavior for policy CMP0026 will be removed from a future version - of CMake. - - The cmake-policies\(7\) manual explains that the OLD behaviors of all - policies are deprecated and that a policy should be set to OLD only under - specific short-term circumstances. Projects should be ported to the NEW - behavior and not rely on setting a policy to OLD. -Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/TargetSources/CMP0026-LOCATION.cmake b/Tests/RunCMake/TargetSources/CMP0026-LOCATION.cmake deleted file mode 100644 index 464df36..0000000 --- a/Tests/RunCMake/TargetSources/CMP0026-LOCATION.cmake +++ /dev/null @@ -1,13 +0,0 @@ - -cmake_policy(SET CMP0026 OLD) - -add_library(objlib OBJECT - empty_1.cpp -) - -add_executable(my_exe - empty_2.cpp - $ -) - -get_target_property( loc my_exe LOCATION) diff --git a/Tests/RunCMake/TargetSources/CMP0076-OLD-result.txt b/Tests/RunCMake/TargetSources/CMP0076-OLD-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/TargetSources/CMP0076-OLD-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/TargetSources/CMP0076-OLD-stderr.txt b/Tests/RunCMake/TargetSources/CMP0076-OLD-stderr.txt deleted file mode 100644 index d47dd4d..0000000 --- a/Tests/RunCMake/TargetSources/CMP0076-OLD-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Error in CMakeLists.txt: - Target "iface" contains relative path in its INTERFACE_SOURCES: - - "empty_1.cpp" diff --git a/Tests/RunCMake/TargetSources/CMP0076-OLD.cmake b/Tests/RunCMake/TargetSources/CMP0076-OLD.cmake deleted file mode 100644 index 4d8c268..0000000 --- a/Tests/RunCMake/TargetSources/CMP0076-OLD.cmake +++ /dev/null @@ -1,10 +0,0 @@ -cmake_policy(SET CMP0076 OLD) - -add_library(iface INTERFACE) -target_sources(iface INTERFACE empty_1.cpp) - -get_property(iface_sources TARGET iface PROPERTY INTERFACE_SOURCES) -message(STATUS "iface: ${iface_sources}") - -add_executable(main main.cpp) -target_link_libraries(main iface) diff --git a/Tests/RunCMake/TargetSources/CMP0076-WARN-result.txt b/Tests/RunCMake/TargetSources/CMP0076-WARN-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/TargetSources/CMP0076-WARN-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/TargetSources/CMP0076-WARN-stderr.txt b/Tests/RunCMake/TargetSources/CMP0076-WARN-stderr.txt deleted file mode 100644 index bd888ee..0000000 --- a/Tests/RunCMake/TargetSources/CMP0076-WARN-stderr.txt +++ /dev/null @@ -1,21 +0,0 @@ -CMake Warning \(dev\) at CMP0076-WARN/CMakeLists\.txt:[0-9]+ \(target_sources\): - Policy CMP0076 is not set: target_sources\(\) command converts relative paths - to absolute. Run "cmake --help-policy CMP0076" for policy details. Use - the cmake_policy command to set the policy and suppress this warning. - - An interface source of target "publiclib" has a relative path. -This warning is for project developers. Use -Wno-dev to suppress it. - -CMake Warning \(dev\) at CMP0076-WARN/CMakeLists\.txt:[0-9]+ \(target_sources\): - Policy CMP0076 is not set: target_sources\(\) command converts relative paths - to absolute. Run "cmake --help-policy CMP0076" for policy details. Use - the cmake_policy command to set the policy and suppress this warning. - - A private source from a directory other than that of target "publiclib" has - a relative path. -This warning is for project developers. Use -Wno-dev to suppress it. - -CMake Error in CMakeLists.txt: - Target "publiclib" contains relative path in its INTERFACE_SOURCES: - - "CMP0076-WARN/subdir_empty_1.cpp" diff --git a/Tests/RunCMake/TargetSources/CMP0076-WARN.cmake b/Tests/RunCMake/TargetSources/CMP0076-WARN.cmake deleted file mode 100644 index 2e07331..0000000 --- a/Tests/RunCMake/TargetSources/CMP0076-WARN.cmake +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.12) - -add_library(publiclib) - -add_subdirectory(CMP0076-WARN) - -add_executable(main main.cpp) -target_link_libraries(main publiclib) diff --git a/Tests/RunCMake/TargetSources/CMP0076-WARN/CMakeLists.txt b/Tests/RunCMake/TargetSources/CMP0076-WARN/CMakeLists.txt deleted file mode 100644 index f9c7d6d..0000000 --- a/Tests/RunCMake/TargetSources/CMP0076-WARN/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ - -target_sources(publiclib INTERFACE CMP0076-WARN/subdir_empty_1.cpp - PRIVATE empty_1.cpp) diff --git a/Tests/RunCMake/TargetSources/CMP0076-WARN/subdir_empty_1.cpp b/Tests/RunCMake/TargetSources/CMP0076-WARN/subdir_empty_1.cpp deleted file mode 100644 index 11ec041..0000000 --- a/Tests/RunCMake/TargetSources/CMP0076-WARN/subdir_empty_1.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#ifdef _WIN32 -__declspec(dllexport) -#endif - int empty() -{ - return 0; -} diff --git a/Tests/RunCMake/TargetSources/CMakeLists.txt b/Tests/RunCMake/TargetSources/CMakeLists.txt deleted file mode 100644 index a06591c..0000000 --- a/Tests/RunCMake/TargetSources/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(${RunCMake_TEST} CXX) -include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/TargetSources/ConfigNotAllowed-result.txt b/Tests/RunCMake/TargetSources/ConfigNotAllowed-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/TargetSources/ConfigNotAllowed-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/TargetSources/ConfigNotAllowed-stderr.txt b/Tests/RunCMake/TargetSources/ConfigNotAllowed-stderr.txt deleted file mode 100644 index c6b75fc..0000000 --- a/Tests/RunCMake/TargetSources/ConfigNotAllowed-stderr.txt +++ /dev/null @@ -1,12 +0,0 @@ -CMake Error in CMakeLists.txt: - Target "somelib" has source files which vary by configuration. This is not - supported by the "[^"]+" generator. - - Config "Debug": - - .*/Tests/RunCMake/TargetSources/empty_1.cpp - .*/Tests/RunCMake/TargetSources/empty_2.cpp - - Config "Release": - - .*/Tests/RunCMake/TargetSources/empty_1.cpp diff --git a/Tests/RunCMake/TargetSources/ConfigNotAllowed.cmake b/Tests/RunCMake/TargetSources/ConfigNotAllowed.cmake deleted file mode 100644 index 02af379..0000000 --- a/Tests/RunCMake/TargetSources/ConfigNotAllowed.cmake +++ /dev/null @@ -1,2 +0,0 @@ - -add_library(somelib empty_1.cpp $<$:empty_2.cpp>) diff --git a/Tests/RunCMake/TargetSources/ExportBuild-result.txt b/Tests/RunCMake/TargetSources/ExportBuild-result.txt deleted file mode 100644 index 573541a..0000000 --- a/Tests/RunCMake/TargetSources/ExportBuild-result.txt +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/Tests/RunCMake/TargetSources/ExportBuild.cmake b/Tests/RunCMake/TargetSources/ExportBuild.cmake deleted file mode 100644 index b626aa6..0000000 --- a/Tests/RunCMake/TargetSources/ExportBuild.cmake +++ /dev/null @@ -1,5 +0,0 @@ - -add_library(iface INTERFACE) -target_sources(iface INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/empty_1.cpp") - -export(TARGETS iface FILE ${CMAKE_CURRENT_BINARY_DIR}/targets.cmake) diff --git a/Tests/RunCMake/TargetSources/OriginDebug-result.txt b/Tests/RunCMake/TargetSources/OriginDebug-result.txt deleted file mode 100644 index 573541a..0000000 --- a/Tests/RunCMake/TargetSources/OriginDebug-result.txt +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/Tests/RunCMake/TargetSources/OriginDebug-stderr.txt b/Tests/RunCMake/TargetSources/OriginDebug-stderr.txt deleted file mode 100644 index a40f463..0000000 --- a/Tests/RunCMake/TargetSources/OriginDebug-stderr.txt +++ /dev/null @@ -1,31 +0,0 @@ -CMake Debug Log at OriginDebug.cmake:13 \(add_library\): - Used sources for target OriginDebug: - - \* .*Tests/RunCMake/TargetSources/empty_2.cpp - -Call Stack \(most recent call first\): - CMakeLists\.txt:[0-9]+ \(include\) -.* -CMake Debug Log at OriginDebug.cmake:16 \(set_property\): - Used sources for target OriginDebug: - - \* .*Tests/RunCMake/TargetSources/empty_3.cpp - -Call Stack \(most recent call first\): - CMakeLists\.txt:[0-9]+ \(include\) -.* -CMake Debug Log at OriginDebug.cmake:20 \(target_sources\): - Used sources for target OriginDebug: - - \* .*Tests/RunCMake/TargetSources/empty_4.cpp - -Call Stack \(most recent call first\): - CMakeLists\.txt:[0-9]+ \(include\) -.* -CMake Debug Log at OriginDebug.cmake:14 \(target_link_libraries\): - Used sources for target OriginDebug: - - \* .*Tests/RunCMake/TargetSources/empty_1.cpp - -Call Stack \(most recent call first\): - CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/TargetSources/OriginDebug.cmake b/Tests/RunCMake/TargetSources/OriginDebug.cmake deleted file mode 100644 index d40a1d8..0000000 --- a/Tests/RunCMake/TargetSources/OriginDebug.cmake +++ /dev/null @@ -1,20 +0,0 @@ - -cmake_minimum_required(VERSION 3.0) - -project(OriginDebug) - -set(CMAKE_DEBUG_TARGET_PROPERTIES SOURCES) - -add_library(iface INTERFACE) -set_property(TARGET iface PROPERTY INTERFACE_SOURCES - "${CMAKE_CURRENT_SOURCE_DIR}/empty_1.cpp" -) - -add_library(OriginDebug empty_2.cpp) -target_link_libraries(OriginDebug iface) - -set_property(TARGET OriginDebug APPEND PROPERTY SOURCES - empty_3.cpp -) - -target_sources(OriginDebug PRIVATE empty_4.cpp) diff --git a/Tests/RunCMake/TargetSources/RelativePathInInterface-stdout.txt b/Tests/RunCMake/TargetSources/RelativePathInInterface-stdout.txt deleted file mode 100644 index 4581d8a..0000000 --- a/Tests/RunCMake/TargetSources/RelativePathInInterface-stdout.txt +++ /dev/null @@ -1 +0,0 @@ --- iface: .*Tests/RunCMake/TargetSources/empty_1.cpp diff --git a/Tests/RunCMake/TargetSources/RelativePathInInterface.cmake b/Tests/RunCMake/TargetSources/RelativePathInInterface.cmake deleted file mode 100644 index 0d3e9a4..0000000 --- a/Tests/RunCMake/TargetSources/RelativePathInInterface.cmake +++ /dev/null @@ -1,10 +0,0 @@ -cmake_policy(SET CMP0076 NEW) - -add_library(iface INTERFACE) -target_sources(iface INTERFACE empty_1.cpp) - -get_property(iface_sources TARGET iface PROPERTY INTERFACE_SOURCES) -message(STATUS "iface: ${iface_sources}") - -add_executable(main main.cpp) -target_link_libraries(main iface) diff --git a/Tests/RunCMake/TargetSources/RelativePathInSubdirGenEx-stdout.txt b/Tests/RunCMake/TargetSources/RelativePathInSubdirGenEx-stdout.txt deleted file mode 100644 index 7f48082..0000000 --- a/Tests/RunCMake/TargetSources/RelativePathInSubdirGenEx-stdout.txt +++ /dev/null @@ -1 +0,0 @@ --- genexlib: \$<1:.*Tests/RunCMake/TargetSources/RelativePathInSubdirGenEx/subdir_empty_1.cpp>;\$<1:.*Tests/RunCMake/TargetSources/RelativePathInSubdirGenEx/../empty_1.cpp>;\$<1:empty_2.cpp> diff --git a/Tests/RunCMake/TargetSources/RelativePathInSubdirGenEx.cmake b/Tests/RunCMake/TargetSources/RelativePathInSubdirGenEx.cmake deleted file mode 100644 index 1cdc2a7..0000000 --- a/Tests/RunCMake/TargetSources/RelativePathInSubdirGenEx.cmake +++ /dev/null @@ -1,10 +0,0 @@ -cmake_policy(SET CMP0076 NEW) - -add_library(genexlib) -add_subdirectory(RelativePathInSubdirGenEx) - -get_property(genexlib_sources TARGET genexlib PROPERTY SOURCES) -message(STATUS "genexlib: ${genexlib_sources}") - -add_executable(genexmain main.cpp) -target_link_libraries(genexmain genexlib) diff --git a/Tests/RunCMake/TargetSources/RelativePathInSubdirGenEx/CMakeLists.txt b/Tests/RunCMake/TargetSources/RelativePathInSubdirGenEx/CMakeLists.txt deleted file mode 100644 index 3bcf454..0000000 --- a/Tests/RunCMake/TargetSources/RelativePathInSubdirGenEx/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ - -target_sources(genexlib PUBLIC $<1:${CMAKE_CURRENT_LIST_DIR}/subdir_empty_1.cpp> - $<1:${CMAKE_CURRENT_LIST_DIR}/../empty_1.cpp> - PRIVATE $<1:empty_2.cpp>) diff --git a/Tests/RunCMake/TargetSources/RelativePathInSubdirGenEx/subdir_empty_1.cpp b/Tests/RunCMake/TargetSources/RelativePathInSubdirGenEx/subdir_empty_1.cpp deleted file mode 100644 index 11ec041..0000000 --- a/Tests/RunCMake/TargetSources/RelativePathInSubdirGenEx/subdir_empty_1.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#ifdef _WIN32 -__declspec(dllexport) -#endif - int empty() -{ - return 0; -} diff --git a/Tests/RunCMake/TargetSources/RelativePathInSubdirInclude-stdout.txt b/Tests/RunCMake/TargetSources/RelativePathInSubdirInclude-stdout.txt deleted file mode 100644 index aa4851f..0000000 --- a/Tests/RunCMake/TargetSources/RelativePathInSubdirInclude-stdout.txt +++ /dev/null @@ -1 +0,0 @@ --- privatelib: .*Tests/RunCMake/TargetSources/RelativePathInSubdirInclude/subdir_empty_1.cpp;empty_1.cpp diff --git a/Tests/RunCMake/TargetSources/RelativePathInSubdirInclude.cmake b/Tests/RunCMake/TargetSources/RelativePathInSubdirInclude.cmake deleted file mode 100644 index 4acbeca..0000000 --- a/Tests/RunCMake/TargetSources/RelativePathInSubdirInclude.cmake +++ /dev/null @@ -1,8 +0,0 @@ -cmake_policy(SET CMP0076 NEW) - -add_library(privatelib) - -include("RelativePathInSubdirInclude/CMakeLists.txt") - -get_property(privatelib_sources TARGET privatelib PROPERTY SOURCES) -message(STATUS "privatelib: ${privatelib_sources}") diff --git a/Tests/RunCMake/TargetSources/RelativePathInSubdirInclude/CMakeLists.txt b/Tests/RunCMake/TargetSources/RelativePathInSubdirInclude/CMakeLists.txt deleted file mode 100644 index 3dcb135..0000000 --- a/Tests/RunCMake/TargetSources/RelativePathInSubdirInclude/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ - -target_sources(privatelib PRIVATE "${CMAKE_CURRENT_LIST_DIR}/subdir_empty_1.cpp" - empty_1.cpp) diff --git a/Tests/RunCMake/TargetSources/RelativePathInSubdirInclude/subdir_empty_1.cpp b/Tests/RunCMake/TargetSources/RelativePathInSubdirInclude/subdir_empty_1.cpp deleted file mode 100644 index 11ec041..0000000 --- a/Tests/RunCMake/TargetSources/RelativePathInSubdirInclude/subdir_empty_1.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#ifdef _WIN32 -__declspec(dllexport) -#endif - int empty() -{ - return 0; -} diff --git a/Tests/RunCMake/TargetSources/RelativePathInSubdirInterface-stdout.txt b/Tests/RunCMake/TargetSources/RelativePathInSubdirInterface-stdout.txt deleted file mode 100644 index 5990a05..0000000 --- a/Tests/RunCMake/TargetSources/RelativePathInSubdirInterface-stdout.txt +++ /dev/null @@ -1 +0,0 @@ --- iface: .*Tests/RunCMake/TargetSources/RelativePathInSubdirInterface/subdir_empty_1.cpp;.*Tests/RunCMake/TargetSources/RelativePathInSubdirInterface/subdir_empty_2.cpp;.*Tests/RunCMake/TargetSources/RelativePathInSubdirInterface/../empty_1.cpp;.*Tests/RunCMake/TargetSources/RelativePathInSubdirInterface/../empty_2.cpp diff --git a/Tests/RunCMake/TargetSources/RelativePathInSubdirInterface.cmake b/Tests/RunCMake/TargetSources/RelativePathInSubdirInterface.cmake deleted file mode 100644 index 3652b4f..0000000 --- a/Tests/RunCMake/TargetSources/RelativePathInSubdirInterface.cmake +++ /dev/null @@ -1,11 +0,0 @@ -cmake_policy(SET CMP0076 NEW) - -add_library(iface INTERFACE) - -add_subdirectory(RelativePathInSubdirInterface) - -get_property(iface_sources TARGET iface PROPERTY INTERFACE_SOURCES) -message(STATUS "iface: ${iface_sources}") - -add_executable(main main.cpp) -target_link_libraries(main iface) diff --git a/Tests/RunCMake/TargetSources/RelativePathInSubdirInterface/CMakeLists.txt b/Tests/RunCMake/TargetSources/RelativePathInSubdirInterface/CMakeLists.txt deleted file mode 100644 index 02e6966..0000000 --- a/Tests/RunCMake/TargetSources/RelativePathInSubdirInterface/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ - -target_sources(iface INTERFACE subdir_empty_1.cpp - "${CMAKE_CURRENT_LIST_DIR}/subdir_empty_2.cpp" - ../empty_1.cpp - "${CMAKE_CURRENT_LIST_DIR}/../empty_2.cpp") diff --git a/Tests/RunCMake/TargetSources/RelativePathInSubdirInterface/subdir_empty_1.cpp b/Tests/RunCMake/TargetSources/RelativePathInSubdirInterface/subdir_empty_1.cpp deleted file mode 100644 index 11ec041..0000000 --- a/Tests/RunCMake/TargetSources/RelativePathInSubdirInterface/subdir_empty_1.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#ifdef _WIN32 -__declspec(dllexport) -#endif - int empty() -{ - return 0; -} diff --git a/Tests/RunCMake/TargetSources/RelativePathInSubdirInterface/subdir_empty_2.cpp b/Tests/RunCMake/TargetSources/RelativePathInSubdirInterface/subdir_empty_2.cpp deleted file mode 100644 index 11ec041..0000000 --- a/Tests/RunCMake/TargetSources/RelativePathInSubdirInterface/subdir_empty_2.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#ifdef _WIN32 -__declspec(dllexport) -#endif - int empty() -{ - return 0; -} diff --git a/Tests/RunCMake/TargetSources/RelativePathInSubdirPrivate-stdout.txt b/Tests/RunCMake/TargetSources/RelativePathInSubdirPrivate-stdout.txt deleted file mode 100644 index fa5bcbf..0000000 --- a/Tests/RunCMake/TargetSources/RelativePathInSubdirPrivate-stdout.txt +++ /dev/null @@ -1 +0,0 @@ --- privatelib: .*Tests/RunCMake/TargetSources/RelativePathInSubdirPrivate/subdir_empty_1.cpp;.*Tests/RunCMake/TargetSources/RelativePathInSubdirPrivate/subdir_empty_2.cpp;.*Tests/RunCMake/TargetSources/RelativePathInSubdirPrivate/../empty_1.cpp;.*Tests/RunCMake/TargetSources/RelativePathInSubdirPrivate/../empty_2.cpp diff --git a/Tests/RunCMake/TargetSources/RelativePathInSubdirPrivate.cmake b/Tests/RunCMake/TargetSources/RelativePathInSubdirPrivate.cmake deleted file mode 100644 index d0d3dc4..0000000 --- a/Tests/RunCMake/TargetSources/RelativePathInSubdirPrivate.cmake +++ /dev/null @@ -1,8 +0,0 @@ -cmake_policy(SET CMP0076 NEW) - -add_library(privatelib) - -add_subdirectory(RelativePathInSubdirPrivate) - -get_property(privatelib_sources TARGET privatelib PROPERTY SOURCES) -message(STATUS "privatelib: ${privatelib_sources}") diff --git a/Tests/RunCMake/TargetSources/RelativePathInSubdirPrivate/CMakeLists.txt b/Tests/RunCMake/TargetSources/RelativePathInSubdirPrivate/CMakeLists.txt deleted file mode 100644 index 56ee853..0000000 --- a/Tests/RunCMake/TargetSources/RelativePathInSubdirPrivate/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ - -target_sources(privatelib PRIVATE subdir_empty_1.cpp - "${CMAKE_CURRENT_LIST_DIR}/subdir_empty_2.cpp" - ../empty_1.cpp - "${CMAKE_CURRENT_LIST_DIR}/../empty_2.cpp") diff --git a/Tests/RunCMake/TargetSources/RelativePathInSubdirPrivate/subdir_empty_1.cpp b/Tests/RunCMake/TargetSources/RelativePathInSubdirPrivate/subdir_empty_1.cpp deleted file mode 100644 index 11ec041..0000000 --- a/Tests/RunCMake/TargetSources/RelativePathInSubdirPrivate/subdir_empty_1.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#ifdef _WIN32 -__declspec(dllexport) -#endif - int empty() -{ - return 0; -} diff --git a/Tests/RunCMake/TargetSources/RelativePathInSubdirPrivate/subdir_empty_2.cpp b/Tests/RunCMake/TargetSources/RelativePathInSubdirPrivate/subdir_empty_2.cpp deleted file mode 100644 index 11ec041..0000000 --- a/Tests/RunCMake/TargetSources/RelativePathInSubdirPrivate/subdir_empty_2.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#ifdef _WIN32 -__declspec(dllexport) -#endif - int empty() -{ - return 0; -} diff --git a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake deleted file mode 100644 index b56ee44..0000000 --- a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake +++ /dev/null @@ -1,22 +0,0 @@ -include(RunCMake) - -if(RunCMake_GENERATOR STREQUAL "Xcode") - run_cmake(ConfigNotAllowed) -endif() - -run_cmake(OriginDebug) -run_cmake(CMP0026-LOCATION) -run_cmake(CMP0076-OLD) -run_cmake(CMP0076-WARN) -run_cmake(RelativePathInInterface) -run_cmake(RelativePathInSubdirGenEx) -run_cmake(RelativePathInSubdirInterface) -run_cmake(RelativePathInSubdirPrivate) -run_cmake(RelativePathInSubdirInclude) -run_cmake(ExportBuild) -run_cmake(AddCustomTargetPublicSources) -run_cmake(AddCustomTargetPrivateSources) -run_cmake(AddCustomTargetInterfaceSources) -run_cmake(AddCustomTargetSources) -run_cmake(AddCustomTargetCheckProperty) -run_cmake(AddCustomTargetGenx) diff --git a/Tests/RunCMake/TargetSources/empty_1.cpp b/Tests/RunCMake/TargetSources/empty_1.cpp deleted file mode 100644 index 11ec041..0000000 --- a/Tests/RunCMake/TargetSources/empty_1.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#ifdef _WIN32 -__declspec(dllexport) -#endif - int empty() -{ - return 0; -} diff --git a/Tests/RunCMake/TargetSources/empty_2.cpp b/Tests/RunCMake/TargetSources/empty_2.cpp deleted file mode 100644 index 11ec041..0000000 --- a/Tests/RunCMake/TargetSources/empty_2.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#ifdef _WIN32 -__declspec(dllexport) -#endif - int empty() -{ - return 0; -} diff --git a/Tests/RunCMake/TargetSources/empty_3.cpp b/Tests/RunCMake/TargetSources/empty_3.cpp deleted file mode 100644 index 11ec041..0000000 --- a/Tests/RunCMake/TargetSources/empty_3.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#ifdef _WIN32 -__declspec(dllexport) -#endif - int empty() -{ - return 0; -} diff --git a/Tests/RunCMake/TargetSources/empty_4.cpp b/Tests/RunCMake/TargetSources/empty_4.cpp deleted file mode 100644 index 11ec041..0000000 --- a/Tests/RunCMake/TargetSources/empty_4.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#ifdef _WIN32 -__declspec(dllexport) -#endif - int empty() -{ - return 0; -} diff --git a/Tests/RunCMake/TargetSources/main.cpp b/Tests/RunCMake/TargetSources/main.cpp deleted file mode 100644 index 766b775..0000000 --- a/Tests/RunCMake/TargetSources/main.cpp +++ /dev/null @@ -1,5 +0,0 @@ - -int main() -{ - return 0; -} diff --git a/Tests/RunCMake/target_sources/AddCustomTargetCheckProperty.cmake b/Tests/RunCMake/target_sources/AddCustomTargetCheckProperty.cmake new file mode 100644 index 0000000..1787e87 --- /dev/null +++ b/Tests/RunCMake/target_sources/AddCustomTargetCheckProperty.cmake @@ -0,0 +1,16 @@ +add_custom_target(target1 ALL) +target_sources(target1 PRIVATE main.cpp) +get_property(actualProp1 TARGET target1 PROPERTY SOURCES) +set(desiredProp1 main.cpp) +if(NOT desiredProp1 STREQUAL actualProp1) + message("source property not set. desired: \"${desiredProp1}\" actual: \"${actualProp1}\"") +endif() + +add_custom_target(target2 ALL SOURCES main.cpp) +target_sources(target2 PRIVATE empty_1.cpp empty_2.cpp) +target_sources(target2 PRIVATE empty_3.cpp) +get_property(actualProp2 TARGET target2 PROPERTY SOURCES) +set(desiredProp2 main.cpp empty_1.cpp empty_2.cpp empty_3.cpp) +if (NOT desiredProp2 STREQUAL actualProp2) + message("source property not set. desired: \"${desiredProp2}\" actual: \"${actualProp2}\"") +endif() diff --git a/Tests/RunCMake/target_sources/AddCustomTargetGenx.cmake b/Tests/RunCMake/target_sources/AddCustomTargetGenx.cmake new file mode 100644 index 0000000..0078eab --- /dev/null +++ b/Tests/RunCMake/target_sources/AddCustomTargetGenx.cmake @@ -0,0 +1,2 @@ +add_custom_target(target ALL) +target_sources(target PRIVATE $) diff --git a/Tests/RunCMake/target_sources/AddCustomTargetInterfaceSources-result.txt b/Tests/RunCMake/target_sources/AddCustomTargetInterfaceSources-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/target_sources/AddCustomTargetInterfaceSources-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/target_sources/AddCustomTargetInterfaceSources-stderr.txt b/Tests/RunCMake/target_sources/AddCustomTargetInterfaceSources-stderr.txt new file mode 100644 index 0000000..9334bf6 --- /dev/null +++ b/Tests/RunCMake/target_sources/AddCustomTargetInterfaceSources-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at AddCustomTargetInterfaceSources.cmake:2 \(target_sources\): + target_sources may only set PRIVATE properties on custom targets +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/target_sources/AddCustomTargetInterfaceSources.cmake b/Tests/RunCMake/target_sources/AddCustomTargetInterfaceSources.cmake new file mode 100644 index 0000000..42a8ca2 --- /dev/null +++ b/Tests/RunCMake/target_sources/AddCustomTargetInterfaceSources.cmake @@ -0,0 +1,2 @@ +add_custom_target(target ALL) +target_sources(target INTERFACE main.cpp) diff --git a/Tests/RunCMake/target_sources/AddCustomTargetPrivateSources.cmake b/Tests/RunCMake/target_sources/AddCustomTargetPrivateSources.cmake new file mode 100644 index 0000000..11f0258 --- /dev/null +++ b/Tests/RunCMake/target_sources/AddCustomTargetPrivateSources.cmake @@ -0,0 +1,2 @@ +add_custom_target(target ALL) +target_sources(target PRIVATE main.cpp) diff --git a/Tests/RunCMake/target_sources/AddCustomTargetPublicSources-result.txt b/Tests/RunCMake/target_sources/AddCustomTargetPublicSources-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/target_sources/AddCustomTargetPublicSources-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/target_sources/AddCustomTargetPublicSources-stderr.txt b/Tests/RunCMake/target_sources/AddCustomTargetPublicSources-stderr.txt new file mode 100644 index 0000000..afba4be --- /dev/null +++ b/Tests/RunCMake/target_sources/AddCustomTargetPublicSources-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at AddCustomTargetPublicSources.cmake:2 \(target_sources\): + target_sources may only set PRIVATE properties on custom targets +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/target_sources/AddCustomTargetPublicSources.cmake b/Tests/RunCMake/target_sources/AddCustomTargetPublicSources.cmake new file mode 100644 index 0000000..d9e82c0 --- /dev/null +++ b/Tests/RunCMake/target_sources/AddCustomTargetPublicSources.cmake @@ -0,0 +1,2 @@ +add_custom_target(target ALL) +target_sources(target PUBLIC main.cpp) diff --git a/Tests/RunCMake/target_sources/AddCustomTargetSources-result.txt b/Tests/RunCMake/target_sources/AddCustomTargetSources-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/target_sources/AddCustomTargetSources-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/target_sources/AddCustomTargetSources-stderr.txt b/Tests/RunCMake/target_sources/AddCustomTargetSources-stderr.txt new file mode 100644 index 0000000..4a153e9 --- /dev/null +++ b/Tests/RunCMake/target_sources/AddCustomTargetSources-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at AddCustomTargetSources.cmake:2 \(target_sources\): + target_sources called with invalid arguments +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/target_sources/AddCustomTargetSources.cmake b/Tests/RunCMake/target_sources/AddCustomTargetSources.cmake new file mode 100644 index 0000000..dd688d3 --- /dev/null +++ b/Tests/RunCMake/target_sources/AddCustomTargetSources.cmake @@ -0,0 +1,2 @@ +add_custom_target(target ALL) +target_sources(target main.cpp) diff --git a/Tests/RunCMake/target_sources/CMP0026-LOCATION-result.txt b/Tests/RunCMake/target_sources/CMP0026-LOCATION-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/target_sources/CMP0026-LOCATION-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/target_sources/CMP0026-LOCATION-stderr.txt b/Tests/RunCMake/target_sources/CMP0026-LOCATION-stderr.txt new file mode 100644 index 0000000..d7ccedb --- /dev/null +++ b/Tests/RunCMake/target_sources/CMP0026-LOCATION-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0026-LOCATION.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0026 will be removed from a future version + of CMake. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/target_sources/CMP0026-LOCATION.cmake b/Tests/RunCMake/target_sources/CMP0026-LOCATION.cmake new file mode 100644 index 0000000..642856c --- /dev/null +++ b/Tests/RunCMake/target_sources/CMP0026-LOCATION.cmake @@ -0,0 +1,14 @@ + +cmake_policy(SET CMP0026 OLD) +enable_language(CXX) + +add_library(objlib OBJECT + empty_1.cpp +) + +add_executable(my_exe + empty_2.cpp + $ +) + +get_target_property( loc my_exe LOCATION) diff --git a/Tests/RunCMake/target_sources/CMP0076-OLD-result.txt b/Tests/RunCMake/target_sources/CMP0076-OLD-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/target_sources/CMP0076-OLD-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/target_sources/CMP0076-OLD-stderr.txt b/Tests/RunCMake/target_sources/CMP0076-OLD-stderr.txt new file mode 100644 index 0000000..d47dd4d --- /dev/null +++ b/Tests/RunCMake/target_sources/CMP0076-OLD-stderr.txt @@ -0,0 +1,4 @@ +CMake Error in CMakeLists.txt: + Target "iface" contains relative path in its INTERFACE_SOURCES: + + "empty_1.cpp" diff --git a/Tests/RunCMake/target_sources/CMP0076-OLD.cmake b/Tests/RunCMake/target_sources/CMP0076-OLD.cmake new file mode 100644 index 0000000..4d8c268 --- /dev/null +++ b/Tests/RunCMake/target_sources/CMP0076-OLD.cmake @@ -0,0 +1,10 @@ +cmake_policy(SET CMP0076 OLD) + +add_library(iface INTERFACE) +target_sources(iface INTERFACE empty_1.cpp) + +get_property(iface_sources TARGET iface PROPERTY INTERFACE_SOURCES) +message(STATUS "iface: ${iface_sources}") + +add_executable(main main.cpp) +target_link_libraries(main iface) diff --git a/Tests/RunCMake/target_sources/CMP0076-WARN-result.txt b/Tests/RunCMake/target_sources/CMP0076-WARN-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/target_sources/CMP0076-WARN-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/target_sources/CMP0076-WARN-stderr.txt b/Tests/RunCMake/target_sources/CMP0076-WARN-stderr.txt new file mode 100644 index 0000000..bd888ee --- /dev/null +++ b/Tests/RunCMake/target_sources/CMP0076-WARN-stderr.txt @@ -0,0 +1,21 @@ +CMake Warning \(dev\) at CMP0076-WARN/CMakeLists\.txt:[0-9]+ \(target_sources\): + Policy CMP0076 is not set: target_sources\(\) command converts relative paths + to absolute. Run "cmake --help-policy CMP0076" for policy details. Use + the cmake_policy command to set the policy and suppress this warning. + + An interface source of target "publiclib" has a relative path. +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Warning \(dev\) at CMP0076-WARN/CMakeLists\.txt:[0-9]+ \(target_sources\): + Policy CMP0076 is not set: target_sources\(\) command converts relative paths + to absolute. Run "cmake --help-policy CMP0076" for policy details. Use + the cmake_policy command to set the policy and suppress this warning. + + A private source from a directory other than that of target "publiclib" has + a relative path. +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Error in CMakeLists.txt: + Target "publiclib" contains relative path in its INTERFACE_SOURCES: + + "CMP0076-WARN/subdir_empty_1.cpp" diff --git a/Tests/RunCMake/target_sources/CMP0076-WARN.cmake b/Tests/RunCMake/target_sources/CMP0076-WARN.cmake new file mode 100644 index 0000000..2e07331 --- /dev/null +++ b/Tests/RunCMake/target_sources/CMP0076-WARN.cmake @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.12) + +add_library(publiclib) + +add_subdirectory(CMP0076-WARN) + +add_executable(main main.cpp) +target_link_libraries(main publiclib) diff --git a/Tests/RunCMake/target_sources/CMP0076-WARN/CMakeLists.txt b/Tests/RunCMake/target_sources/CMP0076-WARN/CMakeLists.txt new file mode 100644 index 0000000..f9c7d6d --- /dev/null +++ b/Tests/RunCMake/target_sources/CMP0076-WARN/CMakeLists.txt @@ -0,0 +1,3 @@ + +target_sources(publiclib INTERFACE CMP0076-WARN/subdir_empty_1.cpp + PRIVATE empty_1.cpp) diff --git a/Tests/RunCMake/target_sources/CMP0076-WARN/subdir_empty_1.cpp b/Tests/RunCMake/target_sources/CMP0076-WARN/subdir_empty_1.cpp new file mode 100644 index 0000000..11ec041 --- /dev/null +++ b/Tests/RunCMake/target_sources/CMP0076-WARN/subdir_empty_1.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif + int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/target_sources/CMakeLists.txt b/Tests/RunCMake/target_sources/CMakeLists.txt index 14ef56e..727f93a 100644 --- a/Tests/RunCMake/target_sources/CMakeLists.txt +++ b/Tests/RunCMake/target_sources/CMakeLists.txt @@ -1,5 +1,3 @@ cmake_minimum_required(VERSION 3.11) - project(${RunCMake_TEST} LANGUAGES NONE) - include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/target_sources/ConfigNotAllowed-result.txt b/Tests/RunCMake/target_sources/ConfigNotAllowed-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/target_sources/ConfigNotAllowed-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/target_sources/ConfigNotAllowed-stderr.txt b/Tests/RunCMake/target_sources/ConfigNotAllowed-stderr.txt new file mode 100644 index 0000000..bc4afb7 --- /dev/null +++ b/Tests/RunCMake/target_sources/ConfigNotAllowed-stderr.txt @@ -0,0 +1,12 @@ +CMake Error in CMakeLists.txt: + Target "somelib" has source files which vary by configuration. This is not + supported by the "[^"]+" generator. + + Config "Debug": + + .*/Tests/RunCMake/target_sources/empty_1.cpp + .*/Tests/RunCMake/target_sources/empty_2.cpp + + Config "Release": + + .*/Tests/RunCMake/target_sources/empty_1.cpp diff --git a/Tests/RunCMake/target_sources/ConfigNotAllowed.cmake b/Tests/RunCMake/target_sources/ConfigNotAllowed.cmake new file mode 100644 index 0000000..02af379 --- /dev/null +++ b/Tests/RunCMake/target_sources/ConfigNotAllowed.cmake @@ -0,0 +1,2 @@ + +add_library(somelib empty_1.cpp $<$:empty_2.cpp>) diff --git a/Tests/RunCMake/target_sources/EmptyKeywordArgs.cmake b/Tests/RunCMake/target_sources/EmptyKeywordArgs.cmake new file mode 100644 index 0000000..5cee451 --- /dev/null +++ b/Tests/RunCMake/target_sources/EmptyKeywordArgs.cmake @@ -0,0 +1,5 @@ +add_library(iface INTERFACE) +target_sources(iface PUBLIC PRIVATE INTERFACE) +# Cannot be called with non-compilable targets. +#add_library(imported UNKNOWN IMPORTED) +#target_sources(imported PUBLIC PRIVATE INTERFACE) diff --git a/Tests/RunCMake/target_sources/ExportBuild-result.txt b/Tests/RunCMake/target_sources/ExportBuild-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/target_sources/ExportBuild-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/target_sources/ExportBuild.cmake b/Tests/RunCMake/target_sources/ExportBuild.cmake new file mode 100644 index 0000000..b626aa6 --- /dev/null +++ b/Tests/RunCMake/target_sources/ExportBuild.cmake @@ -0,0 +1,5 @@ + +add_library(iface INTERFACE) +target_sources(iface INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/empty_1.cpp") + +export(TARGETS iface FILE ${CMAKE_CURRENT_BINARY_DIR}/targets.cmake) diff --git a/Tests/RunCMake/target_sources/OriginDebug-result.txt b/Tests/RunCMake/target_sources/OriginDebug-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/target_sources/OriginDebug-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/target_sources/OriginDebug-stderr.txt b/Tests/RunCMake/target_sources/OriginDebug-stderr.txt new file mode 100644 index 0000000..502d5f1 --- /dev/null +++ b/Tests/RunCMake/target_sources/OriginDebug-stderr.txt @@ -0,0 +1,31 @@ +CMake Debug Log at OriginDebug.cmake:13 \(add_library\): + Used sources for target OriginDebug: + + \* .*Tests/RunCMake/target_sources/empty_2.cpp + +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) +.* +CMake Debug Log at OriginDebug.cmake:16 \(set_property\): + Used sources for target OriginDebug: + + \* .*Tests/RunCMake/target_sources/empty_3.cpp + +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) +.* +CMake Debug Log at OriginDebug.cmake:20 \(target_sources\): + Used sources for target OriginDebug: + + \* .*Tests/RunCMake/target_sources/empty_4.cpp + +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) +.* +CMake Debug Log at OriginDebug.cmake:14 \(target_link_libraries\): + Used sources for target OriginDebug: + + \* .*Tests/RunCMake/target_sources/empty_1.cpp + +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/target_sources/OriginDebug.cmake b/Tests/RunCMake/target_sources/OriginDebug.cmake new file mode 100644 index 0000000..d40a1d8 --- /dev/null +++ b/Tests/RunCMake/target_sources/OriginDebug.cmake @@ -0,0 +1,20 @@ + +cmake_minimum_required(VERSION 3.0) + +project(OriginDebug) + +set(CMAKE_DEBUG_TARGET_PROPERTIES SOURCES) + +add_library(iface INTERFACE) +set_property(TARGET iface PROPERTY INTERFACE_SOURCES + "${CMAKE_CURRENT_SOURCE_DIR}/empty_1.cpp" +) + +add_library(OriginDebug empty_2.cpp) +target_link_libraries(OriginDebug iface) + +set_property(TARGET OriginDebug APPEND PROPERTY SOURCES + empty_3.cpp +) + +target_sources(OriginDebug PRIVATE empty_4.cpp) diff --git a/Tests/RunCMake/target_sources/RelativePathInInterface-stdout.txt b/Tests/RunCMake/target_sources/RelativePathInInterface-stdout.txt new file mode 100644 index 0000000..19818b8 --- /dev/null +++ b/Tests/RunCMake/target_sources/RelativePathInInterface-stdout.txt @@ -0,0 +1 @@ +-- iface: .*Tests/RunCMake/target_sources/empty_1.cpp diff --git a/Tests/RunCMake/target_sources/RelativePathInInterface.cmake b/Tests/RunCMake/target_sources/RelativePathInInterface.cmake new file mode 100644 index 0000000..25b22dd --- /dev/null +++ b/Tests/RunCMake/target_sources/RelativePathInInterface.cmake @@ -0,0 +1,11 @@ +cmake_policy(SET CMP0076 NEW) +enable_language(CXX) + +add_library(iface INTERFACE) +target_sources(iface INTERFACE empty_1.cpp) + +get_property(iface_sources TARGET iface PROPERTY INTERFACE_SOURCES) +message(STATUS "iface: ${iface_sources}") + +add_executable(main main.cpp) +target_link_libraries(main iface) diff --git a/Tests/RunCMake/target_sources/RelativePathInSubdirGenEx-stdout.txt b/Tests/RunCMake/target_sources/RelativePathInSubdirGenEx-stdout.txt new file mode 100644 index 0000000..a51a792 --- /dev/null +++ b/Tests/RunCMake/target_sources/RelativePathInSubdirGenEx-stdout.txt @@ -0,0 +1 @@ +-- genexlib: \$<1:.*Tests/RunCMake/target_sources/RelativePathInSubdirGenEx/subdir_empty_1.cpp>;\$<1:.*Tests/RunCMake/target_sources/RelativePathInSubdirGenEx/../empty_1.cpp>;\$<1:empty_2.cpp> diff --git a/Tests/RunCMake/target_sources/RelativePathInSubdirGenEx.cmake b/Tests/RunCMake/target_sources/RelativePathInSubdirGenEx.cmake new file mode 100644 index 0000000..9afcea5 --- /dev/null +++ b/Tests/RunCMake/target_sources/RelativePathInSubdirGenEx.cmake @@ -0,0 +1,11 @@ +cmake_policy(SET CMP0076 NEW) +enable_language(CXX) + +add_library(genexlib) +add_subdirectory(RelativePathInSubdirGenEx) + +get_property(genexlib_sources TARGET genexlib PROPERTY SOURCES) +message(STATUS "genexlib: ${genexlib_sources}") + +add_executable(genexmain main.cpp) +target_link_libraries(genexmain genexlib) diff --git a/Tests/RunCMake/target_sources/RelativePathInSubdirGenEx/CMakeLists.txt b/Tests/RunCMake/target_sources/RelativePathInSubdirGenEx/CMakeLists.txt new file mode 100644 index 0000000..3bcf454 --- /dev/null +++ b/Tests/RunCMake/target_sources/RelativePathInSubdirGenEx/CMakeLists.txt @@ -0,0 +1,4 @@ + +target_sources(genexlib PUBLIC $<1:${CMAKE_CURRENT_LIST_DIR}/subdir_empty_1.cpp> + $<1:${CMAKE_CURRENT_LIST_DIR}/../empty_1.cpp> + PRIVATE $<1:empty_2.cpp>) diff --git a/Tests/RunCMake/target_sources/RelativePathInSubdirGenEx/subdir_empty_1.cpp b/Tests/RunCMake/target_sources/RelativePathInSubdirGenEx/subdir_empty_1.cpp new file mode 100644 index 0000000..11ec041 --- /dev/null +++ b/Tests/RunCMake/target_sources/RelativePathInSubdirGenEx/subdir_empty_1.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif + int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/target_sources/RelativePathInSubdirInclude-stdout.txt b/Tests/RunCMake/target_sources/RelativePathInSubdirInclude-stdout.txt new file mode 100644 index 0000000..c42c88b --- /dev/null +++ b/Tests/RunCMake/target_sources/RelativePathInSubdirInclude-stdout.txt @@ -0,0 +1 @@ +-- privatelib: .*Tests/RunCMake/target_sources/RelativePathInSubdirInclude/subdir_empty_1.cpp;empty_1.cpp diff --git a/Tests/RunCMake/target_sources/RelativePathInSubdirInclude.cmake b/Tests/RunCMake/target_sources/RelativePathInSubdirInclude.cmake new file mode 100644 index 0000000..f5954c4 --- /dev/null +++ b/Tests/RunCMake/target_sources/RelativePathInSubdirInclude.cmake @@ -0,0 +1,9 @@ +cmake_policy(SET CMP0076 NEW) +enable_language(CXX) + +add_library(privatelib) + +include("RelativePathInSubdirInclude/CMakeLists.txt") + +get_property(privatelib_sources TARGET privatelib PROPERTY SOURCES) +message(STATUS "privatelib: ${privatelib_sources}") diff --git a/Tests/RunCMake/target_sources/RelativePathInSubdirInclude/CMakeLists.txt b/Tests/RunCMake/target_sources/RelativePathInSubdirInclude/CMakeLists.txt new file mode 100644 index 0000000..3dcb135 --- /dev/null +++ b/Tests/RunCMake/target_sources/RelativePathInSubdirInclude/CMakeLists.txt @@ -0,0 +1,3 @@ + +target_sources(privatelib PRIVATE "${CMAKE_CURRENT_LIST_DIR}/subdir_empty_1.cpp" + empty_1.cpp) diff --git a/Tests/RunCMake/target_sources/RelativePathInSubdirInclude/subdir_empty_1.cpp b/Tests/RunCMake/target_sources/RelativePathInSubdirInclude/subdir_empty_1.cpp new file mode 100644 index 0000000..11ec041 --- /dev/null +++ b/Tests/RunCMake/target_sources/RelativePathInSubdirInclude/subdir_empty_1.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif + int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/target_sources/RelativePathInSubdirInterface-stdout.txt b/Tests/RunCMake/target_sources/RelativePathInSubdirInterface-stdout.txt new file mode 100644 index 0000000..ebbb29f --- /dev/null +++ b/Tests/RunCMake/target_sources/RelativePathInSubdirInterface-stdout.txt @@ -0,0 +1 @@ +-- iface: .*Tests/RunCMake/target_sources/RelativePathInSubdirInterface/subdir_empty_1.cpp;.*Tests/RunCMake/target_sources/RelativePathInSubdirInterface/subdir_empty_2.cpp;.*Tests/RunCMake/target_sources/RelativePathInSubdirInterface/../empty_1.cpp;.*Tests/RunCMake/target_sources/RelativePathInSubdirInterface/../empty_2.cpp diff --git a/Tests/RunCMake/target_sources/RelativePathInSubdirInterface.cmake b/Tests/RunCMake/target_sources/RelativePathInSubdirInterface.cmake new file mode 100644 index 0000000..6a4e200 --- /dev/null +++ b/Tests/RunCMake/target_sources/RelativePathInSubdirInterface.cmake @@ -0,0 +1,12 @@ +cmake_policy(SET CMP0076 NEW) +enable_language(CXX) + +add_library(iface INTERFACE) + +add_subdirectory(RelativePathInSubdirInterface) + +get_property(iface_sources TARGET iface PROPERTY INTERFACE_SOURCES) +message(STATUS "iface: ${iface_sources}") + +add_executable(main main.cpp) +target_link_libraries(main iface) diff --git a/Tests/RunCMake/target_sources/RelativePathInSubdirInterface/CMakeLists.txt b/Tests/RunCMake/target_sources/RelativePathInSubdirInterface/CMakeLists.txt new file mode 100644 index 0000000..02e6966 --- /dev/null +++ b/Tests/RunCMake/target_sources/RelativePathInSubdirInterface/CMakeLists.txt @@ -0,0 +1,5 @@ + +target_sources(iface INTERFACE subdir_empty_1.cpp + "${CMAKE_CURRENT_LIST_DIR}/subdir_empty_2.cpp" + ../empty_1.cpp + "${CMAKE_CURRENT_LIST_DIR}/../empty_2.cpp") diff --git a/Tests/RunCMake/target_sources/RelativePathInSubdirInterface/subdir_empty_1.cpp b/Tests/RunCMake/target_sources/RelativePathInSubdirInterface/subdir_empty_1.cpp new file mode 100644 index 0000000..11ec041 --- /dev/null +++ b/Tests/RunCMake/target_sources/RelativePathInSubdirInterface/subdir_empty_1.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif + int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/target_sources/RelativePathInSubdirInterface/subdir_empty_2.cpp b/Tests/RunCMake/target_sources/RelativePathInSubdirInterface/subdir_empty_2.cpp new file mode 100644 index 0000000..11ec041 --- /dev/null +++ b/Tests/RunCMake/target_sources/RelativePathInSubdirInterface/subdir_empty_2.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif + int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/target_sources/RelativePathInSubdirPrivate-stdout.txt b/Tests/RunCMake/target_sources/RelativePathInSubdirPrivate-stdout.txt new file mode 100644 index 0000000..104f1de --- /dev/null +++ b/Tests/RunCMake/target_sources/RelativePathInSubdirPrivate-stdout.txt @@ -0,0 +1 @@ +-- privatelib: .*Tests/RunCMake/target_sources/RelativePathInSubdirPrivate/subdir_empty_1.cpp;.*Tests/RunCMake/target_sources/RelativePathInSubdirPrivate/subdir_empty_2.cpp;.*Tests/RunCMake/target_sources/RelativePathInSubdirPrivate/../empty_1.cpp;.*Tests/RunCMake/target_sources/RelativePathInSubdirPrivate/../empty_2.cpp diff --git a/Tests/RunCMake/target_sources/RelativePathInSubdirPrivate.cmake b/Tests/RunCMake/target_sources/RelativePathInSubdirPrivate.cmake new file mode 100644 index 0000000..dd16e3f --- /dev/null +++ b/Tests/RunCMake/target_sources/RelativePathInSubdirPrivate.cmake @@ -0,0 +1,9 @@ +cmake_policy(SET CMP0076 NEW) +enable_language(CXX) + +add_library(privatelib) + +add_subdirectory(RelativePathInSubdirPrivate) + +get_property(privatelib_sources TARGET privatelib PROPERTY SOURCES) +message(STATUS "privatelib: ${privatelib_sources}") diff --git a/Tests/RunCMake/target_sources/RelativePathInSubdirPrivate/CMakeLists.txt b/Tests/RunCMake/target_sources/RelativePathInSubdirPrivate/CMakeLists.txt new file mode 100644 index 0000000..56ee853 --- /dev/null +++ b/Tests/RunCMake/target_sources/RelativePathInSubdirPrivate/CMakeLists.txt @@ -0,0 +1,5 @@ + +target_sources(privatelib PRIVATE subdir_empty_1.cpp + "${CMAKE_CURRENT_LIST_DIR}/subdir_empty_2.cpp" + ../empty_1.cpp + "${CMAKE_CURRENT_LIST_DIR}/../empty_2.cpp") diff --git a/Tests/RunCMake/target_sources/RelativePathInSubdirPrivate/subdir_empty_1.cpp b/Tests/RunCMake/target_sources/RelativePathInSubdirPrivate/subdir_empty_1.cpp new file mode 100644 index 0000000..11ec041 --- /dev/null +++ b/Tests/RunCMake/target_sources/RelativePathInSubdirPrivate/subdir_empty_1.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif + int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/target_sources/RelativePathInSubdirPrivate/subdir_empty_2.cpp b/Tests/RunCMake/target_sources/RelativePathInSubdirPrivate/subdir_empty_2.cpp new file mode 100644 index 0000000..11ec041 --- /dev/null +++ b/Tests/RunCMake/target_sources/RelativePathInSubdirPrivate/subdir_empty_2.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif + int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/target_sources/RunCMakeTest.cmake b/Tests/RunCMake/target_sources/RunCMakeTest.cmake index b67c598..9d64927 100644 --- a/Tests/RunCMake/target_sources/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_sources/RunCMakeTest.cmake @@ -1,3 +1,23 @@ include(RunCMake) -run_cmake(empty_keyword_args) +if(RunCMake_GENERATOR STREQUAL "Xcode") + run_cmake(ConfigNotAllowed) +endif() + +run_cmake(EmptyKeywordArgs) +run_cmake(OriginDebug) +run_cmake(CMP0026-LOCATION) +run_cmake(CMP0076-OLD) +run_cmake(CMP0076-WARN) +run_cmake(RelativePathInInterface) +run_cmake(RelativePathInSubdirGenEx) +run_cmake(RelativePathInSubdirInterface) +run_cmake(RelativePathInSubdirPrivate) +run_cmake(RelativePathInSubdirInclude) +run_cmake(ExportBuild) +run_cmake(AddCustomTargetPublicSources) +run_cmake(AddCustomTargetPrivateSources) +run_cmake(AddCustomTargetInterfaceSources) +run_cmake(AddCustomTargetSources) +run_cmake(AddCustomTargetCheckProperty) +run_cmake(AddCustomTargetGenx) diff --git a/Tests/RunCMake/target_sources/empty_1.cpp b/Tests/RunCMake/target_sources/empty_1.cpp new file mode 100644 index 0000000..11ec041 --- /dev/null +++ b/Tests/RunCMake/target_sources/empty_1.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif + int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/target_sources/empty_2.cpp b/Tests/RunCMake/target_sources/empty_2.cpp new file mode 100644 index 0000000..11ec041 --- /dev/null +++ b/Tests/RunCMake/target_sources/empty_2.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif + int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/target_sources/empty_3.cpp b/Tests/RunCMake/target_sources/empty_3.cpp new file mode 100644 index 0000000..11ec041 --- /dev/null +++ b/Tests/RunCMake/target_sources/empty_3.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif + int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/target_sources/empty_4.cpp b/Tests/RunCMake/target_sources/empty_4.cpp new file mode 100644 index 0000000..11ec041 --- /dev/null +++ b/Tests/RunCMake/target_sources/empty_4.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif + int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/target_sources/empty_keyword_args.cmake b/Tests/RunCMake/target_sources/empty_keyword_args.cmake deleted file mode 100644 index 5cee451..0000000 --- a/Tests/RunCMake/target_sources/empty_keyword_args.cmake +++ /dev/null @@ -1,5 +0,0 @@ -add_library(iface INTERFACE) -target_sources(iface PUBLIC PRIVATE INTERFACE) -# Cannot be called with non-compilable targets. -#add_library(imported UNKNOWN IMPORTED) -#target_sources(imported PUBLIC PRIVATE INTERFACE) diff --git a/Tests/RunCMake/target_sources/main.cpp b/Tests/RunCMake/target_sources/main.cpp new file mode 100644 index 0000000..766b775 --- /dev/null +++ b/Tests/RunCMake/target_sources/main.cpp @@ -0,0 +1,5 @@ + +int main() +{ + return 0; +} -- cgit v0.12