From 96316119fd57b1d5acdfc0ff51e1766a9311f11f Mon Sep 17 00:00:00 2001 From: "R. van Twisk" Date: Thu, 19 Dec 2019 21:07:19 +0100 Subject: Fix bundle creation OSX --- cmake/opentrack-boilerplate.cmake | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) (limited to 'cmake/opentrack-boilerplate.cmake') diff --git a/cmake/opentrack-boilerplate.cmake b/cmake/opentrack-boilerplate.cmake index ffa4ea02..7e9231ed 100644 --- a/cmake/opentrack-boilerplate.cmake +++ b/cmake/opentrack-boilerplate.cmake @@ -61,8 +61,8 @@ function(otr_glob_sources var) endfunction() function(otr_fixup_subsystem n) - otr_find_msvc_editbin(editbin-pathname) if(MSVC) + otr_find_msvc_editbin(editbin-pathname) set(subsystem WINDOWS) get_property(type TARGET "${n}" PROPERTY TYPE) if (NOT type STREQUAL "STATIC_LIBRARY") @@ -143,15 +143,17 @@ function(otr_module n_) set(arg_NO-I18N TRUE) endif() - if(NOT WIN32) - set(subsys "") - elseif(arg_WIN32-CONSOLE) - set(subsys "") - else() - set(subsys "WIN32") - endif() - if(arg_EXECUTABLE) + if (APPLE) + set(subsys "MACOSX_BUNDLE") + elseif(NOT WIN32) + set(subsys "") + elseif(arg_WIN32-CONSOLE) + set(subsys "") + else() + set(subsys "WIN32") + endif() + add_executable(${n} ${subsys} "${${n}-all}") set_target_properties(${n} PROPERTIES SUFFIX "${opentrack-binary-suffix}" @@ -216,12 +218,23 @@ function(otr_module n_) endif() if(NOT arg_NO-INSTALL) + # Librarys/executable if(arg_BIN) - install(TARGETS "${n}" + if (APPLE) + install(TARGETS "${n}" + RUNTIME DESTINATION ${opentrack-hier-bin} + BUNDLE DESTINATION ${opentrack-hier-bin} + LIBRARY DESTINATION ${opentrack-hier-bin}/opentrack.app/Contents/MacOS/ + RESOURCE DESTINATION ${opentrack-hier-bin}/opentrack.app/Resource + PERMISSIONS ${opentrack-perms-exec}) + else() + install(TARGETS "${n}" RUNTIME DESTINATION ${opentrack-hier-bin} LIBRARY DESTINATION ${opentrack-hier-pfx} PERMISSIONS ${opentrack-perms-exec}) + endif() else() + # Plugins install(TARGETS "${n}" ${opentrack-hier-str} PERMISSIONS ${opentrack-perms-exec}) endif() -- cgit v1.2.3 From b84e9dfedbbd16470532312e16ee03c50453d438 Mon Sep 17 00:00:00 2001 From: "R. van Twisk" Date: Fri, 27 Dec 2019 22:31:59 +0100 Subject: Add xplane and aruco Add documentsion, source and xplane to DMG --- cmake/opentrack-boilerplate.cmake | 2 +- cmake/opentrack-hier.cmake | 2 +- cmake/opentrack-platform.cmake | 7 +++++-- macosx/make-app-bundle.sh | 20 +++++++++++--------- 4 files changed, 18 insertions(+), 13 deletions(-) (limited to 'cmake/opentrack-boilerplate.cmake') diff --git a/cmake/opentrack-boilerplate.cmake b/cmake/opentrack-boilerplate.cmake index 7e9231ed..958403cc 100644 --- a/cmake/opentrack-boilerplate.cmake +++ b/cmake/opentrack-boilerplate.cmake @@ -224,7 +224,7 @@ function(otr_module n_) install(TARGETS "${n}" RUNTIME DESTINATION ${opentrack-hier-bin} BUNDLE DESTINATION ${opentrack-hier-bin} - LIBRARY DESTINATION ${opentrack-hier-bin}/opentrack.app/Contents/MacOS/ + LIBRARY DESTINATION ${opentrack-hier-bin}/Library RESOURCE DESTINATION ${opentrack-hier-bin}/opentrack.app/Resource PERMISSIONS ${opentrack-perms-exec}) else() diff --git a/cmake/opentrack-hier.cmake b/cmake/opentrack-hier.cmake index c94c6d57..8e9e3db8 100644 --- a/cmake/opentrack-hier.cmake +++ b/cmake/opentrack-hier.cmake @@ -18,7 +18,7 @@ if(APPLE) set(opentrack-doc-src-pfx "./source-code") set(opentrack-i18n-pfx "opentrack.app/Contents/Resources") # used during install set(opentrack-i18n-path "../Resources/i18n") # used in application - set(opentrack-install-rpath "./") + set(opentrack-install-rpath "../Frameworks") set(opentrack-hier-str RUNTIME DESTINATION ${opentrack-hier-pfx} LIBRARY DESTINATION ${opentrack-hier-pfx}) elseif(WIN32) set(opentrack-hier-pfx "modules") diff --git a/cmake/opentrack-platform.cmake b/cmake/opentrack-platform.cmake index 35de63a4..bb7fb1f8 100644 --- a/cmake/opentrack-platform.cmake +++ b/cmake/opentrack-platform.cmake @@ -43,11 +43,15 @@ set(CMAKE_CXX_STANDARD_DEFAULT 17) set(CMAKE_CXX_STANDARD_REQUIRED TRUE) set(CMAKE_CXX_EXTENSIONS FALSE) -IF (NOT APPLE) +if (NOT APPLE) set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) set(CMAKE_SKIP_INSTALL_RPATH FALSE) set(CMAKE_SKIP_RPATH FALSE) +else() + set(CMAKE_SKIP_BUILD_RPATH FALSE) + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + set(CMAKE_MACOSX_RPATH OFF) endif() set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC OFF) @@ -56,7 +60,6 @@ set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) set(CMAKE_C_VISIBILITY_PRESET hidden) set(CMAKE_CXX_VISIBILITY_PRESET hidden) -set(CMAKE_MACOSX_RPATH OFF) if(NOT WIN32 AND NOT APPLE) include(opentrack-pkg-config) diff --git a/macosx/make-app-bundle.sh b/macosx/make-app-bundle.sh index 5453c2cc..fc78f428 100755 --- a/macosx/make-app-bundle.sh +++ b/macosx/make-app-bundle.sh @@ -24,7 +24,7 @@ tmp="$(mktemp -d "/tmp/$APPNAME-tmp.XXXXXXX")" test $? -eq 0 || exit 1 # Add framework and other libraries -macdeployqt "$install/$APPNAME.app" -libpath="$install/$APPNAME.app/Contents/MacOS" +macdeployqt "$install/$APPNAME.app" -libpath="$install/Library" # Fixup dylib linker issues sh "$dir/install-fail-tool" "$install/$APPNAME.app/Contents/Frameworks" @@ -54,26 +54,28 @@ rm -rf "$tmp" #Build DMG #https://github.com/andreyvit/create-dmg -rm -rf $install/../$version.dmg +rm -rf $install/../*.dmg create-dmg \ --volname "$APPNAME" \ --volicon "$install/$APPNAME.app/Contents/Resources/$APPNAME.icns" \ --window-pos 200 120 \ --window-size 800 450 \ - --icon-size 100 \ + --icon-size 80 \ --background "$dir/dmgbackground.png" \ - --icon "$APPNAME.app" 200 190 \ + --icon "$APPNAME.app" 200 180 \ + --app-drop-link 420 180 \ --hide-extension "$APPNAME.app" \ - --app-drop-link 600 185 \ + --add-folder "Document" "$install/doc" 20 40 \ + --add-folder "source-code" "$install/source-code" 220 40 \ + --add-folder "Xplane-Plugin" "$install/xplane" 420 40 \ "$version.dmg" \ "$install/$APPNAME.app" # Check if we have a DMG otherwise fail -FILE=$install/../$version.dmg +FILE=$install/../$version.dmg if [ -f $FILE ]; then - ls -ial $install/../*.dmg - exit 0 + ls -ial $install/../*.dmg else - echo "Failed to create $FILE" + echo "Failed to create ${FILE}" exit 2 fi -- cgit v1.2.3