[CMake] CMake 3.0, Qt 5, plugins and multiple executables inside OS X Bundle

Romain Leguay romain.leguay at gmail.com
Wed Aug 6 04:46:52 EDT 2014


Hello everyone,

I have a Qt application that search for another Qt applications and some 
plugins too. On Windows, I just create the executables in the same 
folder but on Mac OS X, I can't do that: I must create a bundle like this:
MyApplication.app/
         Contents/
             Frameworks/
                 **all qt library**
                 **all application dependencies**
                 libPluginInterface.dylib
             Resources/
                **application icon**
             MacOS/
                 MyApplication
                 subApplication1
                 subApplication2
             PlugIns/
                  **all my plugins** (.dylib)

When I'll open MyApplication.app, I'd like to launch MyApplication 
executable.

For now, my applications and plugins are store like this:
Project/
     CMakeLists.txt
     MyApplication/
         CMakeLists.txt
          **source_files**
     PluginInterface/
         CMakeLists.txt
          **source_files**
     subApplication1/
         CMakeLists.txt
         **source_files**
     subApplication2/
         CMakeLists.txt
         **source_files**
      plugins/
         CMakeLists.txt
         plugin1/
             CMakeLists.txt
             **source_files**

MyApplication and all the plugins depends on PluginInterface (a shared 
library).

For now, I have many difficulties about the link path. I don't 
understand very well how to use @rpath for my libraries.

So, my first question: is-it possible to do something like this?
Second, can you show me some examples about this please?

Thank you.

Romain


More information about the CMake mailing list