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
|
cmake_minimum_required( VERSION 3.12.0 FATAL_ERROR )
include( ${INCLUDE_CONFIG}-local-config.cmake OPTIONAL )
find_package( ecbuild 3.7 REQUIRED HINTS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../ecbuild)
#set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}" )
project( MetviewMiniBundle VERSION %METVIEW_VERSION% LANGUAGES C CXX )
set(CPACK_PACKAGE_NAME Metview) # so that the source tarball will have the name 'Metview'
# list all the packages we incorporate into the bundle
set(MV_BUNDLE_PACKAGES METVIEW MARS_CLIENT MIR ATLAS ECKIT)
if(METVIEW_SITE STREQUAL ecmwf )
list(APPEND MV_BUNDLE_PACKAGES FDB)
endif()
# create a variabe for each package we bundle
foreach (bunpack ${MV_BUNDLE_PACKAGES})
set(MV_BUNDLE_CONTAINS_${bunpack} 1)
endforeach()
# -------------------------------------------------------------------------------------
# settings which are required across the packages to get a working Metview installation
#general
set(ENABLE_ODB OFF CACHE BOOL "ODB support")
set(ENABLE_EXPERIMENTAL OFF CACHE BOOL "Experimental features")
set(ENABLE_FORTRAN NOT_SET CACHE BOOL "Fortran features")
#mars
set(ECMWF OFF CACHE BOOL "build the client as for ECMWF")
set(CONFIG_FDB OFF CACHE BOOL "database configuration to access FDB")
set(ENABLE_UDP_STATS OFF CACHE BOOL "")
set(ENABLE_MPI OFF CACHE BOOL "")
set(ENABLE_BUILD_TOOLS OFF CACHE BOOL "")
# if the user did bot supply a value for ENABLE_FORTRAN, then unset it
# (we want to then use the default behaviour, per package)
if(ENABLE_FORTRAN STREQUAL "NOT_SET")
unset(ENABLE_FORTRAN)
unset(ENABLE_FORTRAN CACHE)
endif()
# -------------------------------------------------------------------------------------
macro(my_bundle_pkg)
ecbuild_bundle( ${ARGV} )
endmacro()
include( ecbuild_bundle )
ecbuild_bundle_initialize()
ecbuild_add_option( FEATURE EXPOSE_SUBPACKAGES
DEFAULT OFF
DESCRIPTION "Allow separate use of the sub-packages in the bundle")
# if the installer does not want to expose the sub-packages then we need to:
# a) change $PREFIX so that everything is installed into a sub-directory
# b) change the location of the Metview startup script so it's installed
# where intended (Metview takes care of this)
if (NOT ENABLE_EXPOSE_SUBPACKAGES)
set(ORIGINAL_CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/lib/metview-bundle")
endif()
if(MV_BUNDLE_CONTAINS_FDB)
set( FDB_CONF_FILE /usr/local/apps/fdb/etc/Config )
list(APPEND MV_BUNDLE_PACKAGES FDB)
ecbuild_bundle( PROJECT fdb GIT "ssh://git@git.ecmwf.int/mars/fdb_vintage" TAG %FDB_VINTAGE_GIT_TAG% )
else()
set(FDB_DIR "/dummy/path/for/bundle")
endif()
my_bundle_pkg( PROJECT eckit GIT "ssh://git@git.ecmwf.int/ecsdk/eckit" TAG %ECKIT_GIT_TAG% )
my_bundle_pkg( PROJECT atlas GIT "ssh://git@git.ecmwf.int/atlas/atlas" TAG %ATLAS_GIT_TAG% )
my_bundle_pkg( PROJECT mir GIT "ssh://git@git.ecmwf.int/mir/mir" TAG %MIR_GIT_TAG% )
my_bundle_pkg( PROJECT mars-client GIT "ssh://git@git.ecmwf.int/mars/mars-client" TAG %MARS_CLIENT_PACKAGE_GIT_TAG% )
my_bundle_pkg( PROJECT metview GIT "ssh://git@git.ecmwf.int/metv/metview" TAG %METVIEW_GIT_TAG% )
ecbuild_dont_pack(FILES configure.sh;ecmwf;make-tarball.sh;test-tarball.sh;configure.clang.sh;bamboo)
ecbuild_bundle_finalize()
ecbuild_info("ENABLE_EXPOSE_SUBPACKAGES is ${ENABLE_EXPOSE_SUBPACKAGES}:")
if (ENABLE_EXPOSE_SUBPACKAGES)
ecbuild_info("All packages in the bundle will be installed at the same level into:")
ecbuild_info(" ${CMAKE_INSTALL_PREFIX}")
else()
ecbuild_info("All packages in the bundle will be installed into a sub-directory:")
ecbuild_info(" ${CMAKE_INSTALL_PREFIX}")
ecbuild_info ("The Metview startup script will be installed into:")
ecbuild_info(" ${ORIGINAL_CMAKE_INSTALL_PREFIX}/bin")
endif()
|