| 1 |
# - Config file for the @PROJECT_NAME@ package |
| 2 |
# It defines the following variables. |
| 3 |
# Specific to the pacakge @PROJECT_NAME@ itself: |
| 4 |
# MEDFILE_INCLUDE_DIRS - include directories |
| 5 |
# MEDFILE_LIBRARIES - libraries to link against (C and Fortran) |
| 6 |
# MEDFILE_C_LIBRARIES - C libraries only |
| 7 |
# MEDFILE_EXTRA_LIBRARIES |
| 8 |
# MEDFILE_ROOT_DIR_EXP - the root path of the installation providing this CMake file |
| 9 |
# |
| 10 |
# Other stuff specific to this package: |
| 11 |
# 1. Dependencies of MEDFILE that might be re-used by dependent modules: |
| 12 |
# HDF5_ROOT_DIR_EXP - path to the HDF5 installation used by @PROJECT_NAME@ |
| 13 |
# MPI_ROOT_DIR_EXP - path to the MPI installation used by @PROJECT_NAME@ |
| 14 |
# 2. Some flags |
| 15 |
# MEDFILE_USE_MPI - boolean indicating if med fichier was compiled with MPI support |
| 16 |
|
| 17 |
### Initialisation performed by CONFIGURE_PACKAGE_CONFIG_FILE: |
| 18 |
@PACKAGE_INIT@ |
| 19 |
|
| 20 |
### First the generic stuff for a standard module: |
| 21 |
|
| 22 |
SET(MEDFILE_INCLUDE_DIRS "@PACKAGE_CONF_INCLUDE_DIRS@") |
| 23 |
|
| 24 |
# Load the dependencies for the libraries of @PROJECT_NAME@ |
| 25 |
# (contains definitions for IMPORTED targets). This is only |
| 26 |
# imported if we are not built as a subproject (in this case targets are already there) |
| 27 |
IF(NOT TARGET medC AND NOT @PROJECT_NAME@_BINARY_DIR) |
| 28 |
# Load the Fortran targets if MED-file was compiled with it |
| 29 |
INCLUDE("@PACKAGE_INSTALL_CMAKE_CONFIG_DIR@/@[email protected]") |
| 30 |
ENDIF() |
| 31 |
|
| 32 |
# Options exported by the package: |
| 33 |
SET(MEDFILE_USE_MPI @MEDFILE_USE_MPI@) |
| 34 |
SET(MEDFILE_VERSION @MED_STR_VERSION@) |
| 35 |
SET(MEDFILE_BUILD_SHARED_LIBS @MEDFILE_BUILD_SHARED_LIBS@) |
| 36 |
SET(MEDFILE_BUILD_STATIC_LIBS @MEDFILE_BUILD_STATIC_LIBS@) |
| 37 |
|
| 38 |
# These are IMPORTED targets created by @[email protected] |
| 39 |
IF(MEDFILE_BUILD_SHARED_LIBS) |
| 40 |
SET(MEDFILE_C_LIBRARIES medC) |
| 41 |
SET(MEDFILE_EXTRA_LIBRARIES medimportengine) |
| 42 |
ENDIF() |
| 43 |
IF(MEDFILE_BUILD_STATIC_LIBS) |
| 44 |
SET(MEDFILE_C_LIBRARIES medC_static) |
| 45 |
SET(MEDFILE_EXTRA_LIBRARIES medimportengine_static) |
| 46 |
ENDIF() |
| 47 |
# For now we don't expose Fortran bindings: |
| 48 |
SET(MEDFILE_LIBRARIES ${MEDFILE_C_LIBRARIES}) |
| 49 |
|
| 50 |
# Package root dir: |
| 51 |
SET_AND_CHECK(MEDFILE_ROOT_DIR_EXP "@PACKAGE_CMAKE_INSTALL_PREFIX@") |
| 52 |
|
| 53 |
# If HDF5 was found in CONFIG mode, we need to include its targets so that |
| 54 |
# dependent projects can compile |
| 55 |
SET(_hdf5_path "@HDF5_DIR@") |
| 56 |
IF(_hdf5_path) |
| 57 |
FIND_PACKAGE(HDF5 REQUIRED COMPONENTS C |
| 58 |
NO_MODULE PATHS "@HDF5_DIR@" NO_DEFAULT_PATH) |
| 59 |
ENDIF() |
| 60 |
|
| 61 |
#### Now the specificities |
| 62 |
# Dependencies *directly* used by the package and exported |
| 63 |
# for forward reference: |
| 64 |
# We set them only if they were used: |
| 65 |
SET_AND_CHECK(HDF5_ROOT_DIR_EXP "@PACKAGE_HDF5_ROOT_DIR@") |
| 66 |
IF(MEDFILE_USE_MPI) |
| 67 |
SET_AND_CHECK(MPI_ROOT_DIR_EXP "@PACKAGE_MPI_ROOT_DIR@") |
| 68 |
ENDIF() |
| 69 |
|