forked from openPMD/openPMD-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
openPMDConfig.cmake.in
65 lines (55 loc) · 1.99 KB
/
openPMDConfig.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
# only add PUBLIC dependencies as well
# https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#creating-a-package-configuration-file
include(CMakeFindDependencyMacro)
# Search in <PackageName>_ROOT:
# https://cmake.org/cmake/help/v3.12/policy/CMP0074.html
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
# locate the installed FindADIOS.cmake module for ADIOS1
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/Modules")
# required dependency: mpark-variant
add_library(openPMD::thirdparty::mpark_variant INTERFACE IMPORTED)
set(openPMD_USE_INTERNAL_VARIANT @openPMD_USE_INTERNAL_VARIANT@)
if(NOT openPMD_USE_INTERNAL_VARIANT)
find_dependency(mpark_variant)
target_link_libraries(openPMD::thirdparty::mpark_variant
INTERFACE mpark_variant)
endif()
# optional dependencies
set(openPMD_HAVE_MPI @openPMD_HAVE_MPI@)
if(openPMD_HAVE_MPI)
find_dependency(MPI)
# deselect parallel installs if explicitly a serial install is requested
set(openPMD_NOMPI_FOUND FALSE)
else()
set(openPMD_NOMPI_FOUND TRUE)
endif()
set(openPMD_MPI_FOUND ${openPMD_HAVE_MPI})
set(openPMD_HAVE_JSON @openPMD_HAVE_JSON@)
set(openPMD_JSON_FOUND ${openPMD_HAVE_JSON})
set(openPMD_HAVE_HDF5 @openPMD_HAVE_HDF5@)
if(openPMD_HAVE_HDF5)
find_dependency(HDF5)
endif()
set(openPMD_HDF5_FOUND ${openPMD_HAVE_HDF5})
set(openPMD_HAVE_ADIOS1 @openPMD_HAVE_ADIOS1@)
if(openPMD_HAVE_ADIOS1)
find_dependency(ADIOS)
endif()
set(openPMD_ADIOS1_FOUND ${openPMD_HAVE_ADIOS1})
set(openPMD_HAVE_ADIOS2 @openPMD_HAVE_ADIOS2@)
if(openPMD_HAVE_ADIOS2)
find_dependency(ADIOS2)
endif()
set(openPMD_ADIOS2_FOUND ${openPMD_HAVE_ADIOS2})
# define central openPMD::openPMD target
include("${CMAKE_CURRENT_LIST_DIR}/openPMDTargets.cmake")
# check if components are fulfilled and set openPMD_<COMPONENT>_FOUND vars
foreach(comp ${openPMD_FIND_COMPONENTS})
if(NOT openPMD_${comp}_FOUND)
if(openPMD_FIND_REQUIRED_${comp})
set(openPMD_FOUND FALSE)
endif()
endif()
endforeach()