Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, July 2007
Advice on OSX deployment


Message 1 in thread

Hi everybody! I'm starting a new project with Qt 4.2 under osx, and I'd 
like some advice, from your experience, before starting.

I use XCode as the main IDE, and I have read that there is no automated 
copying and install_name_tool'ing for the Qt frameworks. That part is 
done manually. Is that right?

What do you think it would be the ``best'' and most automated 
deployment of Qt applications under OSX (universal applications)? 
Having statically linked libraries? Frameworks?

All your experiences and hassles found on the path are welcome :)


-- 
 [ signature omitted ] 

Message 2 in thread

Sensei wrote:
> Hi everybody! I'm starting a new project with Qt 4.2 under osx, and I'd 
> like some advice, from your experience, before starting.
> 
> I use XCode as the main IDE, and I have read that there is no automated 
> copying and install_name_tool'ing for the Qt frameworks. That part is 
> done manually. Is that right?
> 
> What do you think it would be the ``best'' and most automated deployment 
> of Qt applications under OSX (universal applications)? Having statically 
> linked libraries? Frameworks?

Statically linking is bar far easier in terms of deployment on the Mac.

That said, you can write a simple XCode post-build script that does the 
"install_name_tool'ing" for you.

-- 
 [ signature omitted ] 

Message 3 in thread

On 2007-07-02 13:00:01 -0400, Sensei <senseiwa@xxxxxxx> said:

> Hi everybody! I'm starting a new project with Qt 4.2 under osx, and I'd 
> like some advice, from your experience, before starting.
> 
> I use XCode as the main IDE, and I have read that there is no automated 
> copying and install_name_tool'ing for the Qt frameworks. That part is 
> done manually. Is that right?
> 
> What do you think it would be the ``best'' and most automated 
> deployment of Qt applications under OSX (universal applications)? 
> Having statically linked libraries? Frameworks?
> 
> All your experiences and hassles found on the path are welcome :)

<start small rant>
 WELL, if Trolltech would decide to actually support the configure 
option to set the "rpath" on OS X (it doesn't work. I have put bug 
reports in, they don't get fixed) then one major hurdle to EASY OS X 
deployment is solved. No install_name_tool crap, no special shell 
scripts copy frameworks. Nothing.
</end small rant>

The other hurdle is to copy the frameworks into the application bundle. 
This is done inside Xcode with a "Copy Files" build phase. This is 
something that you, the developer, add to your Xcode project. In Xcode 
2.4.1, go to the "Project" menu, then to "New Build Phase" then to "New 
Copy Files Build Phase". This will bring up a dialog where there is a 
drop down menu. Select "Frameworks" from the menu. Do not do anything 
else. Close this window. Now select the Qt Frameworks that are listed 
in your Xcode project window and drag them onto the "Copy Files" Icon 
that has appeared under your "Targets" icon. DONE. Click the Build 
button. Xcode will compile your app and copy all the frameworks that 
you tell it into your App bundle. Easy as pie.

#------------
Under the "Additional Options" in the configure --help

    -R <string> ........ Add an explicit runtime library path to the Qt
                         libraries.

I use this and I _still_ get /usr/local/lib/* as my rpath. What _needs_ 
to be there is:

@executable_path/../Frameworks or
@executable_path/../PlugIns  (for the case of Dynamic Libraries)


Seriously though, it really is that easy. We just need some assumptions 
about build environments to be fixed by Trolltech.

Cheers, Peace, No Hard Feelings
Mike Jackson

--
 [ signature omitted ]