From b6ffabf5003228385b1543f13283aa44d5f7883a Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Wed, 13 Jul 2016 09:08:57 -0700 Subject: [PATCH] attempt to get mac sandbox plugins to work --- cmake/macros/GenerateInstallers.cmake | 26 +++++++++++++++++++ .../macros/SetupHifiClientServerPlugin.cmake | 3 ++- server-console/CMakeLists.txt | 26 +++++++++++++++++++ 3 files changed, 54 insertions(+), 1 deletion(-) diff --git a/cmake/macros/GenerateInstallers.cmake b/cmake/macros/GenerateInstallers.cmake index 0def701739..2d2ede69f0 100644 --- a/cmake/macros/GenerateInstallers.cmake +++ b/cmake/macros/GenerateInstallers.cmake @@ -78,6 +78,32 @@ macro(GENERATE_INSTALLERS) install(CODE "execute_process(COMMAND SetFile -a V \${CMAKE_INSTALL_PREFIX}/${ESCAPED_DMG_SUBFOLDER_NAME}/Icon\\r)") endif () + # this is a bit of a hack, but I couldn't find any other way to get plugins + # into the correct place under the console path. On windows this is handled + # exclusively in the plugins directories with the SetupHiFiClientServerPlugin + # macro + if (APPLE) + set(CONSOLE_PLUGINS_DIR "${CONSOLE_INSTALL_APP_PATH}/Contents/MacOS/Components.app/Contents/PlugIns") + set(SERVER_PLUGINS_DIR "${CMAKE_BINARY_DIR}/assignment-client/${CMAKE_BUILD_TYPE}/plugins") + + message("TARGET_NAME: ${TARGET_NAME}") + message("CONFIGURATION: ${CONFIGURATION}") + message(": $") + message("CONSOLE_PLUGINS_DIR: ${CONSOLE_PLUGINS_DIR}") + message("SERVER_PLUGINS_DIR: ${SERVER_PLUGINS_DIR}") + + add_custom_command(TARGET ${TARGET_NAME} POST_BUILD + COMMAND "${CMAKE_COMMAND}" -E make_directory + ${CONSOLE_PLUGINS_DIR} + ) + + add_custom_command(TARGET ${TARGET_NAME} POST_BUILD + COMMAND "${CMAKE_COMMAND}" -E copy_directory + ${SERVER_PLUGINS_DIR} + ${CONSOLE_PLUGINS_DIR} + ) + endif () + # configure a cpack properties file for custom variables in template set(CPACK_CONFIGURED_PROP_FILE "${CMAKE_CURRENT_BINARY_DIR}/CPackCustomProperties.cmake") configure_file("${HF_CMAKE_DIR}/templates/CPackProperties.cmake.in" ${CPACK_CONFIGURED_PROP_FILE}) diff --git a/cmake/macros/SetupHifiClientServerPlugin.cmake b/cmake/macros/SetupHifiClientServerPlugin.cmake index dfe3113fbc..a065ee99b6 100644 --- a/cmake/macros/SetupHifiClientServerPlugin.cmake +++ b/cmake/macros/SetupHifiClientServerPlugin.cmake @@ -13,7 +13,8 @@ macro(SETUP_HIFI_CLIENT_SERVER_PLUGIN) if (APPLE) set(CLIENT_PLUGIN_PATH "${INTERFACE_BUNDLE_NAME}.app/Contents/PlugIns") - set(SERVER_PLUGIN_PATH "Components.app/Contents/PlugIns") + #set(SERVER_PLUGIN_PATH "Components.app/Contents/PlugIns") + set(SERVER_PLUGIN_PATH "plugins") else() set(CLIENT_PLUGIN_PATH "plugins") set(SERVER_PLUGIN_PATH "plugins") diff --git a/server-console/CMakeLists.txt b/server-console/CMakeLists.txt index 1c6e40c582..7b9c17ace4 100644 --- a/server-console/CMakeLists.txt +++ b/server-console/CMakeLists.txt @@ -72,3 +72,29 @@ else () set_target_properties(${TARGET_NAME} PROPERTIES EXCLUDE_FROM_ALL TRUE EXCLUDE_FROM_DEFAULT_BUILD TRUE) set_target_properties(${TARGET_NAME}-npm-install PROPERTIES EXCLUDE_FROM_ALL TRUE EXCLUDE_FROM_DEFAULT_BUILD TRUE) endif () + +# this is a bit of a hack, but I couldn't find any other way to get plugins +# into the correct place under the console path. On windows this is handled +# exclusively in the plugins directories with the SetupHiFiClientServerPlugin +# macro +if (APPLE) + set(CONSOLE_PLUGINS_DIR "${CONSOLE_INSTALL_APP_PATH}/Contents/MacOS/Components.app/Contents/PlugIns") + set(SERVER_PLUGINS_DIR "${CMAKE_BINARY_DIR}/assignment-client/${CMAKE_BUILD_TYPE}/plugins") + + message("TARGET_NAME: ${TARGET_NAME}") + message("CONFIGURATION: ${CONFIGURATION}") + message(": $") + message("CONSOLE_PLUGINS_DIR: ${CONSOLE_PLUGINS_DIR}") + message("SERVER_PLUGINS_DIR: ${SERVER_PLUGINS_DIR}") + + add_custom_command(TARGET ${TARGET_NAME} POST_BUILD + COMMAND "${CMAKE_COMMAND}" -E make_directory + ${CONSOLE_PLUGINS_DIR} + ) + + add_custom_command(TARGET ${TARGET_NAME} POST_BUILD + COMMAND "${CMAKE_COMMAND}" -E copy_directory + ${SERVER_PLUGINS_DIR} + ${CONSOLE_PLUGINS_DIR} + ) +endif ()