[Libwebsockets] howto build minimal example
Michael.Johanssen at web.de
Sat Nov 14 20:23:55 CET 2020
Hi - let me start with stating that I am a real beginner. So I am
working under Windows, of course.
I managed cloning the git repository, configure, generate, build and
install the basic installation w/o any cmake adaptations.
libwebsockets-test-server.exe and libwebsockets-test-client.exe seem to
work as intended.
However, now when trying to build the minimal-ws-server-timer example,
CMake Error at C:/Projects/install/cmake/LwsCheckRequirements.cmake:52
This project requires lws must have been configured with LWS_ROLE_WS
I think the error is caused because I do not know how to tell cmake
where the libwebsockets install resides.
In the libwebsockets/minimal-examples/ws-server/minimal-ws-server-timer
directory, I call:
cmake -B build -S . -DCMAKE_PREFIX_PATH="c:/Projects/install"
So my question is: What would be a correct invocation (presumably, which
variable setting(s)) that causes CMake to set respective include
cl /c /Zi /W3 /WX- /diagnostics:column /Od /Ob0 /D WIN32 /D _WINDOWS
/D HAS_LWS_ROLE_WS /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd
/GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline
/Fo"cmTC_02f8c.dir\Debug\\" /Fd"cmTC_02f8c.dir\Debug\vc142.pdb" /Gd /TC
fatal error C1083: *Datei (Include) kann nicht geöffnet werden:
"libwebsockets.h"*: No such file or directory
So libwebsockets.h is not found - apparently because cmake does not set
include directories as needed.
The minimal-ws-server-timer CMakeLists.txt file contains:
require_lws_config(LWS_ROLE_WS 1 requirements)
require_lws_config(LWS_WITH_SERVER 1 requirements)
Within require_lws_config(...), the compile is triggered by means of a
CHECK_C_SOURCE_COMPILES(...) macro call within
LwsCheckRequirements.cmake. I check respective CMake variables.
For debugging purposes, I put two printouts before the
require_lws_config call, resulting in:
Both variables are empty. I could set INCLUDE_DIRECTORIES by changing in
However, this did not help.
The install directory is structured as follows:
<all the lws-xxx.h> files
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libwebsockets