1

I compiled libwebsockets using:

cmake
make all
sudo make install
ldconfig

I'm trying to compile an example, but CMake gives the error that lws must have been configured with LWS_ROLE_WS. I cannot work out how to 'create' lws with that option.

I'm quite happy with makefiles, but I know little about CMake, and here the configuration appears to be very complicated. The build instructions include some options, but nothing relating to this.

Basically, I don't even understand where I should be looking; is it necessary to be fluent in CMake to use libwebsockets?

Kevin
  • 16,549
  • 8
  • 60
  • 74
  • When configure the project with `cmake`, you may pass additional options with `-D=ON/OFF`. See [that question](https://stackoverflow.com/questions/5998186/adding-command-line-options-to-cmake) for examples. – Tsyvarev Aug 01 '19 at 12:43
  • @Tsyvarev. Thanks. I recompiled / installed starting from cmake -DLWS_ROLE_WS but it changed nothing. I note that the test-client binary in the lws make all is being buil; it may that this is a local cmake error. – Roger Irwin Aug 01 '19 at 13:02
  • "I recompiled / installed starting from cmake -DLWS_ROLE_WS" - You mean `-DLWS_ROLE_WS=ON`, don't you? Please, add **exact error message** (with surrounding log lines) into the question post. – Tsyvarev Aug 01 '19 at 13:21
  • I used -DLWS_ROLE_WS=1, so I just re ran that with 'ON' to be sure. I noticed that cmake is apparently listing all the options, ON or OFF, and LWS_ROLE_WS is not among them. It also said for more help do cmake -LH. So I did. In the output I did see the entry: LWS_ROLE_WS:BOOL=ON which I assume it means this option should be on by default. – Roger Irwin Aug 01 '19 at 13:33
  • I just tried compiling using my own simple makefile and its fine, I think there is probably some sort of error in the cmake configuration of the example app; but as it happens I don't appear to need it, it compiles fine without! – Roger Irwin Aug 01 '19 at 13:45
  • "I assume it means this option should be on by default." - Hm, yes, ON is a [default value](https://github.com/warmcat/libwebsockets/blob/master/CMakeLists.txt#L27) for this option. Again, please, add **exact error message** to the question post, with surround info. With current information it is unclear what is going on. – Tsyvarev Aug 01 '19 at 14:18

0 Answers0