zephyr/samples/net/civetweb/websocket_server/CMakeLists.txt
Torsten Rasmussen 1cccc8a8fe cmake: increase minimal required version to 3.20.0
Move to CMake 3.20.0.

At the Toolchain WG it was decided to move to CMake 3.20.0.

The main reason for increasing CMake version is better toolchain
support.

Better toolchain support is added in the following CMake versions:
- armclang, CMake 3.15
- Intel oneAPI, CMake 3.20
- IAR, CMake 3.15 and 3.20

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-08-20 09:47:34 +02:00

55 lines
1.3 KiB
CMake

# Copyright (c) 2020 Alexander Kozhinov <AlexanderKozhinov@yandex.com>
#
# SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 3.20.0)
set(common_dir ${CMAKE_CURRENT_SOURCE_DIR}/../common)
set(common_src_dir ${common_dir}/src)
set(common_include_dir ${common_dir}/include)
set(inc_dir ${CMAKE_CURRENT_SOURCE_DIR}/include)
set(src_dir ${CMAKE_CURRENT_SOURCE_DIR}/src)
include_directories(
${inc_dir}
${common_include_dir}
)
option(CIVETWEB_ENABLE_WEBSOCKETS "Enable websockets connections" ON)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(civetweb_websocket_server)
target_sources(app PRIVATE
${src_dir}/main.c
${common_src_dir}/libc_extensions.c
${src_dir}/http_server_handlers.c
${src_dir}/websocket_server_handlers.c)
set(gen_dir ${ZEPHYR_BINARY_DIR}/include/generated/)
set(web_page_dir web_page)
file(MAKE_DIRECTORY ${gen_dir}/${web_page_dir})
# List of files that are used to generate .h file that can be included
# into .c file.
foreach(inc_file
${web_page_dir}/index.html
${web_page_dir}/index.css
${web_page_dir}/ws.js)
# Generate normal and gzipped versions of each file:
generate_inc_file_for_target(app
${inc_file}
${gen_dir}/${inc_file}.inc)
generate_inc_file_for_target(app
${inc_file}
${gen_dir}/${inc_file}.gz.inc
--gzip)
endforeach()
include(${ZEPHYR_BASE}/samples/net/common/common.cmake)