rename interface bundle for production and pr build

This commit is contained in:
Stephen Birarda 2016-01-05 18:05:55 -08:00
parent d491a7f0e5
commit f87d8885f4
3 changed files with 44 additions and 9 deletions

View file

@ -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")

View file

@ -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})

View file

@ -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