-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
39 lines (30 loc) · 1.13 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#
# Copyright (c) 2024 Abdullatif Kalla.
#
# This source code is licensed under the MIT license found in the
# LICENSE.txt file in the root directory of this source tree.
#
cmake_minimum_required(VERSION 3.13)
project(Xclox VERSION 1.0.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Generate version.hpp
configure_file(
${PROJECT_SOURCE_DIR}/version.in
${PROJECT_SOURCE_DIR}/include/xclox/version.hpp
)
# Fetch ASIO
include(FetchContent)
FetchContent_Declare(asio DOWNLOAD_EXTRACT_TIMESTAMP true URL "https://sourceforge.net/projects/asio/files/asio/1.28.1%20%28Stable%29/asio-1.28.1.zip/download")
FetchContent_MakeAvailable(asio)
file(GLOB_RECURSE header_files LIST_DIRECTORIES false "${PROJECT_SOURCE_DIR}/include/*.hpp")
add_library(xclox INTERFACE)
target_sources(xclox INTERFACE ${header_files})
target_include_directories(xclox SYSTEM INTERFACE ${asio_SOURCE_DIR}/include include)
option(XCLOX_CODE_COVERAGE "generate a code-coverage report" OFF)
option(XCLOX_BUILD_TESTS "build tests" ON)
if(XCLOX_BUILD_TESTS)
add_subdirectory(test)
endif()
add_subdirectory(demo)