diff options
author | Gregor Jasny <gjasny@googlemail.com> | 2017-03-22 21:49:38 (GMT) |
---|---|---|
committer | Gregor Jasny <gjasny@googlemail.com> | 2017-03-23 15:43:55 (GMT) |
commit | c51c2cfac619ac9efb9829f8b4decf9756891609 (patch) | |
tree | 6b9c4a5a4c3c6889ce81d3a6f8b7f6883f24d863 /Source/cmGeneratorTarget.cxx | |
parent | 060be58c6f9ffe11235341bc10c8f5d808e31b3d (diff) | |
download | CMake-c51c2cfac619ac9efb9829f8b4decf9756891609.zip CMake-c51c2cfac619ac9efb9829f8b4decf9756891609.tar.gz CMake-c51c2cfac619ac9efb9829f8b4decf9756891609.tar.bz2 |
Apple: Fix Resources location for all generators
Issue: #16680
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 64b05c3..f78a933 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -3315,10 +3315,18 @@ cmGeneratorTarget::GetTargetSourceFileFlags(const cmSourceFile* sf) const // were not listed in one of the other lists. if (const char* location = sf->GetProperty("MACOSX_PACKAGE_LOCATION")) { flags.MacFolder = location; + const bool stripResources = + this->GlobalGenerator->ShouldStripResourcePath(this->Makefile); if (strcmp(location, "Resources") == 0) { flags.Type = cmGeneratorTarget::SourceFileTypeResource; + if (stripResources) { + flags.MacFolder = ""; + } } else if (cmSystemTools::StringStartsWith(location, "Resources/")) { flags.Type = cmGeneratorTarget::SourceFileTypeDeepResource; + if (stripResources) { + flags.MacFolder += strlen("Resources/"); + } } else { flags.Type = cmGeneratorTarget::SourceFileTypeMacContent; } @@ -3372,7 +3380,7 @@ void cmGeneratorTarget::ConstructSourceFileFlags() const if (cmSourceFile* sf = this->Makefile->GetSource(*it)) { SourceFileFlags& flags = this->SourceFlagsMap[sf]; flags.MacFolder = ""; - if (!this->Makefile->PlatformIsAppleIos()) { + if (!this->GlobalGenerator->ShouldStripResourcePath(this->Makefile)) { flags.MacFolder = "Resources"; } flags.Type = cmGeneratorTarget::SourceFileTypeResource; |