From 1faa78fe72a047c0a9c6db4f8aef26c4690ce4ad Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 7 Jan 2016 18:03:14 -0800 Subject: [PATCH] install fixed up DS and AC beside console --- assignment-client/CMakeLists.txt | 4 +- cmake/macros/InstallBesideConsole.cmake | 75 ++++++++++++++----------- console/CMakeLists.txt | 4 +- domain-server/CMakeLists.txt | 4 +- interface/CMakeLists.txt | 10 +++- 5 files changed, 54 insertions(+), 43 deletions(-) diff --git a/assignment-client/CMakeLists.txt b/assignment-client/CMakeLists.txt index b2e890fe9e..19f856c6eb 100644 --- a/assignment-client/CMakeLists.txt +++ b/assignment-client/CMakeLists.txt @@ -9,7 +9,5 @@ link_hifi_libraries( controllers physics ) -install_beside_console() - package_libraries_for_deployment() -consolidate_installer_components() +install_beside_console() diff --git a/cmake/macros/InstallBesideConsole.cmake b/cmake/macros/InstallBesideConsole.cmake index 7e03b40ce6..f598424e66 100644 --- a/cmake/macros/InstallBesideConsole.cmake +++ b/cmake/macros/InstallBesideConsole.cmake @@ -10,43 +10,54 @@ # 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") - else () - set(COMPONENT_DESTINATION ${CONSOLE_INSTALL_DIR}) - endif () - - install( - TARGETS ${TARGET_NAME} - RUNTIME DESTINATION ${COMPONENT_DESTINATION} - COMPONENT ${SERVER_COMPONENT} - ) - - if (TARGET_NAME STREQUAL domain-server) + if (WIN32 OR APPLE) + # install this component beside the installed server-console executable if (APPLE) - set(RESOURCES_DESTINATION ${COMPONENT_DESTINATION}) + set(CONSOLE_APP_CONTENTS "${CONSOLE_INSTALL_APP_PATH}/Contents") + set(COMPONENT_DESTINATION "${CONSOLE_APP_CONTENTS}/MacOS/Components.app/Contents/MacOS") else () - set(RESOURCES_DESTINATION ${CONSOLE_INSTALL_DIR}) + set(COMPONENT_DESTINATION ${CONSOLE_INSTALL_DIR}) endif () - # install the resources folder for the domain-server where its executable will be - install( - DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/resources - DESTINATION ${RESOURCES_DESTINATION} - USE_SOURCE_PERMISSIONS - COMPONENT ${SERVER_COMPONENT} - ) - endif () + if (APPLE) + install( + TARGETS ${TARGET_NAME} + RUNTIME DESTINATION ${COMPONENT_DESTINATION} + COMPONENT ${SERVER_COMPONENT} + ) + else () + # setup install of executable and things copied by fixup/windeployqt + install( + FILES $ + DESTINATION ${COMPONENT_DESTINATION} + COMPONENT ${SERVER_COMPONENT} + ) + endif () - 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}) + if (TARGET_NAME STREQUAL domain-server) + if (APPLE) + set(RESOURCES_DESTINATION ${COMPONENT_DESTINATION}) + else () + set(RESOURCES_DESTINATION ${CONSOLE_INSTALL_DIR}) + endif () + + # install the resources folder for the domain-server where its executable will be + install( + DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/resources + DESTINATION ${RESOURCES_DESTINATION} + USE_SOURCE_PERMISSIONS + COMPONENT ${SERVER_COMPONENT} + ) + endif () + + 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}) + endif () endif () endmacro() diff --git a/console/CMakeLists.txt b/console/CMakeLists.txt index 3a28f63f86..05ab6f0549 100644 --- a/console/CMakeLists.txt +++ b/console/CMakeLists.txt @@ -22,14 +22,14 @@ elseif (UNIX) set(PACKAGED_CONSOLE_FOLDER "server-console-linux-x64") endif () -# install the packaged Server Console +# install the packaged Server Console in our install directory if (APPLE) install( PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" DESTINATION ${CONSOLE_INSTALL_DIR} COMPONENT ${SERVER_COMPONENT} ) -else () +elseif (WIN32) install( DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}/" DESTINATION ${CONSOLE_INSTALL_DIR} diff --git a/domain-server/CMakeLists.txt b/domain-server/CMakeLists.txt index 9437656f9b..342bfbffe4 100644 --- a/domain-server/CMakeLists.txt +++ b/domain-server/CMakeLists.txt @@ -36,7 +36,5 @@ if (UNIX) target_link_libraries(${TARGET_NAME} ${CMAKE_DL_LIBS}) endif (UNIX) -install_beside_console() - package_libraries_for_deployment() -consolidate_installer_components() +install_beside_console() diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 10bb83ed1d..c656f32359 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -225,12 +225,16 @@ else (APPLE) $/scripts ) - # setup install of interface target - install(TARGETS ${TARGET_NAME} RUNTIME DESTINATION . COMPONENT ${CLIENT_COMPONENT}) - # link target to external libraries if (WIN32) target_link_libraries(${TARGET_NAME} wsock32.lib Winmm.lib) + + # setup install of executable and things copied by fixup/windeployqt + install( + FILES $ + DESTINATION ${INTERFACE_INSTALL_DIR} + COMPONENT ${CLIENT_COMPONENT} + ) endif() endif (APPLE)