[Libwebsockets] Correct use of libwebsockets with cmake

Andy Green andy at warmcat.com
Tue Dec 8 04:09:22 CET 2015



On December 7, 2015 6:42:14 PM GMT+08:00, "Charles Prévot" <prevot at cervval.com> wrote:
>Hello again,
>Can I suggest the following patch to export LibwebsocketsConfig.cmake ?

Thanks... it worked for me and is pushed.

-Andy
>
>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>
>>




More information about the Libwebsockets mailing list