forked from Return-To-The-Roots/libutil
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
45 lines (40 loc) · 1.28 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
40
41
42
43
44
45
# Copyright (C) 2005 - 2021 Settlers Freaks <sf-team at siedler25.org>
#
# SPDX-License-Identifier: GPL-2.0-or-later
cmake_minimum_required(VERSION 3.8)
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
project(s25util)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
if(CMAKE_VERSION VERSION_LESS 3.14)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_3.14")
endif()
# The super project might e.g. call find_package(Boost ... nowide), if the target is not defined, download directly
if(NOT TARGET Boost::nowide)
message(STATUS "Fetching Boost.Nowide from repository...")
include(FetchContent)
FetchContent_Declare(
BoostNowide
GIT_REPOSITORY https://github.com/boostorg/nowide.git
GIT_TAG v11.1.1
)
include(SaveVariables)
save_variables(BUILD_SHARED_LIBS CMAKE_POSITION_INDEPENDENT_CODE BUILD_TESTING)
set(BUILD_SHARED_LIBS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(BUILD_TESTING OFF)
FetchContent_MakeAvailable(BoostNowide)
pop_saved_variables()
endif()
add_subdirectory(libs)
if(ClangFormat_FOUND)
add_ClangFormat_folder(libs TRUE)
endif()
include(RttrTestingCfg)
if(BUILD_TESTING)
add_subdirectory(tests)
if(ClangFormat_FOUND)
add_ClangFormat_folder(tests TRUE)
endif()
endif()