summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2023-08-27 08:55:38 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2023-08-27 08:59:36 (GMT)
commit878ae03832de33cdbad7990cc7a1177caaf2cead (patch)
tree4d4c3f40a98d9e7ec56ee20fc58c6a31b568de07
parentef2a6c35c2c044f9b4fe8fcdc2eabaff7fad5412 (diff)
downloadCMake-878ae03832de33cdbad7990cc7a1177caaf2cead.zip
CMake-878ae03832de33cdbad7990cc7a1177caaf2cead.tar.gz
CMake-878ae03832de33cdbad7990cc7a1177caaf2cead.tar.bz2
macOS: IMPORTED framework: Honor SYSTEM target property in all cases
When IMPORTED_LOCATION holds a framework folder, SYSTEM property must be respected.
-rw-r--r--Source/cmGeneratorTarget.cxx6
-rw-r--r--Tests/RunCMake/Framework/FrameworkSystemIncludeTest.cmake12
2 files changed, 15 insertions, 3 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index db4be63..7799e1c 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -797,10 +797,10 @@ void handleSystemIncludesDep(cmLocalGenerator* lg,
*dirs, lg, config, headTarget, dagChecker, depTgt, language));
}
- if (depTgt->Target->IsFrameworkOnApple()) {
+ if (depTgt->Target->IsFrameworkOnApple() ||
+ depTgt->IsImportedFrameworkFolderOnApple(config)) {
if (auto fwDescriptor = depTgt->GetGlobalGenerator()->SplitFrameworkPath(
- depTgt->GetLocation(config),
- cmGlobalGenerator::FrameworkFormat::Strict)) {
+ depTgt->GetLocation(config))) {
result.push_back(fwDescriptor->Directory);
result.push_back(fwDescriptor->GetFrameworkPath());
}
diff --git a/Tests/RunCMake/Framework/FrameworkSystemIncludeTest.cmake b/Tests/RunCMake/Framework/FrameworkSystemIncludeTest.cmake
index bcf6c29..94c0b87 100644
--- a/Tests/RunCMake/Framework/FrameworkSystemIncludeTest.cmake
+++ b/Tests/RunCMake/Framework/FrameworkSystemIncludeTest.cmake
@@ -22,3 +22,15 @@ set_target_properties(Example::Example2 PROPERTIES
add_library(testcase2 FrameworkSystemIncludeTest.c)
target_compile_options(testcase2 PRIVATE "-Werror=#pragma-messages")
target_link_libraries(testcase2 PRIVATE Example::Example2)
+
+
+
+add_library(Example::Example3 SHARED IMPORTED)
+set_target_properties(Example::Example3 PROPERTIES
+ FRAMEWORK 1
+ IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/subdir/Example.framework"
+)
+
+add_library(testcase3 FrameworkSystemIncludeTest.c)
+target_compile_options(testcase3 PRIVATE "-Werror=#pragma-messages")
+target_link_libraries(testcase3 PRIVATE Example::Example3)