This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, next has been updated discards fcaf48bb9b9e64022a2b72819a3affd9e9b6ea11 (commit) discards b3790796a2fbae9e0558edd6ba3b0212d33669ca (commit) via b95ba9c47daae0f77c06a2e993e342cb74de5ce3 (commit) via d9bebefbde3ce2ff1589de401b916b9d62dd6ca9 (commit) via 1e2081a40b4e468ae21814d58a5a67e764830dde (commit) via 060be58c6f9ffe11235341bc10c8f5d808e31b3d (commit) via 484ccb0c454afa36da6b36e4ca5e0258e1739b3d (commit) This update added new revisions after undoing existing revisions. That is to say, the old revision is not a strict subset of the new revision. This situation occurs when you --force push a change and generate a repository containing something like this: * -- * -- B -- O -- O -- O (fcaf48bb9b9e64022a2b72819a3affd9e9b6ea11) \ N -- N -- N (b95ba9c47daae0f77c06a2e993e342cb74de5ce3) When this happens we assume that you've already had alert emails for all of the O revisions, and so we here report only the revisions in the N branch from the common base, B. Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b95ba9c47daae0f77c06a2e993e342cb74de5ce3 commit b95ba9c47daae0f77c06a2e993e342cb74de5ce3 Merge: f0f60c5 d9bebef Author: Brad King <brad.k...@kitware.com> AuthorDate: Thu Mar 23 13:16:21 2017 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Thu Mar 23 09:20:36 2017 -0400 Stage topic '16680-ios-bundle-resources' Topic-id: 23205 Topic-url: https://gitlab.kitware.com/cmake/cmake/merge_requests/613 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d9bebefbde3ce2ff1589de401b916b9d62dd6ca9 commit d9bebefbde3ce2ff1589de401b916b9d62dd6ca9 Author: Gregor Jasny <gja...@googlemail.com> AuthorDate: Wed Mar 22 23:10:28 2017 +0100 Commit: Gregor Jasny <gja...@googlemail.com> CommitDate: Wed Mar 22 23:36:47 2017 +0100 Apple: Add test for bundle resource layout Closes: #16680 diff --git a/Tests/RunCMake/Framework/FrameworkLayout.cmake b/Tests/RunCMake/Framework/FrameworkLayout.cmake index ae32134..dcfbd2d 100644 --- a/Tests/RunCMake/Framework/FrameworkLayout.cmake +++ b/Tests/RunCMake/Framework/FrameworkLayout.cmake @@ -4,11 +4,17 @@ enable_language(C) add_library(Framework ${FRAMEWORK_TYPE} foo.c foo.h - res.txt) + res.txt + flatresource.txt + deepresource.txt + some.txt) set_target_properties(Framework PROPERTIES FRAMEWORK TRUE PUBLIC_HEADER foo.h RESOURCE "res.txt") +set_source_files_properties(flatresource.txt PROPERTIES MACOSX_PACKAGE_LOCATION Resources) +set_source_files_properties(deepresource.txt PROPERTIES MACOSX_PACKAGE_LOCATION Resources/deep) +set_source_files_properties(some.txt PROPERTIES MACOSX_PACKAGE_LOCATION somedir) add_custom_command(TARGET Framework POST_BUILD COMMAND /usr/bin/file $<TARGET_FILE:Framework>) diff --git a/Tests/RunCMake/Framework/OSXFrameworkLayout-build-check.cmake b/Tests/RunCMake/Framework/OSXFrameworkLayout-build-check.cmake index da1ccb4..1a543d8 100644 --- a/Tests/RunCMake/Framework/OSXFrameworkLayout-build-check.cmake +++ b/Tests/RunCMake/Framework/OSXFrameworkLayout-build-check.cmake @@ -1,8 +1,11 @@ set(framework-dir "${RunCMake_TEST_BINARY_DIR}/Framework.framework") set(framework-resources "${framework-dir}/Resources") set(framework-resource-file "${framework-resources}/res.txt") +set(framework-flat-resource-file "${framework-resources}/flatresource.txt") +set(framework-deep-resource-file "${framework-resources}/deep/deepresource.txt") set(framework-library "${framework-dir}/Framework") set(framework-versions "${framework-dir}/Versions") +set(framework-some-file "${framework-versions}/Current/somedir/some.txt") set(plist-file "${framework-resources}/Info.plist") set(framework-header "${framework-dir}/Headers/foo.h") @@ -22,6 +25,18 @@ if(NOT EXISTS ${framework-resource-file}) message(SEND_ERROR "Framework resource file not found at ${framework-resource-file}") endif() +if(NOT EXISTS ${framework-flat-resource-file}) + message(SEND_ERROR "Framework flat resource file not found at ${framework-flat-resource-file}") +endif() + +if(NOT EXISTS ${framework-deep-resource-file}) + message(SEND_ERROR "Framework deep resource file not found at ${framework-deep-resource-file}") +endif() + +if(NOT EXISTS ${framework-some-file}) + message(SEND_ERROR "Framework some file not found at ${framework-some-file}") +endif() + if(NOT EXISTS ${framework-versions}) message(SEND_ERROR "Framework versions not found at ${framework-versions}") endif() diff --git a/Tests/RunCMake/Framework/deepresource.txt b/Tests/RunCMake/Framework/deepresource.txt new file mode 100644 index 0000000..e69de29 diff --git a/Tests/RunCMake/Framework/flatresource.txt b/Tests/RunCMake/Framework/flatresource.txt new file mode 100644 index 0000000..e69de29 diff --git a/Tests/RunCMake/Framework/iOSFrameworkLayout-build-check.cmake b/Tests/RunCMake/Framework/iOSFrameworkLayout-build-check.cmake index b81a5f7..e068a3a 100644 --- a/Tests/RunCMake/Framework/iOSFrameworkLayout-build-check.cmake +++ b/Tests/RunCMake/Framework/iOSFrameworkLayout-build-check.cmake @@ -1,6 +1,9 @@ set(framework-dir "${RunCMake_TEST_BINARY_DIR}/Framework.framework") set(framework-resources "${framework-dir}/Resources") set(framework-resource-file "${framework-dir}/res.txt") +set(framework-flat-resource-file "${framework-dir}/flatresource.txt") +set(framework-deep-resource-file "${framework-dir}/deep/deepresource.txt") +set(framework-some-file "${framework-dir}/somedir/some.txt") set(framework-library "${framework-dir}/Framework") set(framework-versions "${framework-dir}/Versions") set(plist-file "${framework-dir}/Info.plist") @@ -22,6 +25,18 @@ if(NOT EXISTS ${framework-resource-file}) message(SEND_ERROR "Framework resource file not found at ${framework-resource-file}") endif() +if(NOT EXISTS ${framework-flat-resource-file}) + message(SEND_ERROR "Framework flat resource file not found at ${framework-flat-resource-file}") +endif() + +if(NOT EXISTS ${framework-deep-resource-file}) + message(SEND_ERROR "Framework deep resource file not found at ${framework-deep-resource-file}") +endif() + +if(NOT EXISTS ${framework-some-file}) + message(SEND_ERROR "Framework some file not found at ${framework-some-file}") +endif() + if(EXISTS ${framework-versions}) message(SEND_ERROR "Framework versions found at ${framework-versions}") endif() diff --git a/Tests/RunCMake/Framework/some.txt b/Tests/RunCMake/Framework/some.txt new file mode 100644 index 0000000..e69de29 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1e2081a40b4e468ae21814d58a5a67e764830dde commit 1e2081a40b4e468ae21814d58a5a67e764830dde Author: Gregor Jasny <gja...@googlemail.com> AuthorDate: Wed Mar 22 22:49:38 2017 +0100 Commit: Gregor Jasny <gja...@googlemail.com> CommitDate: Wed Mar 22 23:36:18 2017 +0100 Apple: Fix Resources location for all generators Issue: #16680 diff --git a/Help/prop_sf/MACOSX_PACKAGE_LOCATION.rst b/Help/prop_sf/MACOSX_PACKAGE_LOCATION.rst index 69cdcb7..a064afa 100644 --- a/Help/prop_sf/MACOSX_PACKAGE_LOCATION.rst +++ b/Help/prop_sf/MACOSX_PACKAGE_LOCATION.rst @@ -21,3 +21,10 @@ extension is changed). See the :prop_tgt:`PUBLIC_HEADER`, :prop_tgt:`PRIVATE_HEADER`, and :prop_tgt:`RESOURCE` target properties for specifying files meant for ``Headers``, ``PrivateHeaders``, or ``Resources`` directories. + +If the specified location is equal to ``Resources``, the resulting location +will be the same as if the :prop_tgt:`RESOURCE` property had been used. If +the specified location is a sub-folder of ``Resources``, it will be placed +into the respective sub-folder. Note: For iOS Apple uses a flat bundle layout +where no ``Resources`` folder exist. Therefore CMake strips the ``Resources`` +folder name from the specified location. diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 64b05c3..d9f55fe 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -3315,10 +3315,16 @@ 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 +3378,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; diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 0d53bf7..851290a 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2487,6 +2487,11 @@ std::string cmGlobalGenerator::GenerateRuleFile( return ruleFile; } +bool cmGlobalGenerator::ShouldStripResourcePath(cmMakefile* mf) const +{ + return mf->PlatformIsAppleIos(); +} + std::string cmGlobalGenerator::GetSharedLibFlagsForLanguage( std::string const& l) const { diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index b3cb41f..2558fee 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -337,6 +337,10 @@ public: relevant for mixed macOS and iOS builds. */ virtual bool UseEffectivePlatformName(cmMakefile*) const { return false; } + /** Return whether the "Resources" folder prefix should be stripped from + MacFolder. */ + virtual bool ShouldStripResourcePath(cmMakefile*) const; + std::string GetSharedLibFlagsForLanguage(std::string const& lang) const; /** Generate an <output>.rule file path for a given command output. */ diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index bd0f55b..39f7b8f 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1200,9 +1200,8 @@ bool cmGlobalXCodeGenerator::CreateXCodeTargets( this->CreateString("2147483647")); copyFilesBuildPhase->AddAttribute("dstSubfolderSpec", this->CreateString("7")); - const std::string dstPath = mit->first.substr(strlen("Resources/")); copyFilesBuildPhase->AddAttribute("dstPath", - this->CreateString(dstPath)); + this->CreateString(mit->first)); copyFilesBuildPhase->AddAttribute("runOnlyForDeploymentPostprocessing", this->CreateString("0")); buildFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST); @@ -3701,6 +3700,12 @@ bool cmGlobalXCodeGenerator::UseEffectivePlatformName(cmMakefile* mf) const return cmSystemTools::IsOn(epnValue); } +bool cmGlobalXCodeGenerator::ShouldStripResourcePath(cmMakefile*) const +{ + // Xcode determines Resource location itself + return true; +} + void cmGlobalXCodeGenerator::ComputeTargetObjectDirectory( cmGeneratorTarget* gt) const { diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index 9eacdef..172e414 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -88,6 +88,8 @@ public: bool UseEffectivePlatformName(cmMakefile* mf) const CM_OVERRIDE; + bool ShouldStripResourcePath(cmMakefile*) const CM_OVERRIDE; + bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf) CM_OVERRIDE; void AppendFlag(std::string& flags, std::string const& flag); https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=060be58c6f9ffe11235341bc10c8f5d808e31b3d commit 060be58c6f9ffe11235341bc10c8f5d808e31b3d Author: Gregor Jasny <gja...@googlemail.com> AuthorDate: Sun Feb 26 22:12:44 2017 +0100 Commit: Gregor Jasny <gja...@googlemail.com> CommitDate: Wed Mar 22 23:36:11 2017 +0100 Xcode: Properly handle Bundle Resources with more than one hierarchy level Issue: #16680 diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index e27424f..64b05c3 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -3317,6 +3317,8 @@ cmGeneratorTarget::GetTargetSourceFileFlags(const cmSourceFile* sf) const flags.MacFolder = location; if (strcmp(location, "Resources") == 0) { flags.Type = cmGeneratorTarget::SourceFileTypeResource; + } else if (cmSystemTools::StringStartsWith(location, "Resources/")) { + flags.Type = cmGeneratorTarget::SourceFileTypeDeepResource; } else { flags.Type = cmGeneratorTarget::SourceFileTypeMacContent; } diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 68d6ef8..d60ad24 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -422,7 +422,9 @@ public: SourceFileTypePublicHeader, // is in "PUBLIC_HEADER" target property SourceFileTypeResource, // is in "RESOURCE" target property *or* // has MACOSX_PACKAGE_LOCATION=="Resources" - SourceFileTypeMacContent // has MACOSX_PACKAGE_LOCATION!="Resources" + SourceFileTypeDeepResource, // MACOSX_PACKAGE_LOCATION starts with + // "Resources/" + SourceFileTypeMacContent // has MACOSX_PACKAGE_LOCATION!="Resources[/]" }; struct SourceFileFlags { diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 3f5dde7..bd0f55b 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1177,6 +1177,46 @@ bool cmGlobalXCodeGenerator::CreateXCodeTargets( } } + // create vector of "resource content file" build phases - only for + // framework or bundle targets + if (isFrameworkTarget || isBundleTarget || isCFBundleTarget) { + typedef std::map<std::string, std::vector<cmSourceFile*> > + mapOfVectorOfSourceFiles; + mapOfVectorOfSourceFiles bundleFiles; + for (std::vector<cmSourceFile*>::const_iterator i = classes.begin(); + i != classes.end(); ++i) { + cmGeneratorTarget::SourceFileFlags tsFlags = + gtgt->GetTargetSourceFileFlags(*i); + if (tsFlags.Type == cmGeneratorTarget::SourceFileTypeDeepResource) { + bundleFiles[tsFlags.MacFolder].push_back(*i); + } + } + mapOfVectorOfSourceFiles::iterator mit; + for (mit = bundleFiles.begin(); mit != bundleFiles.end(); ++mit) { + cmXCodeObject* copyFilesBuildPhase = + this->CreateObject(cmXCodeObject::PBXCopyFilesBuildPhase); + copyFilesBuildPhase->SetComment("Copy files"); + copyFilesBuildPhase->AddAttribute("buildActionMask", + this->CreateString("2147483647")); + copyFilesBuildPhase->AddAttribute("dstSubfolderSpec", + this->CreateString("7")); + const std::string dstPath = mit->first.substr(strlen("Resources/")); + copyFilesBuildPhase->AddAttribute("dstPath", + this->CreateString(dstPath)); + copyFilesBuildPhase->AddAttribute("runOnlyForDeploymentPostprocessing", + this->CreateString("0")); + buildFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST); + copyFilesBuildPhase->AddAttribute("files", buildFiles); + std::vector<cmSourceFile*>::iterator sfIt; + for (sfIt = mit->second.begin(); sfIt != mit->second.end(); ++sfIt) { + cmXCodeObject* xsf = this->CreateXCodeSourceFile( + this->CurrentLocalGenerator, *sfIt, gtgt); + buildFiles->AddObject(xsf); + } + contentBuildPhases.push_back(copyFilesBuildPhase); + } + } + // create framework build phase cmXCodeObject* frameworkBuildPhase = 0; if (!externalObjFiles.empty()) { https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=484ccb0c454afa36da6b36e4ca5e0258e1739b3d commit 484ccb0c454afa36da6b36e4ca5e0258e1739b3d Author: Gregor Jasny <gja...@googlemail.com> AuthorDate: Sun Feb 26 22:14:34 2017 +0100 Commit: Gregor Jasny <gja...@googlemail.com> CommitDate: Wed Mar 22 21:16:42 2017 +0100 Xcode: Properly handle non-resource Bundle files on iOS Issue: #16680 diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 77f3408..3f5dde7 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1154,8 +1154,12 @@ bool cmGlobalXCodeGenerator::CreateXCodeTargets( // dstPath in frameworks is relative to Versions/<version> ostr << mit->first; } else if (mit->first != "MacOS") { - // dstPath in bundles is relative to Contents/MacOS - ostr << "../" << mit->first.c_str(); + if (gtgt->Target->GetMakefile()->PlatformIsAppleIos()) { + ostr << mit->first; + } else { + // dstPath in bundles is relative to Contents/MacOS + ostr << "../" << mit->first; + } } copyFilesBuildPhase->AddAttribute("dstPath", this->CreateString(ostr.str())); ----------------------------------------------------------------------- Summary of changes: Help/prop_sf/MACOSX_PACKAGE_LOCATION.rst | 7 +++ Source/cmGeneratorTarget.cxx | 10 +++- Source/cmGeneratorTarget.h | 4 +- Source/cmGlobalGenerator.cxx | 5 ++ Source/cmGlobalGenerator.h | 4 ++ Source/cmGlobalVisualStudioGenerator.cxx | 19 ------- Source/cmGlobalXCodeGenerator.cxx | 53 +++++++++++++++++++- Source/cmGlobalXCodeGenerator.h | 2 + Tests/RunCMake/Framework/FrameworkLayout.cmake | 8 ++- .../Framework/OSXFrameworkLayout-build-check.cmake | 15 ++++++ .../RunCMake/Framework/deepresource.txt | 0 .../RunCMake/Framework/flatresource.txt | 0 .../Framework/iOSFrameworkLayout-build-check.cmake | 15 ++++++ .../hello.f => Tests/RunCMake/Framework/some.txt | 0 14 files changed, 118 insertions(+), 24 deletions(-) copy Modules/IntelVSImplicitPath/hello.f => Tests/RunCMake/Framework/deepresource.txt (100%) copy Modules/IntelVSImplicitPath/hello.f => Tests/RunCMake/Framework/flatresource.txt (100%) copy Modules/IntelVSImplicitPath/hello.f => Tests/RunCMake/Framework/some.txt (100%) hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/mailman/listinfo/cmake-commits