-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
37 lines (25 loc) · 1.08 KB
/
CMakeLists.txt
File metadata and controls
37 lines (25 loc) · 1.08 KB
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
# Copyright (C) 2005 - 2025 Settlers Freaks <sf-team at siedler25.org>
#
# SPDX-License-Identifier: GPL-2.0-or-later
cmake_minimum_required(VERSION 3.16..3.20)
project(libendian)
include(RttrBoostCfg)
find_package(Boost 1.64.0 REQUIRED)
include(EnableWarnings)
file(GLOB _sources src/*.cpp)
file(GLOB_RECURSE _headers include/*.*)
add_library(endian_interface INTERFACE)
add_library(endian::interface ALIAS endian_interface)
target_include_directories(endian_interface INTERFACE include)
target_link_libraries(endian_interface INTERFACE Boost::boost)
target_compile_features(endian_interface INTERFACE cxx_std_17)
enable_warnings(endian_interface)
# Optional. Build only when referenced as it can also be used as header-only library
add_library(endian_static STATIC EXCLUDE_FROM_ALL ${_sources} ${_headers})
add_library(endian::static ALIAS endian_static)
target_link_libraries(endian_static PUBLIC endian_interface)
set_target_properties(endian_static PROPERTIES CXX_EXTENSIONS OFF)
enable_warnings(endian_static)
if(ClangFormat_FOUND)
add_clangFormat_files(${_sources} ${_headers})
endif()