use install command to manually place ssleay library

This commit is contained in:
Stephen Birarda 2016-01-15 11:50:39 -08:00
parent 29b5076da4
commit cf5b6198fd
7 changed files with 40 additions and 19 deletions

View file

@ -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()

View file

@ -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()

View file

@ -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 $<$<CONFIG:Debug>:${SSL_EAY_LIBRARY_DEBUG}> $<$<NOT:$<CONFIG:Debug>>:${SSL_EAY_LIBRARY_RELEASE}>
DESTINATION ${TARGET_INSTALL_DIR}
COMPONENT ${TARGET_INSTALL_COMPONENT}
)
endif()
endmacro()

View file

@ -10,7 +10,6 @@
#
macro(PACKAGE_LIBRARIES_FOR_DEPLOYMENT)
if (WIN32)
configure_file(
${HF_CMAKE_DIR}/templates/FixupBundlePostBuild.cmake.in

View file

@ -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 $<$<CONFIG:Debug>:@SSL_EAY_LIBRARY_DEBUG@> $<$<NOT:$<CONFIG:Debug>>:@SSL_EAY_LIBRARY_RELEASE@> to fixed up libraries")
list(APPEND EXTRA_LIBRARIES "$<$<CONFIG:Debug>:@SSL_EAY_LIBRARY_DEBUG@>" "$<$<NOT:$<CONFIG: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@")

View file

@ -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()

View file

@ -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()