Skip to content
Snippets Groups Projects
Commit 2204d16d authored by Ammar Nejati's avatar Ammar Nejati
Browse files

App/CMakeLists.txt: Configure the zsh script to adjust the MacOS bundle

parent 3e8d6cc6
No related branches found
No related tags found
1 merge request!795Repair the MacOS bundle (.dmg package)
...@@ -68,9 +68,9 @@ if(APPLE) ...@@ -68,9 +68,9 @@ if(APPLE)
PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${BUILD_VAR_DIR}/Info.plist) PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${BUILD_VAR_DIR}/Info.plist)
if(BA_APPLE_BUNDLE) if(BA_APPLE_BUNDLE)
# this makes sense only if we build a bundle set(link_flags
set(link_flags "-Wl,-rpath,@loader_path/../Frameworks/ \ "-Wl,-rpath,@loader_path/../lib -Wl,-rpath,@loader_path/../Frameworks/ \
-Wl,-rpath,@loader_path/../lib/BornAgain-${BornAgain_VERSION_MAJOR}.${BornAgain_VERSION_MINOR}/") -Wl,-rpath,@loader_path/../lib/BornAgain-${BornAgain_VERSION_MAJOR}.${BornAgain_VERSION_MINOR}/")
else() else()
set(link_flags "-Wl,-rpath,\ set(link_flags "-Wl,-rpath,\
@loader_path/../../../lib/BornAgain-${BornAgain_VERSION_MAJOR}.${BornAgain_VERSION_MINOR}/") @loader_path/../../../lib/BornAgain-${BornAgain_VERSION_MAJOR}.${BornAgain_VERSION_MINOR}/")
...@@ -103,7 +103,39 @@ if(BA_APPLE_BUNDLE) ...@@ -103,7 +103,39 @@ if(BA_APPLE_BUNDLE)
DESTINATION ${destination_bundle}/Contents/Resources/) DESTINATION ${destination_bundle}/Contents/Resources/)
install(FILES ${CMAKE_SOURCE_DIR}/cmake/configurables/qt.conf install(FILES ${CMAKE_SOURCE_DIR}/cmake/configurables/qt.conf
DESTINATION ${destination_bundle}/Contents/Resources/) DESTINATION ${destination_bundle}/Contents/Resources/)
configure_file(${CMAKE_SOURCE_DIR}/cmake/configurables/FixAppleBundle.cmake.in
${BUILD_VAR_DIR}/FixAppleBundle.cmake @ONLY) # adjust MacOS bundle
install(SCRIPT ${BUILD_VAR_DIR}/FixAppleBundle.cmake COMPONENT Runtime) set(MACPK_ROOT_DIR "${CMAKE_INSTALL_PREFIX}/${destination_prefix}")
set(MACPK_MAIN_EXE "${executable_name}")
set(MACPK_QTDIR "${Qt_DIR}")
# NOTE: Only cerf and formfactor libraries should be passed;
# other libraries will be found automatically.
set(MACPK_EXTRA_LIBS
${Cerf_LIBRARIES}
${FormFactor_LIBRARIES}
)
# list of required Qt plugins (paths relative to Qt root dir)
set(MACPK_QT_PLUGINS
plugins/platforms/libqcocoa.dylib
plugins/iconengines/libqsvgicon.dylib
plugins/imageformats/libqjpeg.dylib
plugins/imageformats/libqsvg.dylib
plugins/styles/libqmacstyle.dylib
)
# Qt plugins directory in within the MacOS bundle
set(MACPK_QT_PLUGINS_DIR PlugIns) # conform to settings in `qt.conf`
# convert CMake list to space-separated lists
string(REPLACE ";" " " MACPK_EXTRA_LIBS "${MACPK_EXTRA_LIBS}")
string(REPLACE ";" " " MACPK_QT_PLUGINS "${MACPK_QT_PLUGINS}")
configure_file(
${CMAKE_SOURCE_DIR}/cmake/configurables/FixAppleBundle.cmake.in
${BUILD_VAR_DIR}/FixAppleBundle.cmake @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/devtools/deploy/shutils.zsh"
"${BUILD_VAR_DIR}/shutils.zsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/devtools/deploy/adjust_mac_bundle.zsh"
"${BUILD_VAR_DIR}/adjust_mac_bundle.zsh" @ONLY)
set(CPACK_PRE_BUILD_SCRIPTS "${BUILD_VAR_DIR}/FixAppleBundle.cmake")
install(SCRIPT ${BUILD_VAR_DIR}/FixAppleBundle.cmake)
endif() endif()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment