[cmake-developers] [CMake 0014258]: MACOSX_BUNDLE path problem when

Mantis Bug Tracker mantis at public.kitware.com
Sat Jun 29 06:12:57 EDT 2013


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=14258 
====================================================================== 
Reported By:                Andrew S.
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14258
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   high
Status:                     new
====================================================================== 
Date Submitted:             2013-06-29 06:12 EDT
Last Modified:              2013-06-29 06:12 EDT
====================================================================== 
Summary:                    MACOSX_BUNDLE path problem when
Description: 
(Copied from backlogged issue submitted by Duron
http://public.kitware.com/Bug/view.php?id=12451):

I'm not sure if building for iOS is officially supported, but here goes...

When building for iOS with MACOSX_BUNDLE specified on the target, this generates
an XCODE_DEPEND_HELPER.make with Foo.app/Contents/MacOS/foo paths in it. However
for iOS builds, Xcode places the executable 'foo' in Foo.app/foo.

I couldn't find an option to change this behavior.


The result is that dependency checking does not work and a clean build is
required every time the app is compiled.

End of original message

----

This bug is very annoying: you always have to change something each time in a
main target to force full project relink when developing a depend library.

See proposed patch below. It introduces MACOSX_BUNDLE_BUILD_FOR_IOS property
which will allow to remove "Contents/MacOS" from output paths when building for
iOS. The patch is fully working - tried successfully on our big project.


Steps to Reproduce: 
Set up an iOS project by setting CMAKE_OSX_SYSROOT, CMAKE_OSX_ARCHITECTURES and
MACOSX_BUNDLE_GUI_IDENTIFIER. Specify MACOSX_BUNDLE for the target executable.
Make a change in a dependency and rebuild the app. The app will not be updated.

Additional Information: 

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index b14db43..fb3902f 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -6473,6 +6473,8 @@ std::string cmTarget::GetAppBundleDirectory(const char*
config,
                                             bool contentOnly)
 {
   std::string fpath = this->GetFullName(config, false);
+  if (this->GetPropertyAsBool("MACOSX_BUNDLE_BUILD_FOR_IOS"))
+    return fpath + ".app";
   fpath += ".app/Contents";
   if(!contentOnly)
     fpath += "/MacOS";
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2013-06-29 06:12 Andrew S.      New Issue                                    
======================================================================




More information about the cmake-developers mailing list