Add pkgconfig file (#459)

This commit is contained in:
lanthora 2023-04-26 02:54:25 +08:00 committed by GitHub
parent dfa10df5ae
commit bc765e73a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 1 deletions

View File

@ -136,6 +136,7 @@ if (USE_TLS)
else() # default to OpenSSL on all other platforms
if (NOT USE_MBED_TLS) # Unless mbedtls is requested
set(USE_OPEN_SSL ON)
set(requires "openssl")
endif()
endif()
@ -167,7 +168,8 @@ if(BUILD_SHARED_LIBS)
)
# Set library version
set_target_properties(ixwebsocket PROPERTIES VERSION 11.3.2)
set(version 11.3.2)
set_target_properties(ixwebsocket PROPERTIES VERSION ${version})
else()
# Static library
@ -290,6 +292,10 @@ if (IXWEBSOCKET_INSTALL)
configure_file("${CMAKE_CURRENT_LIST_DIR}/ixwebsocket-config.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/ixwebsocket-config.cmake" @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ixwebsocket-config.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/ixwebsocket")
set(prefix ${CMAKE_INSTALL_PREFIX})
configure_file("${CMAKE_CURRENT_LIST_DIR}/ixwebsocket.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/ixwebsocket.pc" @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ixwebsocket.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
install(EXPORT ixwebsocket
FILE ixwebsocket-targets.cmake
NAMESPACE ixwebsocket::

11
ixwebsocket.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: ixwebsocket
Description: websocket and http client and server library, with TLS support and very few dependencies
Version: @version@
Libs: -L${libdir} -lixwebsocket
Cflags: -I${includedir}
Requires: @requires@