diff options
author | Brad King <brad.king@kitware.com> | 2022-03-02 12:45:51 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-03-02 12:45:58 (GMT) |
commit | 1ed1edbfd1474f8ba9356e49e36ad6672bc5826b (patch) | |
tree | 4049a41d311c66644b267425749dfaf6edfc01b6 /Tests/RunCMake | |
parent | 0a4da33f8c882200d705bfcfa16e88f9de47ce04 (diff) | |
parent | ad41c9cd1161bb3d19bc1db8a20a7b7e87665f3a (diff) | |
download | CMake-1ed1edbfd1474f8ba9356e49e36ad6672bc5826b.zip CMake-1ed1edbfd1474f8ba9356e49e36ad6672bc5826b.tar.gz CMake-1ed1edbfd1474f8ba9356e49e36ad6672bc5826b.tar.bz2 |
Merge topic 'file-set-no-custom-targets'
ad41c9cd11 target_sources(): Prohibit FILE_SET on custom targets
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7027
Diffstat (limited to 'Tests/RunCMake')
4 files changed, 8 insertions, 0 deletions
diff --git a/Tests/RunCMake/target_sources/FileSetCustomTarget-result.txt b/Tests/RunCMake/target_sources/FileSetCustomTarget-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/target_sources/FileSetCustomTarget-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/target_sources/FileSetCustomTarget-stderr.txt b/Tests/RunCMake/target_sources/FileSetCustomTarget-stderr.txt new file mode 100644 index 0000000..8ab3de7 --- /dev/null +++ b/Tests/RunCMake/target_sources/FileSetCustomTarget-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at FileSetCustomTarget\.cmake:[0-9]+ \(target_sources\): + target_sources FILE_SETs may not be added to custom targets +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/target_sources/FileSetCustomTarget.cmake b/Tests/RunCMake/target_sources/FileSetCustomTarget.cmake new file mode 100644 index 0000000..ce26400 --- /dev/null +++ b/Tests/RunCMake/target_sources/FileSetCustomTarget.cmake @@ -0,0 +1,2 @@ +add_custom_target(tgt) +target_sources(tgt PRIVATE FILE_SET HEADERS FILES h1.h) diff --git a/Tests/RunCMake/target_sources/RunCMakeTest.cmake b/Tests/RunCMake/target_sources/RunCMakeTest.cmake index 171de60..da9944d 100644 --- a/Tests/RunCMake/target_sources/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_sources/RunCMakeTest.cmake @@ -38,6 +38,7 @@ run_cmake(FileSetNoExistPrivate) run_cmake(FileSetNoExistInterface) run_cmake(FileSetNoExistInstall) run_cmake(FileSetDirectories) +run_cmake(FileSetCustomTarget) set(RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0115=NEW) run_cmake(FileSetFileNoExist) |