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
|
# (C) Copyright 2020- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernmental organisation
# nor does it submit to any jurisdiction.
# Import for trans package
#
# This file is included during
#
# find_package( ectrans [COMPONENTS (double|single|transi)] [QUIET] [REQUIRED] )
#
# Supported COMPONENTS: double single transi
#
# If available following targets will be exported:
# - trans_dp Double precision trans library
# - trans_sp Single precision trans library
# - transi_dp Double precision transi library (C interface to trans_dp)
#
##################################################################
## Export project variables
set( ectrans_VERSION_STR @ectrans_VERSION_STR@ )
set( ectrans_HAVE_MPI @ectrans_HAVE_MPI@ )
set( ectrans_HAVE_OMP @ectrans_HAVE_OMP@ )
set( ectrans_HAVE_ETRANS @ectrans_HAVE_ETRANS@ )
set( ectrans_HAVE_TRANSI @ectrans_HAVE_TRANSI@ )
set( ectrans_HAVE_SINGLE_PRECISION @ectrans_HAVE_SINGLE_PRECISION@ )
set( ectrans_HAVE_DOUBLE_PRECISION @ectrans_HAVE_DOUBLE_PRECISION@ )
set( ectrans_REQUIRES_PRIVATE_DEPENDENCIES @PACKAGE_REQUIRES_PRIVATE_DEPENDENCIES@ )
if ( ectrans_HAVE_TRANSI AND ectrans_HAVE_ETRANS )
set( ectrans_HAVE_TRANSI_LAM 1)
else()
set( ectrans_HAVE_TRANSI_LAM 0)
endif()
set( ectrans_HAVE_FFTW 1 ) # this is now mandatory
if( NOT ${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY )
message( STATUS "Found ectrans version ${ectrans_VERSION_STR}" )
endif()
##################################################################
## Export project dependencies
include( CMakeFindDependencyMacro )
if( ectrans_REQUIRES_PRIVATE_DEPENDENCIES OR CMAKE_Fortran_COMPILER_LOADED )
if( NOT CMAKE_Fortran_COMPILER_LOADED )
enable_language( Fortran )
endif()
if( trans_HAVE_OMP AND NOT TARGET OpenMP::OpenMP_Fortran )
find_dependency( OpenMP COMPONENTS Fortran )
endif()
find_dependency( fiat HINTS ${CMAKE_CURRENT_LIST_DIR}/../fiat @fiat_DIR@ )
endif()
##################################################################
## Handle components
set( ${CMAKE_FIND_PACKAGE_NAME}_single_FOUND ${ectrans_HAVE_SINGLE_PRECISION} )
set( ${CMAKE_FIND_PACKAGE_NAME}_double_FOUND ${ectrans_HAVE_DOUBLE_PRECISION} )
set( ${CMAKE_FIND_PACKAGE_NAME}_transi_FOUND ${ectrans_HAVE_TRANSI} )
foreach( _component ${${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS} )
if( NOT ${CMAKE_FIND_PACKAGE_NAME}_${_component}_FOUND AND ${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED )
message( SEND_ERROR "ectrans was not build with support for COMPONENT ${_component}" )
endif()
endforeach()
|