-
Notifications
You must be signed in to change notification settings - Fork 41
/
CMakeLists.txt
39 lines (31 loc) · 1.11 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
cmake_minimum_required(VERSION 3.11...3.25)
project(Graaf
VERSION 0.1.0
DESCRIPTION "A light-weight C++ graph library."
LANGUAGES C CXX
)
# This project uses C++ 20 features
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# The target name of the Library, what name you give to the Interface
set(GRAAF_LIB_TARGET_NAME ${PROJECT_NAME})
# Example usages of the library
option(SKIP_EXAMPLES "Skip building the examples" OFF)
if(NOT SKIP_EXAMPLES)
add_subdirectory(examples)
endif()
# Enables testing in CMAKE, needs to be called BEFORE call to add_subdirectory
option(SKIP_TESTS "Skip building the tests" OFF)
if(NOT SKIP_TESTS)
enable_testing()
add_subdirectory(test)
endif()
# Benchmarks
option(SKIP_BENCHMARKS "Skip building the performance benchmarks" OFF)
if(NOT SKIP_BENCHMARKS)
add_subdirectory(perf)
endif()
#Adding Interface to enable use of FetchContent
add_library(${GRAAF_LIB_TARGET_NAME} INTERFACE)
add_library(${PROJECT_NAME}::${GRAAF_LIB_TARGET_NAME} ALIAS ${PROJECT_NAME})
target_include_directories(${GRAAF_LIB_TARGET_NAME} INTERFACE "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/include/")