diff options
author | Pierre Wendling <pierre.wendling.4@gmail.com> | 2023-08-06 15:07:31 -0400 |
---|---|---|
committer | Pierre Wendling <pierre.wendling.4@gmail.com> | 2023-08-19 12:16:15 -0400 |
commit | a89cd65980153ef60b42cb26d3bef949751f87f1 (patch) | |
tree | 15d4693562c401d0bbc0b3812d983ca1ac0391cb /crypto | |
parent | 5432e22b25026fb50b00ab5dcf894e18daa8bcb6 (diff) | |
download | portable-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 'crypto')
-rw-r--r-- | crypto/CMakeLists.txt | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index 1e73e88..597ffef 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt | |||
@@ -990,9 +990,29 @@ if (WIN32) | |||
990 | endif() | 990 | endif() |
991 | set_target_properties(crypto PROPERTIES | 991 | set_target_properties(crypto PROPERTIES |
992 | OUTPUT_NAME crypto${CRYPTO_POSTFIX} | 992 | OUTPUT_NAME crypto${CRYPTO_POSTFIX} |
993 | ARCHIVE_OUTPUT_NAME crypto${CRYPTO_POSTFIX}) | 993 | ARCHIVE_OUTPUT_NAME crypto${CRYPTO_POSTFIX} |
994 | set_target_properties(crypto PROPERTIES VERSION | 994 | EXPORT_NAME Crypto |
995 | ${CRYPTO_VERSION} SOVERSION ${CRYPTO_MAJOR_VERSION}) | 995 | VERSION ${CRYPTO_VERSION} |
996 | SOVERSION ${CRYPTO_MAJOR_VERSION} | ||
997 | ) | ||
998 | |||
999 | target_include_directories( | ||
1000 | crypto | ||
1001 | PUBLIC | ||
1002 | $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> | ||
1003 | $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> | ||
1004 | ) | ||
1005 | |||
1006 | install( | ||
1007 | TARGETS crypto | ||
1008 | EXPORT Crypto-target | ||
1009 | ) | ||
1010 | |||
1011 | export( | ||
1012 | EXPORT Crypto-target | ||
1013 | FILE "${LibreSSL_BINARY_DIR}/LibreSSL-Crypto.cmake" | ||
1014 | NAMESPACE LibreSSL:: | ||
1015 | ) | ||
996 | 1016 | ||
997 | if(ENABLE_LIBRESSL_INSTALL) | 1017 | if(ENABLE_LIBRESSL_INSTALL) |
998 | install( | 1018 | install( |
@@ -1001,6 +1021,12 @@ if(ENABLE_LIBRESSL_INSTALL) | |||
1001 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | 1021 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} |
1002 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | 1022 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} |
1003 | ) | 1023 | ) |
1024 | install( | ||
1025 | EXPORT Crypto-target | ||
1026 | FILE "LibreSSL-Crypto.cmake" | ||
1027 | NAMESPACE LibreSSL:: | ||
1028 | DESTINATION "${LIBRESSL_INSTALL_CMAKEDIR}/LibreSSL" | ||
1029 | ) | ||
1004 | endif(ENABLE_LIBRESSL_INSTALL) | 1030 | endif(ENABLE_LIBRESSL_INSTALL) |
1005 | 1031 | ||
1006 | # build static library for regression test | 1032 | # build static library for regression test |