1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

cmake: pkgconfig: make sure to list platform libs

https://github.com/warmcat/libwebsockets/issues/1975
This commit is contained in:
Andy Green 2020-07-18 07:00:57 +01:00
parent 6625b70fb5
commit 30c68d029d

View file

@ -258,6 +258,18 @@ set(CPACK_COMPONENT_DEV_DISPLAY_NAME "Development files" PARENT_SCOPE)
if (UNIX)
# figure out pkfcfg required libs here
set(lws_requires "")
if (LWS_HAVE_LIBCAP)
if (NOT lws_requires STREQUAL "")
set(lws_requires "${lws_requires},libpcap")
else()
set(lws_requires "libpcap")
endif()
endif()
# Generate and install pkgconfig.
# (This is not indented, because the tabs will be part of the output)
file(WRITE "${PROJECT_BINARY_DIR}/libwebsockets.pc"
@ -271,8 +283,13 @@ Description: Websockets server and client library
Version: ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
Libs: -L\${libdir} -lwebsockets
Cflags: -I\${includedir}"
Cflags: -I\${includedir}
"
)
if (NOT ${lws_requires} STREQUAL "")
file(APPEND "${PROJECT_BINARY_DIR}/libwebsockets.pc" "Requires: ${lws_requires}")
endif()
install(FILES "${PROJECT_BINARY_DIR}/libwebsockets.pc"
DESTINATION lib${LIB_SUFFIX}/pkgconfig)
@ -289,9 +306,15 @@ Version: ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_P
Libs: -L\${libdir} -lwebsockets_static
Libs.private:
Cflags: -I\${includedir}"
Cflags: -I\${includedir}
"
)
if (NOT ${lws_requires} STREQUAL "")
file(APPEND "${PROJECT_BINARY_DIR}/libwebsockets_static.pc" "Requires: ${lws_requires}")
endif()
install(FILES "${PROJECT_BINARY_DIR}/libwebsockets_static.pc"
DESTINATION lib${LIB_SUFFIX}/pkgconfig)