• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Help: "not a valid bundle"?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help: "not a valid bundle"?


  • Subject: Re: Help: "not a valid bundle"?
  • From: "Philip J. Schneider" <email@hidden>
  • Date: Sun, 05 Jun 2011 11:18:45 -0700

Geoff -

Thanks. I'll have a look at all of this. Appreciate your sharing this, especially in light of some more investigating I've done...

Turns out that my issue is related to the directives/code in the CMakeLists.txt (and associated) files, which come from the cmake build scheme. I haven't tried to test my theory, but I think that the process of generating XCode projects from cmake might have worked in XCode 3...

The root of the problem seems to be mis-handling of debug vs release builds, and the path differences this implies, both in the build hierarchy, and in the various text files and scripts that control it. To wit: some parts of the build process deposit files (like the .app file and executable) in the Debug build subtree, and others in the Release subtree, and others in a non-build-specific subtree. My original symptom is in fact due to the failure of the Info.plist and executable files not being where they should be.

My general feeling is that while creating XCode projects from cmake is nice if it works, it may be that discretion is the better part of valor, and crafting a more "conventional" XCode project may be faster than trying to fix arcane stuff.

Clearly, I need to get a better understanding of all this build-type (release vs debug vs archive) stuff in XCode, in any case.

Thanks again!

-- Philip


At 5:40 PM -0400 6/4/11, Geoff Beier wrote:
I've found BundleUtilities pretty hard to troubleshoot. One thing that
helped me was using the Makefile generator to suss it all out before
you switch over to xcode. I found it easier to coax informative error
messages out of that.

Here are some relevant parts of my CMakeLists.txt that might help you:

To include the icon, I needed to:
SET (BarcodeCreator_exe_MACOSX_RSRCS
    bitmaps/barcodecreator.icns
)

if(APPLE)
    set( MACOSX_BUNDLE_INFO_STRING "Red Hound Software QR Code
generation utility 0.0.1" )
    set( MACOSX_BUNDLE_BUNDLE_VERSION "0.0.1" )
    set( MACOSX_BUNDLE_GUI_IDENTIFIER "com.redhoundsoftware.barcodecreator" )
    set( MACOSX_BUNDLE_BUNDLE_NAME "BarcodeCreator" )
    set(MACOSX_BUNDLE_ICON_FILE barcodecreator.icns)
    set_source_files_properties(
          ${BarcodeCreator_exe_MACOSX_RSRCS}
          PROPERTIES
          MACOSX_PACKAGE_LOCATION Resources
          )
      list (APPEND BarcodeCreator_exe_SRCS ${BarcodeCreator_exe_MACOSX_RSRCS})
endif(APPLE)

Make sure you generate a bundle here:
ADD_EXECUTABLE(BarcodeCreator WIN32 MACOSX_BUNDLE ${BarcodeCreator_exe_SRCS})

if(APPLE)
    SET(APP_BUNDLE_NAME BarcodeCreator.app)
    SET(BUNDLE_INSTALL_TARGET "\${CMAKE_INSTALL_PREFIX}/${APP_BUNDLE_NAME}")
    SET(APPS ${BUNDLE_INSTALL_TARGET})
else()
    SET(APPS "\${CMAKE_INSTALL_PREFIX}/BarcodeCreator")
endif(APPLE)

For BundleUtils to work its magic, I had to add the libraries I'm
using to the install target like this:
if(APPLE)
	# add things to the bundle here
    install( FILES ${libqrencode_LIBRARIES} DESTINATION
${APP_BUNDLE_NAME}/Contents/MacOS )
    foreach( lib ${libqrencode_LIBRARIES} )
        get_filename_component(libfile ${lib} NAME)
        MESSAGE("Adding ${libfile} to bundle")
        list(APPEND BUNDLELIBS
${BUNDLE_INSTALL_TARGET}/Contents/MacOS/${libfile})
    endforeach(lib ${libqrencode_LIBRARIES})
endif(APPLE)

Then this, at the end of my CMakeLists.txt, is the accumulated wisdom
from my troubleshooting:
#
# Note about BundleUtilities:
#
# the libs passed as the second argument to fixup_bundle MUST already
be copied into the app bundle.
# fixup_bundle only copies dependencies it discovers. Any libs passed
as the second argument will
# also have their dependencies copied in and fixed.
install( CODE "
    include(BundleUtilities)
    set(BU_CHMOD_BUNDLE_ITEMS 1)
    fixup_bundle(\"${APPS}\" \"${BUNDLELIBS}\" \"${SEARCHDIRS}\")
    " COMPONENT RUNTIME )

I may be telling you things you already know, but maybe you'll see
something above you're not doing. Mine is a wxWidgets app, so some of
what I had to do may not apply, but I don't see anything really
wx-specific here. If this doesn't help, though, you might be better
off getting as much output as you can from a Makefile generator and
taking that to a cmake-specific list.

Good luck,

Geoff

On Sat, Jun 4, 2011 at 15:36, Philip J. Schneider
<email@hidden> wrote:
 Greetings:
 I've got an Xcode 4 project that was constructed from a cmake build scheme
 by invoking this:
    cmake -DCMAKE_BUILD_TYPE=Release -G Xcode ..
 Perhaps of note is that this is a Qt-based application (?)
 The build runs along nicely right up to the end, where I get this error:

   echo ""
   /opt/local/bin/cmake -P
 /Users/pjs/Applications/OpenFlipper/buildXCode/fixbundle.cmake
   -- fixup_bundle
   --
 app='/Users/pjs/Applications/OpenFlipper/buildXCode/Build/OpenFlipper.app'
   --   libs='<Long list of .so file paths>'
   --   dirs='/usr/lib;'
   -- warning: *NOT* handled - .app directory case...
   CMake Error at
 /opt/local/share/cmake-2.8/Modules/BundleUtilities.cmake:657 (message)
     error: fixup_bundle: not a valid bundle
   Call Stack (most recent call first):
     fixbundle.cmake:51 (fixup_bundle)
   make: ***
 [/Users/pjs/Applications/OpenFlipper/buildXCode/CMakeFiles/fixbundle] Error
 1

 I'm at a loss as to how to diagnose what's going on. Searching the web for
 this same error yields advice that's generally along the lines of "your
 script has a bug"... :-(
 Can anyone provide any pointers with regard to how to track down the
 specific cause of the error?
 Thanks!
 -- Philip



  _______________________________________________
 Do not post admin requests to the list. They will be ignored.
 Xcode-users mailing list      (email@hidden)
 Help/Unsubscribe/Update your Subscription:
 This email sent to email@hidden



_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Re: Help: "not a valid bundle"? (From: Geoff Beier <email@hidden>)

  • Prev by Date: Re: XCode 3 trashing & error during event broadcast
  • Next by Date: Re: XCode 3 trashing & error during event broadcast
  • Previous by thread: Re: Help: "not a valid bundle"?
  • Next by thread: Re: Project fails to attach...
  • Index(es):
    • Date
    • Thread