Tests: Add RunCMake.target_sources case covering missing source

This commit is contained in:
Brad King
2023-02-28 17:49:12 -05:00
parent 12d041b8f7
commit 4a3e79048b
5 changed files with 12 additions and 1 deletions

View File

@@ -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)

View File

@@ -0,0 +1 @@
1

View File

@@ -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\)

View File

@@ -0,0 +1,3 @@
cmake_policy(SET CMP0115 NEW)
add_custom_target(foo)
target_sources(foo PRIVATE missing.txt)

View File

@@ -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)