CMake fixup_bundle for multiple executables
I am running a project that has the following structure:
root/
---Applications/
---Application1/
---Application2/
---Modules/
---Library1/
---Library2/
So far, all building and linking projects works fine on Windows and Linux machines, using Qt5 and OpenCV as dependencies. All generated files should be copied to the final installation path:
INSTALL_DIR/
---bin/ #(for runtime)
---include/ #(for .h files)
---lib/ #(for lib files)
Problems arise when I want to create a redistributable package. I managed to create a script for each application:
include("${CMAKE_ROOT}/Modules/BundleUtilities.cmake")
fixup_bundle("@APPLICATION_PATH@" "@LIB_DEPS@" "@LIB_LOCS@")
So, unfortunately, the fixup_bundle gets called in the same way as the number of my apps and it takes a long time, especially on Windows.
How do I create a unique install script that only executes the fixup_bundle once ?
Thank you in advance
source to share
Now I see the problem.
It looks like this issue was discussed on the CMake mailing list .
The OP described this approach, which was considered reasonable.
- Install all common 3rdparty dependent libraries somewhere in / Library / Application Support.
- Install small shell scripts for both apps that set DYLD_LIBRARY_PATH to point to where 3rdparty libraries are installed, then run the app.
The Kitware CMake quiz describes a similar approach where shared libraries are installed as the OSX Framework.
http://www.cmake.org/Wiki/CMake:MacOSX_Frameworks
It says, "The creation of frameworks is just beginning." but it looks like it hasn't updated in a while.
It looks like it's just not something that CMake easily does out of the box at the moment.
I found an example CMakeLists.txt that installs the OSX Framework.
source to share