diff options
author | Don <don.j.olmstead@gmail.com> | 2018-03-16 13:59:26 -0700 |
---|---|---|
committer | Don <don.j.olmstead@gmail.com> | 2018-03-16 13:59:26 -0700 |
commit | 5fb488de9f70d9d306c83d1316998e86d95f4a4e (patch) | |
tree | aa49668b85b9f28152091e4aeb1711066ba95e8d /ssl | |
parent | 639a6629ae4b2243d1d15670f90750c3200ff4bf (diff) | |
download | portable-5fb488de9f70d9d306c83d1316998e86d95f4a4e.tar.gz portable-5fb488de9f70d9d306c83d1316998e86d95f4a4e.tar.bz2 portable-5fb488de9f70d9d306c83d1316998e86d95f4a4e.zip |
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.
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/CMakeLists.txt | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/ssl/CMakeLists.txt b/ssl/CMakeLists.txt index 3ea16a8..93f20ee 100644 --- a/ssl/CMakeLists.txt +++ b/ssl/CMakeLists.txt | |||
@@ -47,7 +47,9 @@ set( | |||
47 | ) | 47 | ) |
48 | 48 | ||
49 | add_library(ssl-objects OBJECT ${SSL_SRC}) | 49 | add_library(ssl-objects OBJECT ${SSL_SRC}) |
50 | set(SSL_LIBRARIES ssl) | ||
50 | if (BUILD_SHARED) | 51 | if (BUILD_SHARED) |
52 | list(APPEND SSL_LIBRARIES ssl-shared) | ||
51 | add_library(ssl STATIC $<TARGET_OBJECTS:ssl-objects>) | 53 | add_library(ssl STATIC $<TARGET_OBJECTS:ssl-objects>) |
52 | add_library(ssl-shared SHARED $<TARGET_OBJECTS:ssl-objects>) | 54 | add_library(ssl-shared SHARED $<TARGET_OBJECTS:ssl-objects>) |
53 | export_symbol(ssl-shared ${CMAKE_CURRENT_SOURCE_DIR}/ssl.sym) | 55 | export_symbol(ssl-shared ${CMAKE_CURRENT_SOURCE_DIR}/ssl.sym) |
@@ -61,12 +63,15 @@ if (BUILD_SHARED) | |||
61 | ARCHIVE_OUTPUT_NAME ssl${SSL_POSTFIX}) | 63 | ARCHIVE_OUTPUT_NAME ssl${SSL_POSTFIX}) |
62 | set_target_properties(ssl-shared PROPERTIES VERSION ${SSL_VERSION} | 64 | set_target_properties(ssl-shared PROPERTIES VERSION ${SSL_VERSION} |
63 | SOVERSION ${SSL_MAJOR_VERSION}) | 65 | SOVERSION ${SSL_MAJOR_VERSION}) |
64 | if(ENABLE_LIBRESSL_INSTALL) | ||
65 | install(TARGETS ssl ssl-shared DESTINATION ${CMAKE_INSTALL_LIBDIR}) | ||
66 | endif(ENABLE_LIBRESSL_INSTALL) | ||
67 | else() | 66 | else() |
68 | add_library(ssl STATIC ${SSL_SRC}) | 67 | add_library(ssl STATIC ${SSL_SRC}) |
69 | if(ENABLE_LIBRESSL_INSTALL) | ||
70 | install(TARGETS ssl DESTINATION ${CMAKE_INSTALL_LIBDIR}) | ||
71 | endif(ENABLE_LIBRESSL_INSTALL) | ||
72 | endif() | 68 | endif() |
69 | |||
70 | if(ENABLE_LIBRESSL_INSTALL) | ||
71 | install( | ||
72 | TARGETS ${SSL_LIBRARIES} | ||
73 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
74 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
75 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
76 | ) | ||
77 | endif(ENABLE_LIBRESSL_INSTALL) | ||