forked from JCSDA/oops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
oops-config.cmake.in
103 lines (89 loc) · 3.86 KB
/
oops-config.cmake.in
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Config file for the @PROJECT_NAME@ package
# Defines the following variables:
#
# @PROJECT_NAME@_FEATURES - list of enabled features
# @PROJECT_NAME@_VERSION - version of the package
# @PROJECT_NAME@_GIT_SHA1 - Git revision of the package
# @PROJECT_NAME@_GIT_SHA1_SHORT - short Git revision of the package
# @PROJECT_NAME@_MODULES_Fortran_COMPILER_ID - CMAKE_Fortran_COMPILER_ID of compiler for modules
# @PROJECT_NAME@_MODULES_Fortran_COMPILER_VERSION - CMAKE_Fortran_COMPILER_VERSION of compiler for modules
# @PROJECT_NAME@_COEFFICIENT_DIR - Path to coefficient "fix" directory
@PACKAGE_INIT@
### computed paths
set_and_check(@PROJECT_NAME@_CMAKE_DIR "@PACKAGE_CMAKE_DIR@")
set_and_check(@PROJECT_NAME@_BASE_DIR "@PACKAGE_BASE_DIR@")
if(DEFINED ECBUILD_2_COMPAT AND ECBUILD_2_COMPAT)
set(@PNAME@_CMAKE_DIR ${@PROJECT_NAME@_CMAKE_DIR})
set(@PNAME@_BASE_DIR ${@PROJECT_NAME@_BASE_DIR})
endif()
### export version info
set(@PROJECT_NAME@_VERSION "@PACKAGE_VERSION@")
set(@PROJECT_NAME@_GIT_SHA1 "@PACKAGE_GIT_SHA1@")
set(@PROJECT_NAME@_GIT_SHA1_SHORT "@PACKAGE_GIT_SHA1_SHORT@")
if(DEFINED ECBUILD_2_COMPAT AND ECBUILD_2_COMPAT)
set(@PNAME@_VERSION "@PACKAGE_VERSION@" )
set(@PNAME@_GIT_SHA1 "@PACKAGE_GIT_SHA1@" )
set(@PNAME@_GIT_SHA1_SHORT "@PACKAGE_GIT_SHA1_SHORT@" )
endif()
### has this configuration been exported from a build tree?
set(@PROJECT_NAME@_IS_BUILD_DIR_EXPORT @_is_build_dir_export@)
if(DEFINED ECBUILD_2_COMPAT AND ECBUILD_2_COMPAT)
set(@PNAME@_IS_BUILD_DIR_EXPORT ${@PROJECT_NAME@_IS_BUILD_DIR_EXPORT})
endif()
########### ADDED TO DEFAULT ECBUILD ############
### export project specific variables
# @PROJECT_NAME@_BINDIR - Path to project binaries configured for build or install contexts
if(@_is_build_dir_export@)
set_and_check(@PROJECT_NAME@_BINDIR "@PACKAGE_BINDIR_BUILD_EXPORT@")
else()
set_and_check(@PROJECT_NAME@_BINDIR "@PACKAGE_BINDIR_INSTALL_EXPORT@")
endif()
set(@PROJECT_NAME@_LIBRARIES oops) #TODO: Change to oops::oops with namespace upgrade
if(@ENABLE_LORENZ95_MODEL@)
set(@PROJECT_NAME@_lorenz95_LIBRARIES lorenz95) #TODO: Change to oops::lorenz95 with namespace upgrade
endif()
if(@ENABLE_QG_MODEL@)
set(@PROJECT_NAME@_qg_LIBRARIES qg) #TODO: Change to oops::qg with namespace upgrade
endif()
########### ADDED TO DEFAULT ECBUILD ############
### include the <project>-import.cmake file if there is one
if(EXISTS ${@PROJECT_NAME@_CMAKE_DIR}/@CONF_IMPORT_FILE@)
set(@PROJECT_NAME@_IMPORT_FILE "${@PROJECT_NAME@_CMAKE_DIR}/@CONF_IMPORT_FILE@")
include(${@PROJECT_NAME@_IMPORT_FILE})
endif()
### handle third-party dependencies
if(DEFINED ECBUILD_2_COMPAT AND ECBUILD_2_COMPAT)
set(@PNAME@_LIBRARIES "@CONF_LIBRARIES@")
set(@PNAME@_TPLS "@CONF_TPLS@" )
include(${CMAKE_CURRENT_LIST_FILE}.tpls OPTIONAL)
endif()
### insert definitions for IMPORTED targets
if(NOT @PROJECT_NAME@_BINARY_DIR)
find_file(@PROJECT_NAME@_TARGETS_FILE
NAMES @[email protected]
HINTS @PACKAGE_TARGETS_DIRS@
NO_DEFAULT_PATH)
if(@PROJECT_NAME@_TARGETS_FILE)
include(${@PROJECT_NAME@_TARGETS_FILE})
endif()
endif()
### publish this file as imported
if( DEFINED ECBUILD_2_COMPAT AND ECBUILD_2_COMPAT )
set(@PROJECT_NAME@_IMPORT_FILE ${CMAKE_CURRENT_LIST_FILE})
mark_as_advanced(@PROJECT_NAME@_IMPORT_FILE)
set(@PNAME@_IMPORT_FILE ${CMAKE_CURRENT_LIST_FILE})
mark_as_advanced(@PNAME@_IMPORT_FILE)
endif()
### export features and check requirements
set(@PROJECT_NAME@_FEATURES "@CONF_FEATURES@")
if(DEFINED ECBUILD_2_COMPAT AND ECBUILD_2_COMPAT)
set(@PNAME@_FEATURES ${@PROJECT_NAME@_FEATURES})
endif()
foreach(_f ${@PROJECT_NAME@_FEATURES})
set(@PROJECT_NAME@_${_f}_FOUND 1)
set(@PROJECT_NAME@_HAVE_${_f} 1)
if(DEFINED ECBUILD_2_COMPAT AND ECBUILD_2_COMPAT)
set(@PNAME@_HAVE_${_f} 1)
endif()
endforeach()
check_required_components(@PROJECT_NAME@)