diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e928c9..02d5597 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -167,7 +167,7 @@ ELSE() ENDIF() IF (NOT DEFINED BORINGSSL_LIB AND DEFINED BORINGSSL_DIR) - FOREACH(LIB_NAME ssl crypto decrepit) + FOREACH(LIB_NAME ssl crypto) IF (CMAKE_SYSTEM_NAME STREQUAL Windows) FIND_LIBRARY(BORINGSSL_LIB_${LIB_NAME} NAMES ${LIB_NAME} @@ -190,14 +190,13 @@ IF (NOT DEFINED BORINGSSL_LIB AND DEFINED BORINGSSL_DIR) ELSE() - FOREACH(LIB_NAME ssl crypto decrepit) + FOREACH(LIB_NAME ssl crypto) # If BORINGSSL_LIB is defined, try find each lib. Otherwise, user should define BORINGSSL_LIB_ssl, # BORINGSSL_LIB_crypto and so on explicitly. For example, including boringssl and lsquic both via # add_subdirectory: # add_subdirectory(third_party/boringssl) # set(BORINGSSL_LIB_ssl ssl) # set(BORINGSSL_LIB_crypto crypto) - # set(BORINGSSL_LIB_decrepit decrepit) # add_subdirectory(third_party/lsquic) IF (DEFINED BORINGSSL_LIB) IF (CMAKE_SYSTEM_NAME STREQUAL Windows) @@ -336,3 +335,11 @@ INSTALL(FILES include/lsxpack_header.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lsquic ) + +if(WIN32) + # The other file in wincompat is not used in installed headers + INSTALL(FILES + wincompat/vc_compat.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lsquic + ) +endif() diff --git a/src/liblsquic/CMakeLists.txt b/src/liblsquic/CMakeLists.txt index 87fce00..be40f9c 100644 --- a/src/liblsquic/CMakeLists.txt +++ b/src/liblsquic/CMakeLists.txt @@ -130,9 +130,28 @@ ELSE() add_library(lsquic STATIC ${lsquic_STAT_SRCS}) ENDIF() +target_include_directories( + lsquic PUBLIC $) + install(TARGETS lsquic EXPORT lsquic-targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) +include(CMakePackageConfigHelpers) +configure_package_config_file( + lsquic-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/lsquic-config.cmake + INSTALL_DESTINATION share/lsquic + NO_CHECK_REQUIRED_COMPONENTS_MACRO + PATH_VARS CMAKE_INSTALL_INCLUDEDIR) + +install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/lsquic-config.cmake + DESTINATION share/lsquic) + +install( + EXPORT lsquic-targets + DESTINATION share/lsquic + NAMESPACE lsquic:: + FILE lsquic-targets.cmake) diff --git a/src/liblsquic/lsquic-config.cmake b/src/liblsquic/lsquic-config.cmake new file mode 100644 index 0000000..d45b5bb --- /dev/null +++ b/src/liblsquic/lsquic-config.cmake @@ -0,0 +1,4 @@ +@PACKAGE_INIT@ + +set_and_check(lsquic_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") +include("${CMAKE_CURRENT_LIST_DIR}/lsquic-targets.cmake")