forked from MagicBowen/easy-graph
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
44 lines (29 loc) · 1009 Bytes
/
CMakeLists.txt
File metadata and controls
44 lines (29 loc) · 1009 Bytes
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
cmake_minimum_required(VERSION 3.14)
# ---- Project ----
project(easy_graph VERSION 1.0.0)
set(TARGET_LIB ${PROJECT_NAME})
# ---- Include guards ----
if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
message(
FATAL_ERROR
"In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there."
)
endif()
# ---- Options for project ----
option(SHARED "Generate shared library otherwise static" OFF)
option(EXAMPLE "Generate examples of target" ON)
option(ENABLE_TEST "Build tests" OFF)
option(ENABLE_TEST_COVERAGE "Enable test coverage" OFF)
# ---- Using CPM to add dependencies for project ----
include(${PROJECT_SOURCE_DIR}/cmake/CPM.cmake)
CPMUsePackageLock(package-lock.cmake)
# ---- Add source folder for project ----
add_subdirectory("src")
# ---- Add example for project ----
if(EXAMPLE)
add_subdirectory(example)
endif()
# ---- Add test for project ----
if(ENABLE_TEST)
add_subdirectory(test)
endif()