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
|
include( CMakeFindDependencyMacro )
set( atlas_HAVE_MPI @atlas_HAVE_MPI@ )
set( atlas_HAVE_OMP @atlas_HAVE_OMP@ )
set( atlas_HAVE_OMP_CXX @atlas_HAVE_OMP_CXX@ )
set( atlas_HAVE_OMP_Fortran @atlas_HAVE_OMP_Fortran@ )
set( atlas_HAVE_TRANS @atlas_HAVE_TRANS@ )
set( atlas_HAVE_FORTRAN @atlas_HAVE_FORTRAN@ )
set( atlas_HAVE_EIGEN @atlas_HAVE_EIGEN@ )
set( atlas_HAVE_GRIDTOOLS_STORAGE @atlas_HAVE_GRIDTOOLS_STORAGE@ )
set( atlas_HAVE_TESSELATION @atlas_HAVE_TESSELATION@ )
set( ATLAS_LIBRARIES @ATLAS_LIBRARIES@ )
set( atlas_VERSION_STR @atlas_VERSION_STR@ )
set( atlas_REQUIRES_PRIVATE_DEPENDENCIES @atlas_REQUIRES_PRIVATE_DEPENDENCIES@ )
## eckit
find_dependency( eckit HINTS ${CMAKE_CURRENT_LIST_DIR}/../eckit @eckit_DIR@ @eckit_BINARY_DIR@ )
## fckit
if( atlas_HAVE_FORTRAN )
find_dependency( fckit HINTS ${CMAKE_CURRENT_LIST_DIR}/../fckit @fckit_DIR@ @fckit_BINARY_DIR@ )
endif()
## Eigen3
set( Eigen3_HINT @Eigen3_DIR@ )
if( atlas_HAVE_EIGEN AND Eigen3_HINT )
find_dependency( Eigen3 HINTS ${Eigen3_HINT} )
endif()
## gridtools_storage
if( atlas_HAVE_GRIDTOOLS_STORAGE )
# Required for GridTools' find_package( MPI COMPONENTS CXX )
if( NOT CMAKE_CXX_COMPILER_LOADED )
enable_language( CXX )
endif()
find_dependency( GridTools HINTS
${GridTools_ROOT}/lib/cmake # non-standard install (reported upstream)
$ENV{GridTools_ROOT}/lib/cmake # non-standard install (reported upstream)
${CMAKE_CURRENT_LIST_DIR}/.. # non-standard install (reported upstream)
${CMAKE_PREFIX_PATH}/lib/cmake # non-standard install (reported upstream)
${CMAKE_INSTALL_PREFIX}/lib/cmake # non-standard install (reported upstream)
${CMAKE_CURRENT_LIST_DIR}/../gridtools
@GridTools_DIR@
@GridTools_BINARY_DIR@ )
endif()
## OpenMP
unset( atlas_OMP_COMPONENTS )
if( atlas_HAVE_OMP_Fortran AND
CMAKE_Fortran_COMPILER_LOADED AND
atlas_REQUIRES_PRIVATE_DEPENDENCIES )
list( APPEND atlas_OMP_COMPONENTS Fortran )
endif()
if( atlas_HAVE_OMP_CXX )
if( NOT CMAKE_CXX_COMPILER_LOADED )
enable_language( CXX )
endif()
list( APPEND atlas_OMP_COMPONENTS CXX )
endif()
if( atlas_OMP_COMPONENTS )
find_dependency( OpenMP COMPONENTS ${atlas_OMP_COMPONENTS} )
endif()
## transi
if( atlas_HAVE_TRANS AND atlas_REQUIRES_PRIVATE_DEPENDENCIES )
set( transi_DIR @transi_DIR@ )
if( transi_DIR )
find_dependency( transi HINTS ${CMAKE_CURRENT_LIST_DIR}/../transi @transi_DIR@ )
else()
find_dependency( trans COMPONENTS transi double HINTS ${CMAKE_CURRENT_LIST_DIR}/../trans @trans_DIR@ )
endif()
endif()
## CGAL
if( atlas_HAVE_TESSELATION AND atlas_REQUIRES_PRIVATE_DEPENDENCIES )
find_dependency( CGAL HINTS @CGAL_DIR@ )
endif()
## Fortran
set( atlas_FORTRAN_FOUND 0 )
if( atlas_HAVE_FORTRAN )
set( atlas_FORTRAN_FOUND 1 )
elseif( atlas_FIND_REQUIRED_FORTRAN )
message( FATAL_ERROR "atlas was not compiled with FORTRAN enabled" )
endif()
set( @PROJECT_NAME@_DIR ${CMAKE_CURRENT_LIST_DIR} CACHE STRING "" )
function( atlas_create_plugin name )
set( options )
set( single_value_args VERSION LIBRARY URL NAMESPACE)
set( multi_value_args )
cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
set( _plugin_file share/plugins/${name}.yml )
if( NOT DEFINED _PAR_VERSION )
set( _version ${${PROJECT_NAME}_VERSION} )
else()
set( _version ${_PAR_VERSION} )
endif()
if( NOT DEFINED _PAR_LIBRARY )
set( _library "${name}" )
else()
set( _library "${_PAR_LIBRARY}" )
endif()
if( NOT DEFINED _PAR_URL )
set( _url "http://www.ecmwf.int" )
else()
set( _url ${_PAR_URL} )
endif()
if( NOT DEFINED _PAR_NAMESPACE )
set( _namespace "int.ecmwf" )
else()
set( _namespace ${_PAR_NAMESPACE} )
endif()
file( WRITE ${CMAKE_BINARY_DIR}/${_plugin_file} "plugin:\n" )
file( APPEND ${CMAKE_BINARY_DIR}/${_plugin_file} " name: ${name}\n" )
file( APPEND ${CMAKE_BINARY_DIR}/${_plugin_file} " namespace: ${_namespace}\n" )
file( APPEND ${CMAKE_BINARY_DIR}/${_plugin_file} " url: ${_url}\n" )
file( APPEND ${CMAKE_BINARY_DIR}/${_plugin_file} " version: ${_version}\n" )
file( APPEND ${CMAKE_BINARY_DIR}/${_plugin_file} " library: ${_library}\n" )
install( FILES ${CMAKE_BINARY_DIR}/${_plugin_file} DESTINATION share/plugins )
endfunction()
|