From d491a7f0e5b7de586ac5df604ff46952c465a18b Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 5 Jan 2016 17:22:07 -0800 Subject: [PATCH] work around OS X package installer relocation --- cmake/macros/GenerateInstallers.cmake | 15 +++++++++------ cmake/macros/InstallBesideConsole.cmake | 4 ++-- cmake/macros/SetPackagingParameters.cmake | 11 ++++++----- interface/CMakeLists.txt | 23 +++++++++++++++-------- 4 files changed, 32 insertions(+), 21 deletions(-) diff --git a/cmake/macros/GenerateInstallers.cmake b/cmake/macros/GenerateInstallers.cmake index 9b8b4b1b80..3645f1bc7f 100644 --- a/cmake/macros/GenerateInstallers.cmake +++ b/cmake/macros/GenerateInstallers.cmake @@ -12,14 +12,12 @@ macro(GENERATE_INSTALLERS) include(CPackComponent) - set(CPACK_PACKAGE_NAME "High Fidelity") - set(CPACK_PACKAGE_VENDOR "High Fidelity, Inc.") - set(CPACK_PACKAGE_INSTALL_DIRECTORY "High Fidelity") + set(CPACK_PACKAGE_NAME "HighFidelity") + set(CPACK_PACKAGE_VENDOR "HighFidelity") if (APPLE) - install(TARGETS ${CLIENT_TARGET} BUNDLE DESTINATION bin COMPONENT ${APP_COMPONENT}) - else () - install(TARGETS ${CLIENT_TARGET} RUNTIME DESTINATION bin COMPONENT ${APP_COMPONENT}) + set(CPACK_PACKAGE_INSTALL_DIRECTORY "/") + set(CPACK_PACKAGING_INSTALL_PREFIX /) endif () cpack_add_component(${CLIENT_COMPONENT} @@ -30,6 +28,11 @@ macro(GENERATE_INSTALLERS) DISPLAY_NAME "High Fidelity Server" ) + if (APPLE) + # we don't want the OS X package to install anywhere but the main volume, so disable relocation + set(CPACK_PACKAGE_RELOCATABLE FALSE) + endif () + include(CPack) # if (DEPLOY_PACKAGE AND WIN32) diff --git a/cmake/macros/InstallBesideConsole.cmake b/cmake/macros/InstallBesideConsole.cmake index 08515feffb..58885681f8 100644 --- a/cmake/macros/InstallBesideConsole.cmake +++ b/cmake/macros/InstallBesideConsole.cmake @@ -12,9 +12,9 @@ macro(install_beside_console) # install this component beside the installed server-console executable if (APPLE) - set(COMPONENT_DESTINATION "bin/Server Console.app/Contents/MacOS/") + set(COMPONENT_DESTINATION "Applications/High Fidelity/Server Console.app/Contents/MacOS/") else () - set(COMPONENT_DESTINATION bin) + set(COMPONENT_DESTINATION .) endif () install(TARGETS ${TARGET_NAME} RUNTIME DESTINATION ${COMPONENT_DESTINATION} COMPONENT ${SERVER_COMPONENT}) diff --git a/cmake/macros/SetPackagingParameters.cmake b/cmake/macros/SetPackagingParameters.cmake index 7f071f4c87..0a1ff9485c 100644 --- a/cmake/macros/SetPackagingParameters.cmake +++ b/cmake/macros/SetPackagingParameters.cmake @@ -14,17 +14,18 @@ macro(SET_PACKAGING_PARAMETERS) if (DEFINED ENV{JOB_ID}) - set(DEPLOY_PACKAGE 1) + set(DEPLOY_PACKAGE TRUE) set(BUILD_SEQ $ENV{JOB_ID}) - set(BUILD_TAGGED_BETA FALSE) + set(PRODUCTION_BUILD TRUE) + set(BETA_BUILD FALSE) set(INSTALLER_COMPANY "High Fidelity") set(INSTALLER_DIRECTORY "${INSTALLER_COMPANY}") set(INSTALLER_NAME "interface-win64-${BUILD_SEQ}.exe") set(INTERFACE_ICON "interface.ico") set(CONSOLE_ICON "console.ico") elseif (DEFINED ENV{ghprbPullId}) - set(DEPLOY_PACKAGE 1) - set(BUILD_TAGGED_BETA TRUE) + set(DEPLOY_PACKAGE TRUE) + set(BETA_BUILD TRUE) set(BUILD_SEQ "PR-$ENV{ghprbPullId}") set(INSTALLER_COMPANY "High Fidelity - PR") set(INSTALLER_DIRECTORY "${INSTALLER_COMPANY}\\${BUILD_SEQ}") @@ -33,7 +34,7 @@ macro(SET_PACKAGING_PARAMETERS) set(CONSOLE_ICON "console-beta.ico") else () set(BUILD_SEQ "dev") - set(BUILD_TAGGED_BETA TRUE) + set(BETA_BUILD TRUE) set(INSTALLER_COMPANY "High Fidelity - Dev") set(INSTALLER_DIRECTORY "${INSTALLER_COMPANY}") set(INSTALLER_NAME "dev-interface-win64.exe") diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 3c8e9879b2..784c34a302 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -62,15 +62,18 @@ set(INTERFACE_SRCS ${INTERFACE_SRCS} "${QT_UI_HEADERS}" "${QT_RESOURCES}") # qt5_create_translation_custom(${QM} ${INTERFACE_SRCS} ${QT_UI_FILES} ${TS}) if (APPLE) - # configure CMake to use a custom Info.plist - SET_TARGET_PROPERTIES( ${this_target} PROPERTIES MACOSX_BUNDLE_INFO_PLIST MacOSXBundleInfo.plist.in ) + set(MACOSX_BUNDLE_BUNDLE_NAME "High Fidelity") - set(MACOSX_BUNDLE_BUNDLE_NAME Interface) - set(MACOSX_BUNDLE_GUI_IDENTIFIER io.highfidelity.Interface) + # configure CMake to use a custom Info.plist and to produce a .app with the correct name + set_target_properties(${this_target} PROPERTIES + MACOSX_BUNDLE_INFO_PLIST MacOSXBundleInfo.plist.in + ) - if (UPPER_CMAKE_BUILD_TYPE MATCHES RELEASE OR UPPER_CMAKE_BUILD_TYPE MATCHES RELWITHDEBINFO) + if (PRODUCTION_BUILD) + set(MACOSX_BUNDLE_GUI_IDENTIFIER com.highfidelity.interface) set(ICON_FILENAME "interface.icns") else () + set(MACOSX_BUNDLE_GUI_IDENTIFIER com.highfidelity.interface-dev) set(ICON_FILENAME "interface-beta.icns") endif () @@ -190,7 +193,7 @@ target_link_libraries( # Issue causes build failure unless we add this directory. # See https://bugreports.qt.io/browse/QTBUG-43351 if (WIN32) - add_paths_to_fixup_libs(${Qt5_DIR}/../../../plugins/qtwebengine) + add_paths_to_fixup_libs(${Qt5_DIR}/../../../plugins/qtwebengine) endif() # assume we are using a Qt build without bearer management @@ -204,7 +207,11 @@ if (APPLE) target_link_libraries(${TARGET_NAME} ${OpenGL} ${AppKit}) # setup install of OS X interface bundle - install(TARGETS ${TARGET_NAME} BUNDLE DESTINATION bin COMPONENT ${CLIENT_COMPONENT}) + install(TARGETS ${TARGET_NAME} + BUNDLE DESTINATION "Applications/High Fidelity" + COMPONENT ${CLIENT_COMPONENT} + RENAME ${MACOSX_BUNDLE_BUNDLE_NAME} + ) else (APPLE) # copy the resources files beside the executable add_custom_command(TARGET ${TARGET_NAME} POST_BUILD @@ -217,7 +224,7 @@ else (APPLE) ) # setup install of interface target - install(TARGETS ${TARGET_NAME} RUNTIME DESTINATION bin COMPONENT ${CLIENT_COMPONENT}) + install(TARGETS ${TARGET_NAME} RUNTIME DESTINATION . COMPONENT ${CLIENT_COMPONENT}) # link target to external libraries if (WIN32)