[Libwebsockets] Correct use of libwebsockets with cmake

Charles Prévot prevot at cervval.com
Mon Dec 7 11:42:14 CET 2015


Hello again,
Can I suggest the following patch to export LibwebsocketsConfig.cmake ?

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4f8e76c..3b41e1e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -879,6 +879,12 @@ endif()
 install(EXPORT LibwebsocketsTargets
                DESTINATION "${LWS_INSTALL_CMAKE_DIR}" COMPONENT dev)

+# Install the LibwebsocketsConfig.cmake and
LibwebsocketsConfigVersion.cmake
+install(FILES
+
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/LibwebsocketsConfig.cmake"
+               "${PROJECT_BINARY_DIR}/LibwebsocketsConfigVersion.cmake"
+               DESTINATION "${LWS_INSTALL_CMAKE_DIR}" COMPONENT dev)
+
 # build subdir is not part of sources
 set(CPACK_SOURCE_IGNORE_FILES $(CPACK_SOURCE_IGNORE_FILES) ".git" "build"
"tgz" "tar.gz")


2015-12-04 11:58 GMT+01:00 Charles Prévot <prevot at cervval.com>:

> Hello,
> I want to use libwebsockets in a cmake project, how am I supposed to do
> this ?
> I usually call find_package(LibwebSockets) that is looking for
> LibwebsocketsConfig.cmake, but that file isn't installed (only
> LibwebsocketsTargets.cmake and LibwebsocketsTargets-release.cmake are
> installed).
> Shouldn't LibwebsocketsConfig.cmake be installed ? According to
> https://cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file
> it seems to be the correct way...
>
> Thanks,
> --
> <http://www.cervval.com/private/logoColor128.png>
> *Charles Prévot*
> *02 90 26 21 10*
> *CERVVAL **140 avenue Graham Bell - **29280 Plouzané*
> <http://www.cervval.com/private/logoColor128.png>
>



-- 
<http://www.cervval.com/private/logoColor128.png>
*Charles Prévot*
*02 90 26 21 10*
*CERVVAL **140 avenue Graham Bell - **29280 Plouzané*
<http://www.cervval.com/private/logoColor128.png>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20151207/06a45e97/attachment-0001.html>


More information about the Libwebsockets mailing list