Re: Help: "not a valid bundle"?
Re: Help: "not a valid bundle"?
- Subject: Re: Help: "not a valid bundle"?
- From: Geoff Beier <email@hidden>
- Date: Sat, 04 Jun 2011 17:40:14 -0400
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