From b7154cacd2d7c92c38b1eb241901dfc39734a3b2 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 6 Jan 2016 15:26:41 -0800 Subject: [PATCH] use shell application to avoid fixup on Electron --- cmake/macros/InstallBesideConsole.cmake | 36 +++++++++++++++++++++++-- console/.gitignore | 1 + console/packager.js | 2 +- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/cmake/macros/InstallBesideConsole.cmake b/cmake/macros/InstallBesideConsole.cmake index 58885681f8..c0a387b22e 100644 --- a/cmake/macros/InstallBesideConsole.cmake +++ b/cmake/macros/InstallBesideConsole.cmake @@ -12,10 +12,42 @@ macro(install_beside_console) # install this component beside the installed server-console executable if (APPLE) - set(COMPONENT_DESTINATION "Applications/High Fidelity/Server Console.app/Contents/MacOS/") + set(SHELL_APP_CONTENTS "Components.app/Contents") + set(COMPONENT_DESTINATION "${SHELL_APP_CONTENTS}/MacOS") + else () set(COMPONENT_DESTINATION .) endif () - install(TARGETS ${TARGET_NAME} RUNTIME DESTINATION ${COMPONENT_DESTINATION} COMPONENT ${SERVER_COMPONENT}) + install( + TARGETS ${TARGET_NAME} + RUNTIME DESTINATION ${COMPONENT_DESTINATION} + COMPONENT ${SERVER_COMPONENT} + ) + + if (APPLE) + # during the install phase, call fixup to drop the shared libraries for these components in the right place + set(EXECUTABLE_NEEDING_FIXUP "\${CMAKE_INSTALL_PREFIX}/${COMPONENT_DESTINATION}/${TARGET_NAME}") + install(CODE " + include(BundleUtilities) + fixup_bundle(\"${EXECUTABLE_NEEDING_FIXUP}\" \"\" \"${FIXUP_LIBS}\") + " COMPONENT ${SERVER_COMPONENT}) + + # once installed copy the contents of the shell Components.app to the console application + set(CONSOLE_INSTALL_PATH "Applications/High Fidelity/Server Console.app") + set(INSTALLED_CONSOLE_CONTENTS "\${CMAKE_INSTALL_PREFIX}/${CONSOLE_INSTALL_PATH}/Contents") + + set(INSTALLED_SHELL_CONTENTS "\${CMAKE_INSTALL_PREFIX}/${SHELL_APP_CONTENTS}") + install(CODE " + message(STATUS \"CHECKING ${INSTALLED_SHELL_CONTENTS}/Frameworks/*\") + file(GLOB FRAMEWORKS \"${INSTALLED_SHELL_CONTENTS}/Frameworks/*\") + message(STATUS \"Copying \${FRAMEWORKS} to ${INSTALLED_CONSOLE_CONTENTS}/Frameworks\") + file(COPY \${FRAMEWORKS} DESTINATION \"${INSTALLED_CONSOLE_CONTENTS}/Frameworks\") + file(GLOB BINARIES \"${INSTALLED_SHELL_CONTENTS}/MacOS/*\") + message(STATUS \"Copying \${BINARIES} to ${INSTALLED_CONSOLE_CONTENTS}/Frameworks\") + file(COPY \${BINARIES} DESTINATION \"${INSTALLED_CONSOLE_CONTENTS}/MacOS\") + " COMPONENT ${SERVER_COMPONENT}) + + endif () + endmacro() diff --git a/console/.gitignore b/console/.gitignore index de75c10412..1624823e80 100644 --- a/console/.gitignore +++ b/console/.gitignore @@ -1,4 +1,5 @@ Server\ Console-*/ server-console-*/ +electron-packager/ npm-debug.log logs/ diff --git a/console/packager.js b/console/packager.js index 2489436857..341ae0c1a7 100644 --- a/console/packager.js +++ b/console/packager.js @@ -23,7 +23,7 @@ var options = { arch: "x64", platform: platform, icon: "resources/" + iconName, - ignore: "logs|(S|s)erver(\\s|-)(C|c)onsole-\\S+" + ignore: "logs|(S|s)erver(\\s|-)(C|c)onsole-\\S+|electron-packager" } const EXEC_NAME = "server-console";