From f87d8885f4554da265c73114e127698f77c09335 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 5 Jan 2016 18:05:55 -0800 Subject: [PATCH] rename interface bundle for production and pr build --- cmake/macros/SetPackagingParameters.cmake | 5 ++- .../templates/RenameInterfaceBundle.cmake.in | 16 ++++++++++ interface/CMakeLists.txt | 32 +++++++++++++++---- 3 files changed, 44 insertions(+), 9 deletions(-) create mode 100644 cmake/templates/RenameInterfaceBundle.cmake.in diff --git a/cmake/macros/SetPackagingParameters.cmake b/cmake/macros/SetPackagingParameters.cmake index 0a1ff9485c..37e7d3bf3c 100644 --- a/cmake/macros/SetPackagingParameters.cmake +++ b/cmake/macros/SetPackagingParameters.cmake @@ -17,7 +17,6 @@ macro(SET_PACKAGING_PARAMETERS) set(DEPLOY_PACKAGE TRUE) set(BUILD_SEQ $ENV{JOB_ID}) 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") @@ -25,7 +24,7 @@ macro(SET_PACKAGING_PARAMETERS) set(CONSOLE_ICON "console.ico") elseif (DEFINED ENV{ghprbPullId}) set(DEPLOY_PACKAGE TRUE) - set(BETA_BUILD TRUE) + set(PR_BUILD TRUE) set(BUILD_SEQ "PR-$ENV{ghprbPullId}") set(INSTALLER_COMPANY "High Fidelity - PR") set(INSTALLER_DIRECTORY "${INSTALLER_COMPANY}\\${BUILD_SEQ}") @@ -34,7 +33,7 @@ macro(SET_PACKAGING_PARAMETERS) set(CONSOLE_ICON "console-beta.ico") else () set(BUILD_SEQ "dev") - set(BETA_BUILD TRUE) + set(DEV_BUILD TRUE) set(INSTALLER_COMPANY "High Fidelity - Dev") set(INSTALLER_DIRECTORY "${INSTALLER_COMPANY}") set(INSTALLER_NAME "dev-interface-win64.exe") diff --git a/cmake/templates/RenameInterfaceBundle.cmake.in b/cmake/templates/RenameInterfaceBundle.cmake.in new file mode 100644 index 0000000000..a579c6efe1 --- /dev/null +++ b/cmake/templates/RenameInterfaceBundle.cmake.in @@ -0,0 +1,16 @@ +# +# RenameInterfaceBundle.cmake.in +# cmake/templates +# +# Copyright 2016 High Fidelity, Inc. +# Created by Stephen Birarda on January 5, 2016 +# +# Distributed under the Apache License, Version 2.0. +# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +# + +set(SOURCE_BUNDLE "@CMAKE_INSTALL_PREFIX@/Applications/High Fidelity/interface.app") +set(DESTINATION_BUNDLE "@CMAKE_INSTALL_PREFIX@/Applications/High Fidelity/@INTERFACE_BUNDLE_NAME@.app") +message(STATUS "Renaming ${SOURCE_BUNDLE} to ${DESTINATION_BUNDLE}") + +file(RENAME ${SOURCE_BUNDLE} ${DESTINATION_BUNDLE}) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 784c34a302..91b306dad3 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -64,16 +64,19 @@ set(INTERFACE_SRCS ${INTERFACE_SRCS} "${QT_UI_HEADERS}" "${QT_RESOURCES}") if (APPLE) set(MACOSX_BUNDLE_BUNDLE_NAME "High Fidelity") - # 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 - ) + # configure CMake to use a custom Info.plist + set_target_properties(${this_target} PROPERTIES MACOSX_BUNDLE_INFO_PLIST MacOSXBundleInfo.plist.in) 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) + if (DEV_BUILD) + set(MACOSX_BUNDLE_GUI_IDENTIFIER com.highfidelity.interface-dev) + elseif (PR_BUILD) + set(MACOSX_BUNDLE_GUI_IDENTIFIER com.highfidelity.interface-pr) + endif () + set(ICON_FILENAME "interface-beta.icns") endif () @@ -210,8 +213,25 @@ if (APPLE) install(TARGETS ${TARGET_NAME} BUNDLE DESTINATION "Applications/High Fidelity" COMPONENT ${CLIENT_COMPONENT} - RENAME ${MACOSX_BUNDLE_BUNDLE_NAME} ) + + if (PRODUCTION_BUILD OR PR_BUILD) + # for a production or PR build, setup rename of produced bundle + # for production builds it becomes "High Fidelity" and PR builds are "High Fidelity" with the PR number + if (PRODUCTION_BUILD) + set(INTERFACE_BUNDLE_NAME "High Fidelity") + elseif (PR_BUILD) + set(INTERFACE_BUNDLE_NAME "High Fidelity ${BUILD_SEQ}") + endif () + + configure_file( + ${HIFI_CMAKE_DIR}/templates/RenameInterfaceBundle.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/RenameInterfaceBundle.cmake + @ONLY + ) + + set_target_properties(${TARGET_NAME} PROPERTIES POST_INSTALL_SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/RenameInterfaceBundle.cmake") + endif () else (APPLE) # copy the resources files beside the executable add_custom_command(TARGET ${TARGET_NAME} POST_BUILD