From 7f2476f0f82ecd9d7deb1de41e460187ba59f16f Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Thu, 4 Aug 2016 10:25:52 -0700 Subject: [PATCH] put pack macdeployqt call, but still removed qtwebprocess --- cmake/macros/FixupInterface.cmake | 37 +++++++++++++++++++++++++++++++ interface/CMakeLists.txt | 3 +++ 2 files changed, 40 insertions(+) create mode 100644 cmake/macros/FixupInterface.cmake diff --git a/cmake/macros/FixupInterface.cmake b/cmake/macros/FixupInterface.cmake new file mode 100644 index 0000000000..93b5cc25fb --- /dev/null +++ b/cmake/macros/FixupInterface.cmake @@ -0,0 +1,37 @@ +# +# FixupInterface.cmake +# cmake/macros +# +# Copyright 2016 High Fidelity, Inc. +# Created by Stephen Birarda on January 6th, 2016 +# +# Distributed under the Apache License, Version 2.0. +# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +# + +macro(fixup_interface) + if (APPLE) + + string(REPLACE " " "\\ " ESCAPED_BUNDLE_NAME ${INTERFACE_BUNDLE_NAME}) + string(REPLACE " " "\\ " ESCAPED_INSTALL_PATH ${INTERFACE_INSTALL_DIR}) + set(_INTERFACE_INSTALL_PATH "${ESCAPED_INSTALL_PATH}/${ESCAPED_BUNDLE_NAME}.app") + + find_program(MACDEPLOYQT_COMMAND macdeployqt PATHS "${QT_DIR}/bin" NO_DEFAULT_PATH) + + if (NOT MACDEPLOYQT_COMMAND AND (PRODUCTION_BUILD OR PR_BUILD)) + message(FATAL_ERROR "Could not find macdeployqt at ${QT_DIR}/bin.\ + It is required to produce an relocatable interface application.\ + Check that the environment variable QT_DIR points to your Qt installation.\ + ") + endif () + + install(CODE " + execute_process(COMMAND ${MACDEPLOYQT_COMMAND}\ + \${CMAKE_INSTALL_PREFIX}/${_INTERFACE_INSTALL_PATH}/\ + -verbose=2 -qmldir=${CMAKE_SOURCE_DIR}/interface/resources/qml/\ + )" + COMPONENT ${CLIENT_COMPONENT} + ) + + endif () +endmacro() diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 863595c174..f712c4cc21 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -274,6 +274,9 @@ if (APPLE) $/../Resources/scripts ) + # call the fixup_interface macro to add required bundling commands for installation + fixup_interface() + else (APPLE) # copy the resources files beside the executable add_custom_command(TARGET ${TARGET_NAME} POST_BUILD