diff --git a/assignment-client/CMakeLists.txt b/assignment-client/CMakeLists.txt index 0c54ad71ac..3a2106250c 100644 --- a/assignment-client/CMakeLists.txt +++ b/assignment-client/CMakeLists.txt @@ -10,11 +10,8 @@ link_hifi_libraries( ) if (WIN32) - # we need SSL_EAY_LIBRARY_* to be set before we call package_libraries_for_deployment() - # so we have to call find_package(OpenSSL) here even though this target doesn't specifically need it - find_package(OpenSSL REQUIRED) - set(MANUAL_SSLEAY_COPY TRUE) package_libraries_for_deployment() endif() install_beside_console() +manually_install_ssl_eay() diff --git a/cmake/macros/InstallBesideConsole.cmake b/cmake/macros/InstallBesideConsole.cmake index f076c856f8..d34f54ed77 100644 --- a/cmake/macros/InstallBesideConsole.cmake +++ b/cmake/macros/InstallBesideConsole.cmake @@ -64,4 +64,8 @@ macro(install_beside_console) endif () endif () + # set variables used by manual ssleay library copy + set(TARGET_INSTALL_DIR ${COMPONENT_DESTINATION}) + set(TARGET_INSTALL_COMPONENT ${SERVER_COMPONENT}) + endmacro() diff --git a/cmake/macros/ManuallyInstallSSLEay.cmake b/cmake/macros/ManuallyInstallSSLEay.cmake new file mode 100644 index 0000000000..405bf6b1d3 --- /dev/null +++ b/cmake/macros/ManuallyInstallSSLEay.cmake @@ -0,0 +1,28 @@ +# +# ManuallyInstallSSLEay.cmake +# +# Created by Stephen Birarda on 1/15/16. +# Copyright 2014 High Fidelity, Inc. +# +# Distributed under the Apache License, Version 2.0. +# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +# + +macro(manually_install_ssl_eay) + + # on windows we have had issues with targets missing ssleay library + # not convinced we actually need it (I assume it would show up in the dependency tree) + # but to be safe we install it manually beside the current target + if (WIN32) + # we need to find SSL_EAY_LIBRARY_* so we can install it beside this target + # so we have to call find_package(OpenSSL) here even though this target may not specifically need it + find_package(OpenSSL REQUIRED) + + install( + FILES $<$:${SSL_EAY_LIBRARY_DEBUG}> $<$>:${SSL_EAY_LIBRARY_RELEASE}> + DESTINATION ${TARGET_INSTALL_DIR} + COMPONENT ${TARGET_INSTALL_COMPONENT} + ) + endif() + +endmacro() diff --git a/cmake/macros/PackageLibrariesForDeployment.cmake b/cmake/macros/PackageLibrariesForDeployment.cmake index 322afc52e0..050cea9fe1 100644 --- a/cmake/macros/PackageLibrariesForDeployment.cmake +++ b/cmake/macros/PackageLibrariesForDeployment.cmake @@ -10,7 +10,6 @@ # macro(PACKAGE_LIBRARIES_FOR_DEPLOYMENT) - if (WIN32) configure_file( ${HF_CMAKE_DIR}/templates/FixupBundlePostBuild.cmake.in diff --git a/cmake/templates/FixupBundlePostBuild.cmake.in b/cmake/templates/FixupBundlePostBuild.cmake.in index fce74db31c..57d1fd787f 100644 --- a/cmake/templates/FixupBundlePostBuild.cmake.in +++ b/cmake/templates/FixupBundlePostBuild.cmake.in @@ -50,12 +50,5 @@ else() set(PLUGIN_EXTENSION "so") endif() -file(GLOB EXTRA_LIBRARIES "${BUNDLE_PLUGIN_DIR}/*.${PLUGIN_EXTENSION}") - -set(MANUAL_SSLEAY_COPY @MANUAL_SSLEAY_COPY@) -if (MANUAL_SSLEAY_COPY) - message(STATUS "Adding $<$:@SSL_EAY_LIBRARY_DEBUG@> $<$>:@SSL_EAY_LIBRARY_RELEASE@> to fixed up libraries") - list(APPEND EXTRA_LIBRARIES "$<$:@SSL_EAY_LIBRARY_DEBUG@>" "$<$>:@SSL_EAY_LIBRARY_RELEASE@>") -endif() - -fixup_bundle("${BUNDLE_EXECUTABLE}" "${EXTRA_LIBRARIES}" "@FIXUP_LIBS@") +file(GLOB EXTRA_PLUGINS "${BUNDLE_PLUGIN_DIR}/*.${PLUGIN_EXTENSION}") +fixup_bundle("${BUNDLE_EXECUTABLE}" "${EXTRA_PLUGINS}" "@FIXUP_LIBS@") diff --git a/domain-server/CMakeLists.txt b/domain-server/CMakeLists.txt index 08bd39190a..e48657e20e 100644 --- a/domain-server/CMakeLists.txt +++ b/domain-server/CMakeLists.txt @@ -37,8 +37,8 @@ if (UNIX) endif () if (WIN32) - set(MANUAL_SSLEAY_COPY TRUE) package_libraries_for_deployment() endif () install_beside_console() +manually_install_ssl_eay() diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 482adea848..91a0abb3ee 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -264,9 +264,9 @@ fixup_interface() if (WIN32) set(EXTRA_DEPLOY_OPTIONS "--qmldir ${PROJECT_SOURCE_DIR}/resources/qml") - # we need SSL_EAY_LIBRARY_* to be set before we call package_libraries_for_deployment() - # so we have to call find_package(OpenSSL) here even though this target doesn't specifically need it - find_package(OpenSSL REQUIRED) - set(MANUAL_SSLEAY_COPY TRUE) + set(TARGET_INSTALL_DIR ${INTERFACE_INSTALL_DIR}) + set(TARGET_INSTALL_COMPONENT ${CLIENT_COMPONENT}) + manually_install_ssl_eay() + package_libraries_for_deployment() endif()