From 5db9cd0031192e7705c3526d0487cc1e9b4346ab Mon Sep 17 00:00:00 2001 From: Victor Stewart Date: Tue, 23 Jul 2024 21:52:35 +0000 Subject: [PATCH] add cmake install functionality --- CMakeLists.txt | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f42f21a9d..63831e71d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -272,3 +272,43 @@ IF (BUILD_FUZZER) TARGET_LINK_LIBRARIES(fuzz-client-hello picotls-core picotls-openssl ${OPENSSL_CRYPTO_LIBRARIES} ${AEGIS_LIBRARIES} ${LIB_FUZZER}) ENDIF() + +if (NOT CMAKE_INSTALL_INCLUDEDIR) + set(CMAKE_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/include/picotls) +endif() + +install(FILES include/picotls.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +install(DIRECTORY include/picotls DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + +install(TARGETS picotls-core + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +install(TARGETS picotls-minicrypto + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +if (TARGET picotls-fusion) + install(TARGETS picotls-fusion + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +endif() + +if (TARGET picotls-openssl) + install(TARGETS picotls-openssl + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +endif() + +if (TARGET picotls-mbedtls) + install(TARGETS picotls-mbedtls + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +endif() + +