[CMake] MacOSX, Qt plugins and BundleUtilities -- not building proper bundle?
kent williams
nkwmailinglists at gmail.com
Mon Oct 25 11:58:01 EDT 2010
Like everyone else I started here to build my Qt app with CMake:
http://www.cmake.org/Wiki/BundleUtilitiesExample
Like a lot of things in CMake this involves copying a bunch of brittle
CMake code into your CMakeLists.txt, and seems like it has too many
moving parts and failure points, but hey, we shouldn't look a gift
horse in the mouth, right?
Well, now I understand a little better than when I started about what
is going on, and I don't think the right things are happening, when it
comes to plugins.
There is this code:
#--------------------------------------------------------------------------------
# Install needed Qt plugins by copying directories from the qt installation
# One can cull what gets copied by using 'REGEX "..." EXCLUDE'
INSTALL(DIRECTORY "${QT_PLUGINS_DIR}/imageformats" DESTINATION
${plugin_dest_dir}/plugins COMPONENT Runtime)
I don't know what to make of this, because according to CMake
documentation, this should recursively copy the imageformats directory
into the app bundle. But when I examine the created bundle
<appname>.app/Contents/MacOS/plugins is empty.
But when fixup_bundle does its magic, it copies all the imageformat
shared libraries into <appname>.app/Contents/MacOS/plugins
And furthermore, could the Qt.conf file be used to better organize an
app bundle? At this point it gets created as an empty file in
<appname>.app/Contents/Resources/qt.conf
According to http://doc.qt.nokia.com/4.7/qt-conf.html
I could just buck up and do the work to get my app bundle organized
properly, but I think this is something that should probably be part
of the CMake distribution -- there should be a more streamlined,
simpler way to deploy proper app bundles.
More information about the CMake
mailing list