diff options
author | Brad King <brad.king@kitware.com> | 2023-02-28 22:49:12 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-02-28 22:50:31 (GMT) |
commit | 4a3e79048b6afd7eb86f72b1365028e6233c92b0 (patch) | |
tree | 290d72a732302faab66e4cb375580c776291945b /Tests | |
parent | 12d041b8f7718d9ec48fd3621ddc866a1d3c77cf (diff) | |
download | CMake-4a3e79048b6afd7eb86f72b1365028e6233c92b0.zip CMake-4a3e79048b6afd7eb86f72b1365028e6233c92b0.tar.gz CMake-4a3e79048b6afd7eb86f72b1365028e6233c92b0.tar.bz2 |
Tests: Add RunCMake.target_sources case covering missing source
Diffstat (limited to 'Tests')
5 files changed, 12 insertions, 1 deletions
diff --git a/Tests/RunCMake/target_sources/CMakeLists.txt b/Tests/RunCMake/target_sources/CMakeLists.txt index 727f93a..296fdda 100644 --- a/Tests/RunCMake/target_sources/CMakeLists.txt +++ b/Tests/RunCMake/target_sources/CMakeLists.txt @@ -1,3 +1,3 @@ cmake_minimum_required(VERSION 3.11) project(${RunCMake_TEST} LANGUAGES NONE) -include(${RunCMake_TEST}.cmake) +include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE) diff --git a/Tests/RunCMake/target_sources/MissingSource-result.txt b/Tests/RunCMake/target_sources/MissingSource-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/target_sources/MissingSource-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/target_sources/MissingSource-stderr.txt b/Tests/RunCMake/target_sources/MissingSource-stderr.txt new file mode 100644 index 0000000..b082603 --- /dev/null +++ b/Tests/RunCMake/target_sources/MissingSource-stderr.txt @@ -0,0 +1,6 @@ +^CMake Error at MissingSource\.cmake:[0-9]+ \(add_custom_target\): + Cannot find source file: + + missing\.txt +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/target_sources/MissingSource.cmake b/Tests/RunCMake/target_sources/MissingSource.cmake new file mode 100644 index 0000000..2bb71e4 --- /dev/null +++ b/Tests/RunCMake/target_sources/MissingSource.cmake @@ -0,0 +1,3 @@ +cmake_policy(SET CMP0115 NEW) +add_custom_target(foo) +target_sources(foo PRIVATE missing.txt) diff --git a/Tests/RunCMake/target_sources/RunCMakeTest.cmake b/Tests/RunCMake/target_sources/RunCMakeTest.cmake index c1314f7..90915cd 100644 --- a/Tests/RunCMake/target_sources/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_sources/RunCMakeTest.cmake @@ -9,6 +9,7 @@ run_cmake(OriginDebug) run_cmake(CMP0026-LOCATION) run_cmake(CMP0076-OLD) run_cmake(CMP0076-WARN) +run_cmake(MissingSource) run_cmake(RelativePathInInterface) run_cmake(RelativePathInSubdirGenEx) run_cmake(RelativePathInSubdirInterface) |