[CMake] fixup_bundle, shared libs and Plugins

Michael Jackson mike.jackson at bluequartz.net
Mon Jan 10 18:24:28 EST 2011


And just to follow up a bit with something else, I added the following bit of cmake code for the 2 libraries MXADataModel and AIMLib:

SET_TARGET_PROPERTIES(${targetName}
   PROPERTIES
   LINK_FLAGS "-current_version ${${CMP_PROJECT_NAME}_VERSION} -compatibility_version ${${CMP_PROJECT_NAME}_VERSION}"
   INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib"
    BUILD_WITH_INSTALL_RPATH 1
 )  

And now I can get everything to work. This seems like an odd thing to have to add. Why can't fixup_bundle() resolve an item that is in the build tree? Seems that I have to install the library FIRST to an external location with the proper install_name for that location then run my fixup_bundle(). I can't see the difference.
--
Mike Jackson <www.bluequartz.net>

On Jan 10, 2011, at 6:12 PM, Michael Jackson wrote:

> CMake 2.8.3, OS X 10.6.6, Makefiles
> 
> I am attempting to use fixup_bundle() to create my OS X app bundle. The issue I am running into is that under a certain case some common libraries that get built by the project are not being resolved correctly. Here goes the explanation:
> 
> I have a project "IPHelper.app". Part of the project is building 2 shared libraries, MXADataModel and AIMLib. I also use some of the Qt Imageformat plugins and I build my own Qt Plugins for the application.
> 
> So, I use fixup_bundle (from a .cmake file that gets configured). I have a list of the plugins (both mine and Qt's image formats) that gets passed in. I also have a list of directories to search for libraries.
> 
> Here is the snippet of CMake code:
> fixup_bundle("${CMAKE_INSTALL_PREFIX}/IPHelperApp.app" 
>             # Plugins to Install
>             "${PLUGIN_LIST}"
>             # Directories to Search for Libraries
> "/Users/mjackson/Workspace/IPHelper/Build/Bin;/Users/Shared/Toolkits/Qt-4.6.2-Cocoa/bin;/Users/Shared/Toolkits/Qt-4.6.2-Cocoa/lib;/Users/Shared/Toolkits/Qt-4.6.2-Cocoa/plugins/imageformats")
> 
> If I run "make install" I will get all the plugins but NONE of the libraries (MXADataModel and AIMLib) copied or fixed up. 
> 
> If I run "make install" where the ${PLUGIN_LIST} variable is actually blank then I get the libraries (MXADataModel and AIMLib) to resolve, copy and get fixed up, but obviously none of the plugins. I am not sure if I am doing something wrong, there is a bug in BundleUtilities or what.
> 
> Some output from the first run where I have a plugin list with some status output enabled from BundleUtilities.cmake:
> 
> -- 7/20: copying '@executable_path/../lib/libAIMLib.dylib'
> -- key='libAIMLib_dylib'
> -- item='@executable_path/../lib/libAIMLib.dylib'
> -- resolved_item='@executable_path/../lib/libAIMLib.dylib'
> -- default_embedded_path='@executable_path/../lib'
> -- embedded_item='@executable_path/../lib/libAIMLib.dylib'
> -- resolved_embedded_item='/Users/Shared/Toolkits/IPHelper/IPHelperApp.app/Contents/lib/libAIMLib.dylib'
> -- copyflag='1'
> -- 
> Error copying file "@executable_path/../lib/libAIMLib.dylib" to "/Users/Shared/Toolkits/IPHelper/IPHelperApp.app/Contents/lib/libAIMLib.dylib".
> 
> 
> and here is output from the second run:
> -- 4/10: copying '/Users/mjackson/Workspace/IPHelper/Build/Bin/libAIMLib.dylib'
> -- key='libAIMLib_dylib'
> -- item='libAIMLib.dylib'
> -- resolved_item='/Users/mjackson/Workspace/IPHelper/Build/Bin/libAIMLib.dylib'
> -- default_embedded_path='@executable_path/../lib'
> -- embedded_item='@executable_path/../lib/libAIMLib.dylib'
> -- resolved_embedded_item='/Users/Shared/Toolkits/IPHelper/IPHelperApp.app/Contents/lib/libAIMLib.dylib'
> -- copyflag='1'
> 
> I have no idea what is going on and would appreciate any enlightening thoughts. Maybe I am just not using fixup_bundle correctly.
> 
> The source is located at http://scm.bluequartz.net/eim/iphelper on the "user_init" branch. 
> 
> Thanks
> ___________________________________________________________
> Mike Jackson                      www.bluequartz.net
> Principal Software Engineer       mike.jackson at bluequartz.net 
> BlueQuartz Software               Dayton, Ohio
> 



More information about the CMake mailing list