Skip to content

Commit bc765e7

Browse files
author
lanthora
authored
Add pkgconfig file (#459)
1 parent dfa10df commit bc765e7

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

CMakeLists.txt

+7-1
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ if (USE_TLS)
136136
else() # default to OpenSSL on all other platforms
137137
if (NOT USE_MBED_TLS) # Unless mbedtls is requested
138138
set(USE_OPEN_SSL ON)
139+
set(requires "openssl")
139140
endif()
140141
endif()
141142

@@ -167,7 +168,8 @@ if(BUILD_SHARED_LIBS)
167168
)
168169

169170
# Set library version
170-
set_target_properties(ixwebsocket PROPERTIES VERSION 11.3.2)
171+
set(version 11.3.2)
172+
set_target_properties(ixwebsocket PROPERTIES VERSION ${version})
171173

172174
else()
173175
# Static library
@@ -290,6 +292,10 @@ if (IXWEBSOCKET_INSTALL)
290292
configure_file("${CMAKE_CURRENT_LIST_DIR}/ixwebsocket-config.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/ixwebsocket-config.cmake" @ONLY)
291293
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ixwebsocket-config.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/ixwebsocket")
292294

295+
set(prefix ${CMAKE_INSTALL_PREFIX})
296+
configure_file("${CMAKE_CURRENT_LIST_DIR}/ixwebsocket.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/ixwebsocket.pc" @ONLY)
297+
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ixwebsocket.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
298+
293299
install(EXPORT ixwebsocket
294300
FILE ixwebsocket-targets.cmake
295301
NAMESPACE ixwebsocket::

ixwebsocket.pc.in

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
prefix=@prefix@
2+
exec_prefix=${prefix}
3+
libdir=${exec_prefix}/lib
4+
includedir=${prefix}/include
5+
6+
Name: ixwebsocket
7+
Description: websocket and http client and server library, with TLS support and very few dependencies
8+
Version: @version@
9+
Libs: -L${libdir} -lixwebsocket
10+
Cflags: -I${includedir}
11+
Requires: @requires@

0 commit comments

Comments
 (0)