aboutsummaryrefslogtreecommitdiff
path: root/tls
diff options
context:
space:
mode:
authorPierre Wendling <pierre.wendling.4@gmail.com>2023-08-06 15:07:31 -0400
committerPierre Wendling <pierre.wendling.4@gmail.com>2023-08-19 12:16:15 -0400
commita89cd65980153ef60b42cb26d3bef949751f87f1 (patch)
tree15d4693562c401d0bbc0b3812d983ca1ac0391cb /tls
parent5432e22b25026fb50b00ab5dcf894e18daa8bcb6 (diff)
downloadportable-a89cd65980153ef60b42cb26d3bef949751f87f1.tar.gz
portable-a89cd65980153ef60b42cb26d3bef949751f87f1.tar.bz2
portable-a89cd65980153ef60b42cb26d3bef949751f87f1.zip
CMake: Export and install library targets.
The configs can be consumed by setting LibreSSL_DIR to the build directory, or after installation using CMAKE_PREFIX_PATH/LibreSSL_DIR. For compatibility, the EXPORT_NAME of targets and the LIBRESSL_* variables are set to match the names used in FindLibreSSL.
Diffstat (limited to 'tls')
-rw-r--r--tls/CMakeLists.txt32
1 files changed, 29 insertions, 3 deletions
diff --git a/tls/CMakeLists.txt b/tls/CMakeLists.txt
index 2a90192..a8f29af 100644
--- a/tls/CMakeLists.txt
+++ b/tls/CMakeLists.txt
@@ -58,9 +58,29 @@ if (WIN32)
58endif() 58endif()
59set_target_properties(tls PROPERTIES 59set_target_properties(tls PROPERTIES
60 OUTPUT_NAME tls${TLS_POSTFIX} 60 OUTPUT_NAME tls${TLS_POSTFIX}
61 ARCHIVE_OUTPUT_NAME tls${TLS_POSTFIX}) 61 ARCHIVE_OUTPUT_NAME tls${TLS_POSTFIX}
62set_target_properties(tls PROPERTIES VERSION ${TLS_VERSION} 62 EXPORT_NAME TLS
63 SOVERSION ${TLS_MAJOR_VERSION}) 63 VERSION ${TLS_VERSION}
64 SOVERSION ${TLS_MAJOR_VERSION}
65)
66
67target_include_directories(
68 tls
69 PUBLIC
70 $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>
71 $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
72)
73
74install(
75 TARGETS tls
76 EXPORT TLS-target
77)
78
79export(
80 EXPORT TLS-target
81 FILE "${LibreSSL_BINARY_DIR}/LibreSSL-TLS.cmake"
82 NAMESPACE LibreSSL::
83)
64 84
65if(ENABLE_LIBRESSL_INSTALL) 85if(ENABLE_LIBRESSL_INSTALL)
66 install( 86 install(
@@ -69,6 +89,12 @@ if(ENABLE_LIBRESSL_INSTALL)
69 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 89 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
70 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 90 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
71 ) 91 )
92 install(
93 EXPORT TLS-target
94 FILE "LibreSSL-TLS.cmake"
95 NAMESPACE LibreSSL::
96 DESTINATION "${LIBRESSL_INSTALL_CMAKEDIR}/LibreSSL"
97 )
72endif(ENABLE_LIBRESSL_INSTALL) 98endif(ENABLE_LIBRESSL_INSTALL)
73 99
74# build static library for regression test 100# build static library for regression test