diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2022-04-06 20:40:34 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-04-07 13:26:58 (GMT) |
commit | f779f8c0ad4c16cda5a166d440915a01e986d396 (patch) | |
tree | bd82cc9e14e10efdb88e7e277642089ee1e73d10 /Tests/RunCMake | |
parent | 42bca07cc67d42cbc37109a9be208321e7ebc620 (diff) | |
download | CMake-f779f8c0ad4c16cda5a166d440915a01e986d396.zip CMake-f779f8c0ad4c16cda5a166d440915a01e986d396.tar.gz CMake-f779f8c0ad4c16cda5a166d440915a01e986d396.tar.bz2 |
FILE_SET: Forbid adding header sets to Apple FRAMEWORK libraries
The feature needs a specialized implementation to place headers
in the right place inside frameworks. To avoid silently doing
the wrong thing, make this case an error for the 3.23 series.
Issue: #23386
Diffstat (limited to 'Tests/RunCMake')
4 files changed, 15 insertions, 0 deletions
diff --git a/Tests/RunCMake/target_sources/FileSetFramework-result.txt b/Tests/RunCMake/target_sources/FileSetFramework-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/target_sources/FileSetFramework-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/target_sources/FileSetFramework-stderr.txt b/Tests/RunCMake/target_sources/FileSetFramework-stderr.txt new file mode 100644 index 0000000..ae7026a --- /dev/null +++ b/Tests/RunCMake/target_sources/FileSetFramework-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at FileSetFramework\.cmake:[0-9]+ \(target_sources\): + target_sources FILE_SETs may not be added to FRAMEWORK targets +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/target_sources/FileSetFramework.cmake b/Tests/RunCMake/target_sources/FileSetFramework.cmake new file mode 100644 index 0000000..d8a924f --- /dev/null +++ b/Tests/RunCMake/target_sources/FileSetFramework.cmake @@ -0,0 +1,7 @@ +enable_language(C) + +add_library(lib1 SHARED lib1.c) +set_property(TARGET lib1 PROPERTY FRAMEWORK ON) +target_sources(lib1 + PUBLIC FILE_SET HEADERS BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} FILES h1.h + ) diff --git a/Tests/RunCMake/target_sources/RunCMakeTest.cmake b/Tests/RunCMake/target_sources/RunCMakeTest.cmake index d23bce1..743879e 100644 --- a/Tests/RunCMake/target_sources/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_sources/RunCMakeTest.cmake @@ -40,6 +40,9 @@ run_cmake(FileSetNoExistInstall) run_cmake(FileSetDirectories) run_cmake(FileSetCustomTarget) run_cmake(FileSetBadName) +if(APPLE) + run_cmake(FileSetFramework) +endif() set(RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0115=NEW) run_cmake(FileSetFileNoExist) |