From a4787bcf29a23c1526946a17835238407553828b Mon Sep 17 00:00:00 2001 From: David Rowe Date: Tue, 6 Apr 2021 11:46:13 +1200 Subject: [PATCH] Move OSX items into root directory of DMG --- cmake/macros/GenerateInstallers.cmake | 24 +++++++++++++---------- cmake/macros/SetPackagingParameters.cmake | 10 +++++----- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/cmake/macros/GenerateInstallers.cmake b/cmake/macros/GenerateInstallers.cmake index e09a7dc322..15690f6012 100644 --- a/cmake/macros/GenerateInstallers.cmake +++ b/cmake/macros/GenerateInstallers.cmake @@ -96,19 +96,23 @@ macro(GENERATE_INSTALLERS) set(CPACK_PACKAGING_INSTALL_PREFIX /) set(CPACK_OSX_PACKAGE_VERSION ${CMAKE_OSX_DEPLOYMENT_TARGET}) - # make sure a High Fidelity directory exists, in case this hits prior to other installs - install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${DMG_SUBFOLDER_NAME}\")") + # Create folder if used. + if (NOT INTERFACE_INSTALL_DIR STREQUAL ".") + # make sure a High Fidelity directory exists, in case this hits prior to other installs + install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${DMG_SUBFOLDER_NAME}\")") - # add the resource file to the Icon file inside the folder - install(CODE - "execute_process(COMMAND Rez -append ${DMG_SUBFOLDER_ICON} -o \${CMAKE_INSTALL_PREFIX}/${ESCAPED_DMG_SUBFOLDER_NAME}/Icon\\r)" - ) + # add the resource file to the Icon file inside the folder + install(CODE + "execute_process(COMMAND Rez -append ${DMG_SUBFOLDER_ICON} -o \${CMAKE_INSTALL_PREFIX}/${ESCAPED_DMG_SUBFOLDER_NAME}/Icon\\r)" + ) - # modify the folder to use that custom icon - install(CODE "execute_process(COMMAND SetFile -a C \${CMAKE_INSTALL_PREFIX}/${ESCAPED_DMG_SUBFOLDER_NAME})") + # modify the folder to use that custom icon + install(CODE "execute_process(COMMAND SetFile -a C \${CMAKE_INSTALL_PREFIX}/${ESCAPED_DMG_SUBFOLDER_NAME})") + + # hide the special Icon? file + install(CODE "execute_process(COMMAND SetFile -a V \${CMAKE_INSTALL_PREFIX}/${ESCAPED_DMG_SUBFOLDER_NAME}/Icon\\r)") + endif () - # hide the special Icon? file - install(CODE "execute_process(COMMAND SetFile -a V \${CMAKE_INSTALL_PREFIX}/${ESCAPED_DMG_SUBFOLDER_NAME}/Icon\\r)") endif () # configure a cpack properties file for custom variables in template diff --git a/cmake/macros/SetPackagingParameters.cmake b/cmake/macros/SetPackagingParameters.cmake index d7f1aa2786..6ab903b739 100644 --- a/cmake/macros/SetPackagingParameters.cmake +++ b/cmake/macros/SetPackagingParameters.cmake @@ -125,10 +125,10 @@ macro(SET_PACKAGING_PARAMETERS) set(DMG_SUBFOLDER_ICON "${HF_CMAKE_DIR}/installer/install-folder.rsrc") - set(CONSOLE_INSTALL_DIR ${DMG_SUBFOLDER_NAME}) - set(INTERFACE_INSTALL_DIR ${DMG_SUBFOLDER_NAME}) - set(SCREENSHARE_INSTALL_DIR ${DMG_SUBFOLDER_NAME}) - set(NITPICK_INSTALL_DIR ${DMG_SUBFOLDER_NAME}) + set(CONSOLE_INSTALL_DIR ".") + set(INTERFACE_INSTALL_DIR ".") + set(SCREENSHARE_INSTALL_DIR ".") + set(NITPICK_INSTALL_DIR ".") if (CLIENT_ONLY) set(CONSOLE_EXEC_NAME "Console.app") @@ -147,7 +147,7 @@ macro(SET_PACKAGING_PARAMETERS) set(SCREENSHARE_APP_CONTENTS "${SCREENSHARE_INSTALL_APP_PATH}/Contents") - set(INTERFACE_INSTALL_APP_PATH "${CONSOLE_INSTALL_DIR}/${INTERFACE_BUNDLE_NAME}.app") + set(INTERFACE_INSTALL_APP_PATH "${INTERFACE_INSTALL_DIR}/${INTERFACE_BUNDLE_NAME}.app") set(INTERFACE_ICON_FILENAME "${INTERFACE_ICON_PREFIX}.icns") set(NITPICK_ICON_FILENAME "${NITPICK_ICON_PREFIX}.icns") else ()