[CMake] Small, realistic Cpack example

Mike Jackson mike.jackson at bluequartz.net
Tue Sep 16 15:41:15 EDT 2008


After some tinkering this afternoon with a small cmake project on OS X  
(based on Qt4) I was able to use the latest bits from CMake CVS to  
create a stand alone OS X bundle that correctly runs install_name_tool  
on the .app bundle and copies needed libraries into the bundle.

I have a small example project that uses just Qt4 is anyone is  
interested...

Requirements: CMake CVS. OS X. Qt4

Caveats: The new functionality places libraries in the same directory  
(MacOS) as the executable which (again philosophically only) kinda  
goes against what Apple would suggest BUT DOES WORK. David Cole who  
wrote the code was kind enough to add a hook into the code so that you  
can place dylibs in another directory if you want.

I have a more complex example where I exploit that hook to place the  
Qt4 libraries and a few other 3rd party libs into MyApp.app/Contents/ 
Libraries/*.dylib

Again, if anyone wants to look at the latest bleeding edge feel free  
to email me. I am still discussing this solution/tweaks with the CMake  
devs...


  _________________________________________________
| Mike Jackson - Principal Software Engineer      |
| BlueQuartz Software                             |
| mike.jackson at bluequartz.net                     |
| www.bluequartz.net                              |
---------------------------------------------------

On Sep 16, 2008, at 3:13 PM, Mike Arthur wrote:

> On Tuesday 16 September 2008 16:42:44 Mike Jackson wrote:
>> Philosophically I don't like the idea of
>> setting the DYLD_LIBRARY_PATH as that has some unknown implications
>> and would rather see a solution that runs install_name_tool over the
>> needed libraries to fix them up. Again, due to the lack of anything
>> else, your solution does work.
> I've written a CMake Module to do this that I've been meaning to add  
> to the
> CMake bugtracker for ages. I showed it to Alex Neundorf at Akademy  
> and he
> seemed very interested. Anyone else?
>
> -- 
> Cheers,
> Mike Arthur
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake



More information about the CMake mailing list