forked from CESM-Development/CMake_Fortran_utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CESM_utils.cmake
73 lines (54 loc) · 2.01 KB
/
CESM_utils.cmake
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Module used for CESM testing.
#
# This module contains statements that would otherwise be boilerplate in
# most CESM tests. It enables CTest testing, handles the USE_COLOR and
# ENABLE_GENF90 arguments, and includes several other modules.
#==========================================================================
# Copyright (c) 2013-2014, University Corporation for Atmospheric Research
#
# This software is distributed under a two-clause BSD license, with no
# warranties, express or implied. See the accompanying LICENSE file for
# details.
#==========================================================================
#=================================================
# Enable CTest tests.
#=================================================
enable_testing()
#=================================================
# Color output
#=================================================
option(USE_COLOR "Allow color from the build output." ON)
set(CMAKE_COLOR_MAKEFILE "${USE_COLOR}")
#=================================================
# Compiler info
#=================================================
if("${CMAKE_BUILD_TYPE}" MATCHES CESM)
include(${CMAKE_BINARY_DIR}/CESM_Macros.cmake)
else()
include(Compilers)
endif()
#=================================================
# GenF90
#=================================================
option(ENABLE_GENF90
"Use genf90.pl to regenerate out-of-date Fortran files from .in files."
OFF)
if(ENABLE_GENF90)
find_program(GENF90 genf90.pl)
if(NOT GENF90)
message(FATAL_ERROR "ENABLE_GENF90 enabled, but genf90.pl not found!")
endif()
endif()
# Preprocessing utility functions.
include(genf90_utils)
#=================================================
# pFUnit
#=================================================
# pFUnit and its preprocessor
find_package(pFUnit)
# Preprocessor and driver handling.
include(pFUnit_utils)
#=================================================
# Source list and path utilities.
#=================================================
include(Sourcelist_utils)