From e00481ddfbc3a5ce38dc59a72431c492f68231ef Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 21 Jan 2016 17:17:28 -0800 Subject: [PATCH 1/2] use macdeployqt for fixup of components --- cmake/macros/InstallBesideConsole.cmake | 28 +++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/cmake/macros/InstallBesideConsole.cmake b/cmake/macros/InstallBesideConsole.cmake index e30a25a0f8..6c8969dded 100644 --- a/cmake/macros/InstallBesideConsole.cmake +++ b/cmake/macros/InstallBesideConsole.cmake @@ -14,7 +14,8 @@ macro(install_beside_console) # install this component beside the installed server-console executable if (APPLE) set(CONSOLE_APP_CONTENTS "${CONSOLE_INSTALL_APP_PATH}/Contents") - set(COMPONENT_DESTINATION "${CONSOLE_APP_CONTENTS}/MacOS/Components.app/Contents/MacOS") + set(COMPONENT_APP_PATH "${CONSOLE_APP_CONTENTS}/MacOS/Components.app") + set(COMPONENT_DESTINATION "${COMPONENT_APP_PATH}/Contents/MacOS") else () set(COMPONENT_DESTINATION ${CONSOLE_INSTALL_DIR}) endif () @@ -55,13 +56,28 @@ macro(install_beside_console) endif () if (APPLE) - # during the install phase, call fixup to drop the shared libraries for these components in the right place + 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 () + + # during the install phase, call macdeployqt to drop the shared libraries for these components in the right place + set(COMPONENTS_BUNDLE_PATH "\${CMAKE_INSTALL_PREFIX}/${COMPONENT_APP_PATH}") + string(REPLACE " " "\\ " ESCAPED_BUNDLE_NAME ${COMPONENTS_BUNDLE_PATH}) + set(EXECUTABLE_NEEDING_FIXUP "\${CMAKE_INSTALL_PREFIX}/${COMPONENT_DESTINATION}/${TARGET_NAME}") + string(REPLACE " " "\\ " ESCAPED_EXECUTABLE_NAME ${EXECUTABLE_NEEDING_FIXUP}) + install(CODE " - include(BundleUtilities) - fixup_bundle(\"${EXECUTABLE_NEEDING_FIXUP}\" \"\" \"${FIXUP_LIBS}\") - " COMPONENT ${SERVER_COMPONENT}) - endif () + execute_process(COMMAND ${MACDEPLOYQT_COMMAND} ${ESCAPED_BUNDLE_NAME} -verbose=2 -executable=${ESCAPED_EXECUTABLE_NAME})" + COMPONENT ${SERVER_COMPONENT} + ) + endif() + endif () # set variables used by manual ssleay library copy From b099376193cc40bee22960ad19375231376d1ad8 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 22 Jan 2016 14:47:25 -0800 Subject: [PATCH 2/2] fix a typo in message for macdeployqt --- cmake/macros/InstallBesideConsole.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/macros/InstallBesideConsole.cmake b/cmake/macros/InstallBesideConsole.cmake index 6c8969dded..c17e8d2564 100644 --- a/cmake/macros/InstallBesideConsole.cmake +++ b/cmake/macros/InstallBesideConsole.cmake @@ -60,7 +60,7 @@ macro(install_beside_console) 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.\ + It is required to produce a relocatable interface application.\ Check that the environment variable QT_DIR points to your Qt installation.\ ") endif ()