<p>I have a large exiting C++ project involving:</p>

<ul>
<li>4 applications</li>
<li>50+ libraries</li>
<li>20+ third party libraries</li>
</ul>

<p>The project uses QMake (part of Trolltech's Qt) to build the production version on Linux, but I've been playing around at building it on MacOS.</p>

<p>I can build in on MacOS using QMake just fine but I'm having trouble producing the final .app. It needs collecting all the third party frameworks and dynamic libraries, all the project's dynamic libraries and making sure the application finds them.</p>

<p>I've read online about using install_name_tool but was wondering if there's a process to automate it.</p>

<p>(Maybe the answer is to use XCode, see related question, but it would have issues with building uic and moc)</p>

<p>Thanks </p>

[{'answer_id': 27828, 'author': 'Jérôme', 'author_id': 2796, 'author_profile': 'https://Stackoverflow.com/users/2796', 'pm_score': 3, 'selected': True, 'text': '<p>I\'m sure this could be of some great help for you :</p>\n\n<p><a href="https://blog.qt.io/blog/2007/08/23/deploying-mac-applications-without-the-hassle/" rel="nofollow noreferrer">deployqt</a></p>\n\n<p>Hope this helps !</p>\n'}, {'answer_id': 43985, 'author': 'Andy Brice', 'author_id': 455552, 'author_profile': 'https://Stackoverflow.com/users/455552', 'pm_score': 0, 'selected': False, 'text': '<p>I side-stepped this problem completely by building my Qt app statically on OS X. That might not be practical for you though.</p>\n'}, {'answer_id': 82054, 'author': 'mxcl', 'author_id': 6444, 'author_profile': 'https://Stackoverflow.com/users/6444', 'pm_score': 2, 'selected': False, 'text': '<p>We have the same problem at Last.fm, I looked at DeployQt and it\'s not much use if you have third party libraries. In the end I wrote a perl script that generates a Makefile, which you can use to generate a .app and/or .dmg.</p>\n\n<p>I uploaded it here: <a href="http://www.methylblue.com/detritus/QMake.dmg/" rel="nofollow noreferrer">http://www.methylblue.com/detritus/QMake.dmg/</a></p>\n\n<p>To use it add this to your application\'s pro file: </p>\n\n<pre><code> macx*:!macx-xcode:release {\n     system( QT=\\\'$$QT\\\' QMAKE_LIBDIR_QT=\\\'$$QMAKE_LIBDIR_QT\\\' $$ROOT_DIR/common/dist/mac/Makefile.dmg.pl $$DESTDIR $$VERSION $$LIBS &gt; Makefile.dmg )\n     QMAKE_EXTRA_INCLUDES += Makefile.dmg   \n}\n</code></pre>\n\n<p>I\'m sure it\'s not all yet portable, but it would be good for someone else to use and see if that is so.</p>\n\n<p>This is basically the first official release of this code, so please send me bug reports, and also, improvements. Thanks.</p>\n'}]
['https://Stackoverflow.com/questions/26904', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2711/']