-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
44 lines (31 loc) · 1.4 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
########################################################################################################################
cmake_minimum_required(VERSION 3.28 FATAL_ERROR)
########################################################################################################################
project(ExTrait
VERSION 1.0.0
DESCRIPTION "A useful helper library, providing a handful of amazing type-traits and template magic."
HOMEPAGE_URL "https://elandasunshine.github.io/ExTrait"
LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
option(EXTRAIT_BUILD_TESTS "Build all included tests" OFF)
option(EXTRAIT_EXPERIMENTAL_FEATURES "If set to ON, will enable experimental features that are still in testing" OFF)
########################################################################################################################
# Creating library
string(TOLOWER "${PROJECT_NAME}" LC_PROJECT_NAME)
add_library(${PROJECT_NAME} INTERFACE)
add_library(${LC_PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
# Adding files
target_sources(${PROJECT_NAME}
INTERFACE
FILE_SET HEADERS
BASE_DIRS "include")
# Add definitions
target_compile_definitions(${PROJECT_NAME}
INTERFACE
EXTRAIT_EXPERIMENTAL_FEATURES=$<BOOL:${EXTRAIT_EXPERIMENTAL_FEATURES}>)
# Tests setup
if (EXTRAIT_BUILD_TESTS)
include(CTest)
add_subdirectory(test)
endif()