Add CMake install target (#171)

This commit is contained in:
Jonas Vautherin 2020-10-01 14:45:41 +02:00 committed by GitHub
parent b62ec17fd2
commit 966c52fc78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View File

@ -9,6 +9,8 @@ OPTION(LSQUIC_BIN "Compile example binaries that use the library" ON)
OPTION(LSQUIC_TESTS "Compile library unit tests" ON)
OPTION(LSQUIC_SHARED_LIB "Compile as shared librarry" OFF)
INCLUDE(GNUInstallDirs)
IF (CMAKE_SYSTEM_NAME STREQUAL "Linux")
# If using older glibc, need to link with -lrt. See clock_getres(2).
EXECUTE_PROCESS(
@ -336,3 +338,10 @@ IF(SPHINX)
ELSE()
MESSAGE(STATUS "sphinx-build not found: docs won't be made")
ENDIF()
INSTALL(FILES
include/lsquic.h
include/lsquic_types.h
include/lsxpack_header.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lsquic
)

View File

@ -115,3 +115,9 @@ ELSE()
add_library(lsquic STATIC ${lsquic_STAT_SRCS})
ENDIF()
install(TARGETS lsquic
EXPORT lsquic-targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)