[CMake] OsX bundle including Qt framework
Werner Smekal
smekal at iap.tuwien.ac.at
Wed Feb 24 09:33:43 EST 2010
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Martin,
>
> I use cmake to make an osx bundle of my qt application. During
> install I copy qt framework from my qt install dir to the Frameworks
> directory of my bundle.
This will be done automagically using the BundleUtilities module. E.g.
in my project I do:
# fixup bundle, copy dynamic libraries into app bundle
set(APPS "\${CMAKE_INSTALL_PREFIX}/${SESSA_BUNDLE_NAME}.app") # paths
to executables
set(DIRS "${CMAKE_SOURCE_DIR}/local/Release/lib") # directories to
search for prerequisites
INSTALL(CODE "
include(BundleUtilities)
fixup_bundle(\"${APPS}\" \"\" \"${DIRS}\")
")
Look in the mailing list or in the net about BundleUtilities to get more
information, or look in the module.
>
> The problem I have now is that when using “ostool –L “ I see that my
> executable look for qt frameworks in a dir which is the absolute path
> to my qt install dir.
Reason is, that if you link to a library, the reference inside the
*library* (use otool -L on that library) is used and set in the
executable as well. You need at least to set the new reference
(@executable_path/....) in the executable, so that it can find the
libraries (if libraries depend on other libraries you need to change
that as well). Use install_name_tool for that.
But everything is done by the BundleUtilities macro, so you don't need
to mess around here.
HTH,
Werner
>
> What I want is for my executable to look in the “Frameworks”
> directory of my bundle.
>
>
>
> Is there a way to do that directly during build using Cmake?
>
>
>
> Thanks
>
>
>
> MArtin
>
>
>
> _______________________________________________ Powered by
> www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
- --
Dr. Werner Smekal
Institut fuer Angewandte Physik
Technische Universitaet Wien
Wiedner Hauptstr 8-10/134
A-1040 Wien
Austria
DVR-Nr: 0005886
email: smekal at iap.tuwien.ac.at (GPG: EDCAF4A79)
web: http://www.iap.tuwien.ac.at/~smekal
phone: +43-(0)1-58801-13463 (office)
+43-(0)1-58801-13469 (laboratory)
fax: +43-(0)1-58801-13499
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJLhTjHAAoJEG1QQcXtyvSnRK0H/3NwjN7DB7IH339Szs0iqTMf
3ONaiP0IIjdzer2Ak4Ao3+Yl+vVksyGCaeB/goYEy5mBbLxLNHIjY71+pS2zNk4L
62tAolQZCJfRzxv9mQVZsX92wHw5DC1mtPnyqWl1DuQu4lrp+WVQlfareC25keI/
1TBndC7A74uTz9IZJWOkUZRUgK9uHD8MRWBL4ujYJw0ocghHYjbeSxySrAGBC/oG
DRp8l6N3UfFzTRVE+FZUnBdKcMkSTQXTdzK6oBtszKwJxkCKbcI94lAOgYqA49kU
TWcxwQEbYXoXXFzI1Qo5evG2NgjDmicHluXnSuNNMTkVGoxnJbECZcoi3d5dlJU=
=TUd7
-----END PGP SIGNATURE-----
More information about the CMake
mailing list