• Home
  • Raw
  • Download

Lines Matching +full:cmake +full:-

8 ./bootstrap-vcpkg.sh
14 @section cm Introduction to CMake
16 CMake is a multi-platform build tool that can generate build files for many
17 different target platforms. See more info at http://www.cmake.org
19 CMake also allows/recommends you to do "out of source"-builds, that is,
27 - Windows (Visual Studio)
28 - Windows (MinGW)
29 - Linux (x86 and ARM)
30 - OSX
31 - NetBSD
36 The project settings used by CMake to generate the platform specific build
37 files is called [CMakeLists.txt](../CMakeLists.txt). CMake then uses one of its "Generators" to
39 the available generators for your platform, simply run the "cmake" command.
47 1. Install CMake 2.8 or greater: http://cmake.org/cmake/resources/software.html
57 $ cmake ..
65 on your filesystem, and that the argument `..` given to cmake is simply
71 as --prefix= with autotools. It defaults to /usr/local.
74 $ cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr .
79 following to the cmake line
81 -DLIB_SUFFIX=64
85 If you are building against a non-distro OpenSSL (eg, in order to get
87 express that in one cmake command is eg,
89 $ cmake .. -DOPENSSL_ROOT_DIR=/usr/local/ssl \
90 -DCMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE=/usr/local/ssl \
91 -DLWS_WITH_HTTP2=1
94 When you run the test apps using non-distro SSL, you have to force them
97 $ LD_LIBRARY_PATH=/usr/local/ssl/lib libwebsockets-test-server --ssl
100 To get it to build on latest openssl (2016-04-10) it needed this approach
102cmake .. -DLWS_WITH_HTTP2=1 -DLWS_OPENSSL_INCLUDE_DIRS=/usr/local/include/openssl -DLWS_OPENSSL_LI…
108 $ export OPENSSL_ROOT_DIR=/usr/local/Cellar/openssl/1.0.2k; cmake ..; make -j4
117 $ cmake .. -DCMAKE_BUILD_TYPE=DEBUG
125 $ cmake .. -DCMAKE_C_FLAGS=-m64 -DCMAKE_EXE_LINKER_FLAGS="-lsocket -lnsl"
141 $ cmake .. -DBUILD_SHARED_LIBS=1
142 $ make -j8
149 $ cmake .. -DOPENSSL_LIBRARIES="/projects/boringssl/build/ssl/libssl.so;\
151 -DOPENSSL_INCLUDE_DIRS=/projects/boringssl/include \
152 -DLWS_WITH_BORINGSSL=1 -DCMAKE_BUILD_TYPE=DEBUG
153 $ make -j8 && sudo make install
156 /usr/local/bin/libwebsockets-test-server -s
168 privileges. If libcap-dev or similar package is installed providing
170 libcap.so, CMake will enable the capability features.
176 @section cmq Quirk of cmake
178 When changing cmake options, for some reason the only way to get it to see the
180 cmake from scratch.
187 1. Install CMake 2.6 or greater: http://cmake.org/cmake/resources/software.html
191 (**NOTE**: Preferably in the default location to make it easier for CMake to find them)
203 cmake -G "Visual Studio 10" ..
206 (**NOTE**: There is also a cmake-gui available on Windows if you prefer that)
217 - iphlpapi.lib
218 - psapi.lib
219 - userenv.lib
221 6. If you're using libuv, you must make sure to compile libuv with the same multithread-dll / Mtd a…
228 For Fedora, it's, eg, `dnf install mingw64-gcc`
230 2. Install current CMake package
232 For Fedora, it's `dnf install cmake`
234 3. Instal mingw-built OpenSSL pieces
236 For Fedora, it's `mingw64-openssl.noarch mingw64-openssl-static.noarch`
238 mingw64-cmake as described below will auto-find the libs and includes
240 `/usr/x86_64-w64-mingw32/sys-root/mingw/bin/` as the dlls are installed to,
245 For Fedora, they provide a `mingw64-cmake` wrapper in the package
246 `mingw64-filesystem`, with this you can run that instead of cmake directly
247 and don't have to get involved with setting the cmake generator.
255 $ cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=C:/MinGW ..
261 $ cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=C:/MinGW -DCMAKE_BUILD_TYPE=DEBUG ..
269 @section distro Selecting CMake options useful for distros
271 Distro packagers should select the CMake option "LWS_WITH_DISTRO_RECOMMENDED",
277 - If you are really restricted on memory, code size, or don't care about TLS
278 speed, mbedTLS is a good choice: `cmake .. -DLWS_WITH_MBEDTLS=1`
280 - If cpu and memory is not super restricted and you care about TLS speed,
303 to validate it, ie, use -A with the test client. The minimal test clients
307 @section optee Building for OP-TEE
309 OP-TEE is a "Secure World" Trusted Execution Environment.
311 Although lws is only part of the necessary picture to have an https-enabled
312 TA, it does support OP-TEE as a platform and if you provide the other
315 Select it in cmake with `-DLWS_PLAT_OPTEE=1`
320 To set compile time flags you can either use one of the CMake gui applications
327 cmake -LH ..
331 cmake -DLWS_WITH_SSL=0 ..
333 cmake -DLWS_WITH_SSL:BOOL=OFF ..
337 If you have a curses-enabled build you simply type:
344 On windows CMake comes with a gui application:
345 Start -> Programs -> CMake -> CMake (cmake-gui)
351 https://www.wolfssl.com/wolfSSL/Products-wolfssl.html
356 **NOTE**: wolfssl needs to be compiled using the `--enable-opensslextra` flag for
362 cmake .. -DLWS_WITH_WOLFSSL=1 \
363 -DLWS_WOLFSSL_INCLUDE_DIRS=/path/to/wolfssl \
364 -DLWS_WOLFSSL_LIBRARIES=/path/to/wolfssl/wolfssl.a ..
372 cmake .. -DLWS_WITH_CYASSL=1 \
373 -DLWS_CYASSL_INCLUDE_DIRS=/path/to/cyassl \
374 -DLWS_CYASSL_LIBRARIES=/path/to/wolfssl/cyassl.a ..
382 MINIZ instead by using `-DLWS_WITH_MINIZ=1`.
384 For native build cmake will try to find an existing libminiz.so or .a and build
387 For cross-build or building against local miniz, you need the following kind of
388 cmake to tell it where to get miniz
391 cmake .. -DLWS_WITH_MINIZ=1 -DLWS_WITH_ZIP_FOPS=1 -DMINIZ_INCLUDE_DIRS="/projects/miniz;/projects/m…
396 Building for ESP32 requires the ESP-IDF framework. It can be built under Linux, OSX or Windows (MSY…
398 1. Install ESP-IDF, follow the getting started guide here - http://esp-idf.readthedocs.io/en/latest…
399 2. Set ESP-IDF to last known working version (assuming ESP-IDF is in `~/esp/esp-idf`) :
401 cd ~/esp/esp-idf
403 git submodule update --recursive
405 3. Add `libwebsockets` as a submodule in the `components` folder of your ESP-IDF project:
409 4. If on Windows (MSYS2) you will need to install CMake in the MSYS2 environment:
411 pacman -S mingw-w64-i686-cmake
413 If you're on Linux or OSX ensure CMake version is at least 3.7.
417 The directory ./plugin-standalone/ shows how easy it is to create plugins
418 outside of lws itself. First build lws itself with -DLWS_WITH_PLUGINS,
421 cd ./plugin-standalone
424 cmake ..
429 also give the same arguments to cmake here (eg,
430 ` -DCMAKE_INSTALL_PREFIX:PATH=/usr/something/else...` )
432 Otherwise if you run lwsws or libwebsockets-test-server-v2.0, it will now
444 reasons. You do this using info->pvo or for lwsws, in the JSON config.
449 Enable `-DLWS_WITH_HTTP2=1` in cmake to build with http/2 support enabled.
463 with the test server running in -s / ssl mode.
468 $ nghttp -nvas https://localhost:7681/test.html
474 $ h2spec -h 127.0.0.1 -p 7681 -t -k -v -o 1
484 ./test-apps/attack.sh contains scripted tests that are the basis
490 $ cmake .. -DLWS_WITH_GCOV=1 -DCMAKE_BUILD_TYPE=DEBUG
491 $ ../scripts/build-gcov.sh
492 $ ../test-apps/attack.sh
501 [lws on Appveyor](https://ci.appveyor.com/project/lws-team/libwebsockets)
504 …ble to run the test server, by running it from `bin/Release/libwebsockets-test-server.exe` and ope…
508 To enable cross-compiling **libwebsockets** using CMake you need to create
509 a "Toolchain file" that you supply to CMake when generating your build files.
510 CMake will then use the cross compilers and build paths specified in this file
513 …includes an example toolchain file [cross-arm-linux-gnueabihf.cmake](../contrib/cross-arm-linux-gn…
518 $ cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr/lib/my-cross-root \
519 -DCMAKE_TOOLCHAIN_FILE=../contrib/cross-arm-linux-gnueabihf.cmake \
520 -DLWS_WITHOUT_EXTENSIONS=1 -DLWS_WITH_SSL=0 \
521 -DLWS_WITH_ZIP_FOPS=0 -DLWS_WITH_ZLIB=0
526 **NOTE**: start from an EMPTY build directory if you had a non-cross build in there
528 Delete `build/CMakeCache.txt` at least before trying a new cmake config
531 Additional information on cross compilation with CMake:
536 Here are step by step instructions for cross-building the external projects needed for lws with lws…
538 In the example, my toolchain lives in `/projects/aist-tb/arm-tc` and is named `arm-linux-gnueabihf`…
542 All "foreign" cross-built binaries are sent into `/tmp/cross` so they cannot be confused for 'nativ…
544 ## Prepare the cmake toolchain file
548 2) `wget -O mytoolchainfile https://raw.githubusercontent.com/warmcat/libwebsockets/main/contrib/cr…
553 set(CROSS_PATH /projects/aist-tb/arm-tc/)
554 set(CMAKE_C_COMPILER "${CROSS_PATH}/bin/arm-linux-gnueabihf-gcc")
555 set(CMAKE_CXX_COMPILER "${CROSS_PATH}/bin/arm-linux-gnueabihf-g++")
560 1) `export PATH=/projects/aist-tb/arm-tc/bin:$PATH` Notice there is a **/bin** on the end of the t…
562 2) `cd /tmp ; mkdir cross` we will put the cross-built libs in /tmp/cross
571 + libtoolize --copy
580 + aclocal -I m4
582 + automake --add-missing --copy
583 configure.ac:38: installing './ar-lib'
587 configure.ac:21: installing './install-sh'
593 6) `./configure --host=arm-linux-gnueabihf --prefix=/tmp/cross`
599 /tmp/cross/lib/libuv.so.1.0.0: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamical…
608 3) `CC=arm-linux-gnueabihf-gcc ./configure --prefix=/tmp/cross`
611 Building shared library libz.so.1.2.11 with arm-linux-gnueabihf-gcc.
626 arm-linux-gnueabihf-gcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -I. -c -o example.o test/example.c
628 rm -f /tmp/cross/include/zlib.h /tmp/cross/include/zconf.h
635 /tmp/cross/lib/libz.so.1.2.11: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamical…
646cmake .. -DCMAKE_TOOLCHAIN_FILE=/tmp/mytoolchainfile -DCMAKE_INSTALL_PREFIX:PATH=/tmp/cross -DCMAK…
652 /tmp/cross/lib/libmbedcrypto.so.2.6.0: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), d…
665 cmake .. -DCMAKE_TOOLCHAIN_FILE=/tmp/mytoolchainfile \
666 -DCMAKE_INSTALL_PREFIX:PATH=/tmp/cross \
667 -DLWS_WITH_LWSWS=1 \
668 -DLWS_WITH_MBEDTLS=1 \
669 -DLWS_MBEDTLS_LIBRARIES="/tmp/cross/lib/libmbedcrypto.so;/tmp/cross/lib/libmbedtls.so;/tmp/cross/li…
670 -DLWS_MBEDTLS_INCLUDE_DIRS=/tmp/cross/include \
671 -DLWS_LIBUV_LIBRARIES=/tmp/cross/lib/libuv.so \
672 -DLWS_LIBUV_INCLUDE_DIRS=/tmp/cross/include \
673 -DLWS_ZLIB_LIBRARIES=/tmp/cross/lib/libz.so \
674 -DLWS_ZLIB_INCLUDE_DIRS=/tmp/cross/include
681 /tmp/cross/lib/libwebsockets.so.11: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dyna…
684 5) `arm-linux-gnueabihf-objdump -p /tmp/cross/lib/libwebsockets.so.11 | grep NEEDED` Confirm that …
699 Embedded server-only configuration without extensions (ie, no compression
701 server, built on ARM Cortex-A9:
703 Update at 8dac94d (2013-02-18)
705 $ ./configure --without-client --without-extensions --disable-debug --without-daemonize
708 Per-connection [3]: 72 bytes, +1328 during headers
723 |--------------------------------|---------|---------|-------|------|
732 [1] `--disable-debug` only removes messages below `lwsl_notice`. Since that is