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. --- tls/CMakeLists.txt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'tls') diff --git a/tls/CMakeLists.txt b/tls/CMakeLists.txt index 0e13da5..71f505a 100644 --- a/tls/CMakeLists.txt +++ b/tls/CMakeLists.txt @@ -37,7 +37,9 @@ else() endif() add_library(tls-objects OBJECT ${TLS_SRC}) +set(TLS_LIBRARIES tls) if (BUILD_SHARED) + list(APPEND TLS_LIBRARIES tls-shared) add_library(tls STATIC $) add_library(tls-shared SHARED $) export_symbol(tls-shared ${CMAKE_CURRENT_SOURCE_DIR}/tls.sym) @@ -51,13 +53,15 @@ if (BUILD_SHARED) ARCHIVE_OUTPUT_NAME tls${TLS_POSTFIX}) set_target_properties(tls-shared PROPERTIES VERSION ${TLS_VERSION} SOVERSION ${TLS_MAJOR_VERSION}) - if(ENABLE_LIBRESSL_INSTALL) - install(TARGETS tls tls-shared DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif(ENABLE_LIBRESSL_INSTALL) else() add_library(tls STATIC ${TLS_SRC}) - if(ENABLE_LIBRESSL_INSTALL) - install(TARGETS tls DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif(ENABLE_LIBRESSL_INSTALL) endif() +if(ENABLE_LIBRESSL_INSTALL) + install( + TARGETS ${TLS_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