-
Notifications
You must be signed in to change notification settings - Fork 11
/
PnMPIConfig.cmake.in
193 lines (162 loc) · 6.39 KB
/
PnMPIConfig.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# This file is part of P^nMPI.
#
# Copyright (c)
# 2008-2019 Lawrence Livermore National Laboratories, United States of America
# 2011-2016 ZIH, Technische Universitaet Dresden, Federal Republic of Germany
# 2013-2019 RWTH Aachen University, Federal Republic of Germany
#
#
# P^nMPI is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation version 2.1 dated February 1999.
#
# P^nMPI is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with P^nMPI; if not, write to the
#
# Free Software Foundation, Inc.
# 51 Franklin St, Fifth Floor
# Boston, MA 02110, USA
#
#
# Written by Martin Schulz, schulzm@llnl.gov.
#
# LLNL-CODE-402774
# Search for dependencies required by PnMPI. These are required for compiling
# code which uses PnMPI.
#
# NOTE: Other packages need to be searched before this package is initialized,
# as other packages may overwrite the PACKAGE_PREFIX_DIR of this package.
IF (POLICY CMP0074)
CMAKE_POLICY(PUSH)
#if MPI_ROOT is set, use it for finding MPI
CMAKE_POLICY(SET CMP0074 NEW)
ENDIF ()
find_package(MPI REQUIRED)
IF (POLICY CMP0074)
CMAKE_POLICY(POP)
ENDIF ()
@PACKAGE_INIT@
# Basic PnMPI configuration.
#
# The following variables store the basic PnMPI configuration and may be used to
# check if basic conditions are met or where to find dependencies.
set(PnMPI_VERSION "@PNMPI_VERSION@" CACHE INTERNAL "")
set(PnMPI_VERSION_MAJOR "@PNMPI_VERSION_MAJOR@" CACHE INTERNAL "")
set(PnMPI_VERSION_MINOR "@PNMPI_VERSION_MINOR@" CACHE INTERNAL "")
set(PnMPI_VERSION_PATCH "@PNMPI_VERSION_PATCH@" CACHE INTERNAL "")
set(PnMPI_VERSION_TWEAK "@PNMPI_VERSION_TWEAK@" CACHE INTERNAL "")
# Set dependent PnMPI configuration.
#
# Some of PnMPI's configuration variables depend on how PnMPI is included into
# other projects (via find_package() or add_subdirectory()). These variables
# will be set depending on the include mode and cached later if necessary.
if (NOT PnMPI_IS_SUBPROJECT)
set_and_check(PnMPI_INCLUDE_DIR "@CMAKE_INSTALL_FULL_INCLUDEDIR@")
set_and_check(PnMPI_MODULES_DIR "@PnMPI_MODULES_DIR@")
else ()
include(PnMPI_headers)
set(PnMPI_INCLUDE_DIR "${PNMPI_HEADER_DIR}"
"@PROJECT_SOURCE_DIR@/src/pnmpi"
"@PROJECT_BINARY_DIR@")
endif ()
set(PnMPI_INCLUDE_PATH
${PnMPI_INCLUDE_DIR}
${MPI_C_INCLUDE_PATH}
CACHE PATH "PnMPI include paths")
set(PnMPI_MODULES_PATH ${PnMPI_MODULES_DIR} CACHE PATH "PnMPI modules location")
# Component configuration.
#
# PnMPI has optional components, which will be configured in the following
# section. find_package() provides capabilities to check whether a module has a
# specific component or not.
set(PnMPI_PnMPIze_FOUND @ENABLE_PNMPIZE@ CACHE INTERNAL "")
# Handle arguments of 'find_package()'.
#
# If 'find_package()' is used to find PnMPI, check its arguments and required
# components.
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PnMPI
REQUIRED_VARS
PnMPI_VERSION
PnMPI_INCLUDE_PATH
PnMPI_MODULES_PATH
HANDLE_COMPONENTS
)
mark_as_advanced(
PnMPI_INCLUDE_PATH
PnMPI_MODULES_PATH
)
# Include PnMPI targets as imported targets.
#
# By including the following files, PnMPI targets will be imported to be used by
# the project including this file.
#
# NOTE: This is not necessary, if PnMPI is included via 'add_subdirectory()',
# as PnMPI's native targets are available.
if (NOT PnMPI_IS_SUBPROJECT)
include(${PACKAGE_PREFIX_DIR}/pnmpi-libs.cmake)
include(${PACKAGE_PREFIX_DIR}/pnmpi-patch.cmake)
if (PnMPI_PnMPIze_FOUND)
include(${PACKAGE_PREFIX_DIR}/pnmpize.cmake)
endif ()
endif ()
# Set aliases for PnMPI libraries and executables.
#
# These variables may be used to link against the PnMPI libraries. However, the
# path to the library itself is not stored in these variables, but the names of
# the targets imported above.
# Basic PnMPI library. Default for most people.
set(PnMPI_LIBRARIES pnmpi CACHE INTERNAL "")
# Language-specific PnMPI library targets to link against.
set(PnMPI_C_LIBRARIES pnmpi CACHE INTERNAL "")
set(PnMPI_C_STATIC_LIBRARIES pnmpi_static CACHE INTERNAL "")
set(PnMPI_CXX_LIBRARIES pnmpi CACHE INTERNAL "")
set(PnMPI_CXX_STATIC_LIBRARIES pnmpi_static CACHE INTERNAL "")
set(PnMPI_Fortran_LIBRARIES pnmpif CACHE INTERNAL "")
set(PnMPI_Fortran_STATIC_LIBRARIES pnmpif_static CACHE INTERNAL "")
# PnMPI specific binaries.
set(PnMPI_PATCHER pnmpi-patch CACHE INTERNAL "")
if (PnMPI_PnMPIze_FOUND)
set(PnMPI_PnMPIze pnmpize CACHE INTERNAL "")
endif ()
# Include PnMPI specific CMake functions.
#
# PnMPI uses additional CMake functions to easily add targets for PnMPI modules.
# These will be installed along with the PnMPI configuration.
if (NOT PnMPI_IS_SUBPROJECT)
include(${PACKAGE_PREFIX_DIR}/PnMPI_modules.cmake)
else ()
include(PnMPI_modules)
endif ()
# Wrapper for pnmpi_add_pmpi_module
#
# The PnMPI module add function implements a new API. This function maps the new
# function to the legacy API, so code using the PnMPI module doesn't get broken.
#
# NOTE: This function is DEPRECATED. New code should use the new API, as this
# function will be removed in future commits.
function (add_pnmpi_module)
pnmpi_add_pmpi_module(${ARGV})
endfunction ()
# Include configuration of PnMPI dependencies.
#
# PnMPI may be build with optional dependencies. The following variables store
# the used configuration, so projects know how PnMPI was build and how to access
# its dependencies.
# These variables allow client libraries to use the same adept_utils as PnMPI
set(PnMPI_USE_adept_utils @PnMPI_USE_adept_utils@)
set(adept_utils_DIR "@adept_utils_DIR@")
if (PnMPI_USE_adept_utils)
find_package(adept_utils)
endif()
# These variables allow client libraries to use the same BFD library as PnMPI
set(PnMPI_USE_BFD @BFD_FOUND@)
set(PnMPI_BFD_INCLUDE_PATH @BFD_INCLUDE_PATH@)
set(PnMPI_BFD_LIBRARIES @BFD_LIBRARIES@)
set(PnMPI_IBERTY_INCLUDE_PATH @IBERTY_INCLUDE_PATH@)
set(PnMPI_IBERTY_LIBRARIES @IBERTY_LIBRARIES@)