-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
54 lines (44 loc) · 1.2 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
46
47
48
49
50
51
52
53
54
#
# Root CMakeLists.txt file
#
cmake_minimum_required(VERSION 3.10)
project(
seawater
VERSION 0.1.0
DESCRIPTION "Chemical composition of seawater"
LANGUAGES CXX
)
# Add custom build type for creating a coverage report.
set(CMAKE_CXX_FLAGS_COVERAGE "-fprofile-arcs -ftest-coverage")
set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE "-coverage")
# Add configure options.
option(BUILD_PYMODULE "Configure Python module." OFF)
option(BUILD_TESTS "Configure unit tests." OFF)
option(BUILD_DOCS "Configure documentation." OFF)
# Unit tests are needed for generating coverage reports.
if(CMAKE_BUILD_TYPE STREQUAL "Coverage")
set(BUILD_TESTS ON)
endif()
# Python module is needed for generating docs.
if(BUILD_DOCS)
set(BUILD_PYMODULE ON)
endif()
# Add seawater C++ library.
message("-- Configuring libseawater")
add_subdirectory(src/seawater seawater)
# Add pyseawater Python module.
if(BUILD_PYMODULE)
message("-- Configuring pyseawater")
add_subdirectory(src/pyseawater pyseawater)
endif()
# Add unit tests.
if(BUILD_TESTS)
enable_testing()
message("-- Configuring unit tests")
add_subdirectory(src/tests tests)
endif()
# Add docs.
if(BUILD_DOCS)
message("-- Configuring docs")
add_subdirectory(src/docs docs)
endif()