-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
32 lines (28 loc) · 1 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
cmake_minimum_required(VERSION 3.14)
# get version and date from files (version.txt and version_date.txt)
include(cmake/version.cmake)
get_version(SMI_VER SMI_VER_DEV SMI_DATE)
# create the project
project(smi
VERSION ${SMI_VER}
DESCRIPTION "The Soil Moisture Index - SMI program"
LANGUAGES Fortran
)
# add full version and date to pre-processor flags (qoutes need in before hand)
add_compile_definitions(PROJVERSION='${SMI_VER_DEV}' PROJDATE='${SMI_DATE}')
# add the executable
add_subdirectory(./app)
# add the library
add_subdirectory(./src)
# setup coverage with GNU
if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU" AND CMAKE_WITH_COVERAGE)
include(cmake/CodeCoverage.cmake)
append_coverage_compiler_flags_to_target(smi-lib)
append_coverage_compiler_flags_to_target(smi-exe)
SETUP_TARGET_FOR_COVERAGE_LCOV(
NAME smi_coverage_CI
EXECUTABLE ../CI-scripts/run_cmake_coverage.sh
DEPENDENCIES smi-exe smi-lib
GENHTML_ARGS -t "SMI coverage" --html-prolog ../doc/html_files/cov_header.prolog
)
endif()