From 5fb488de9f70d9d306c83d1316998e86d95f4a4e Mon Sep 17 00:00:00 2001 From: Don Date: Fri, 16 Mar 2018 13:59:26 -0700 Subject: Use groups in CMake install command for libraries On Windows shared libraries should be installed into the bin directory. Using grouping within CMake based on the target type fixes this issue. --- crypto/CMakeLists.txt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'crypto') diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index 0615110..1a2b6e0 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt @@ -807,7 +807,9 @@ if(EXTRA_EXPORT) endif() add_library(crypto-objects OBJECT ${CRYPTO_SRC}) +set(CRYPTO_LIBRARIES crypto) if (BUILD_SHARED) + list(APPEND CRYPTO_LIBRARIES crypto-shared) add_library(crypto STATIC $) add_library(crypto-shared SHARED $) export_symbol(crypto-shared ${CMAKE_CURRENT_SOURCE_DIR}/crypto_p.sym) @@ -820,13 +822,15 @@ if (BUILD_SHARED) ARCHIVE_OUTPUT_NAME crypto${CRYPTO_POSTFIX}) set_target_properties(crypto-shared PROPERTIES VERSION ${CRYPTO_VERSION} SOVERSION ${CRYPTO_MAJOR_VERSION}) - if(ENABLE_LIBRESSL_INSTALL) - install(TARGETS crypto crypto-shared DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif(ENABLE_LIBRESSL_INSTALL) else() add_library(crypto STATIC ${CRYPTO_SRC}) - if(ENABLE_LIBRESSL_INSTALL) - install(TARGETS crypto DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif(ENABLE_LIBRESSL_INSTALL) endif() +if(ENABLE_LIBRESSL_INSTALL) + install( + TARGETS ${CRYPTO_LIBRARIES} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) +endif(ENABLE_LIBRESSL_INSTALL) -- cgit v1.2.3-55-g6feb