CMake style

This commit is contained in:
Shahram Najm 2020-03-25 17:57:25 +00:00
parent d330ed4b72
commit 79677592cb
1 changed files with 26 additions and 43 deletions

View File

@ -71,40 +71,32 @@ ecbuild_info("Operating system=${CMAKE_SYSTEM} (${EC_OS_BITS} bits)")
ecbuild_add_option( FEATURE PRODUCT_GRIB
DESCRIPTION "Support for the product GRIB"
DEFAULT ON
)
DEFAULT ON )
ecbuild_add_option( FEATURE PRODUCT_BUFR
DESCRIPTION "Support for the product BUFR"
DEFAULT ON
)
DEFAULT ON )
ecbuild_add_option( FEATURE EXAMPLES
DESCRIPTION "Build the examples"
DEFAULT ON
)
DEFAULT ON )
ecbuild_add_option( FEATURE JPG
DESCRIPTION "Support for JPG decoding/encoding"
DEFAULT ON
)
DEFAULT ON )
# Options related to JPG. The Jasper and OpenJPEG libraries
ecbuild_add_option( FEATURE JPG_LIBJASPER
DESCRIPTION "Support for JPG decoding/encoding with the Jasper library"
CONDITION ENABLE_JPG
DEFAULT ON
)
DEFAULT ON )
ecbuild_add_option( FEATURE JPG_LIBOPENJPEG
DESCRIPTION "Support for JPG decoding/encoding with the OpenJPEG library"
CONDITION ENABLE_JPG
DEFAULT ON
)
DEFAULT ON )
ecbuild_add_option( FEATURE PNG
DESCRIPTION "Support for PNG decoding/encoding"
DEFAULT OFF
REQUIRED_PACKAGES PNG
)
REQUIRED_PACKAGES PNG )
if( HAVE_PNG )
set( HAVE_LIBPNG 1 ) # compatibility with autotools
@ -117,31 +109,27 @@ ecbuild_add_option( FEATURE NETCDF
DESCRIPTION "Support for GRIB to NetCDF conversion"
DEFAULT ON
REQUIRED_PACKAGES NetCDF
NO_TPL
)
NO_TPL )
ecbuild_add_option( FEATURE AEC
DESCRIPTION "Support for Adaptive Entropy Coding"
DEFAULT OFF
REQUIRED_PACKAGES AEC
)
REQUIRED_PACKAGES AEC )
ecbuild_add_option( FEATURE PYTHON
DESCRIPTION "Build the ecCodes Python2 interface (deprecated)"
DEFAULT ON
REQUIRED_PACKAGES "Python VERSION 2.6 NO_LIBS" NumPy
)
REQUIRED_PACKAGES "Python VERSION 2.6 NO_LIBS" NumPy )
# For Python2 we build our own bindings (using SWIG) in the build directory
# but for Python3 one has to add the eccodes from pip3 AFTER the install
if( PYTHON_VERSION_MAJOR EQUAL 3 )
set( HAVE_PYTHON 0 )
endif()
## TODO REQUIRED_LANGUAGES Fortran
ecbuild_add_option( FEATURE FORTRAN
DESCRIPTION "Build the ecCodes Fortran interface"
DEFAULT ON
# REQUIRED_LANGUAGES Fortran # TODO
)
DEFAULT ON )
# TODO Remove this after REQUIRED_LANGUAGES
if( ENABLE_FORTRAN )
@ -158,8 +146,7 @@ ecbuild_add_option( FEATURE MEMFS
DESCRIPTION "Memory based access to definitions/samples"
DEFAULT OFF
CONDITION ECCODES_HAVE_FMEMOPEN OR ECCODES_HAVE_FUNOPEN OR (EC_OS_NAME MATCHES "windows")
REQUIRED_PACKAGES PythonInterp
)
REQUIRED_PACKAGES PythonInterp )
#if( HAVE_MEMFS AND "${CMAKE_C_COMPILER_ID}" STREQUAL "Cray")
# set( HAVE_MEMFS OFF )
@ -177,15 +164,13 @@ endif()
# by default, if memfs is available, then we don't need to install definitions
ecbuild_add_option( FEATURE INSTALL_ECCODES_DEFINITIONS
DESCRIPTION "Install the ecCodes definitions"
DEFAULT ${_will_install_defs_samples}
)
DEFAULT ${_will_install_defs_samples} )
# controls installation of files in samples/ and ifs_samples/ -- note that it still creates the symlinks in the build dir
# by default, if memfs is available, then we don't need to install samples
ecbuild_add_option( FEATURE INSTALL_ECCODES_SAMPLES
DESCRIPTION "Install the ecCodes samples, including IFS samples"
DEFAULT ${_will_install_defs_samples}
)
DEFAULT ${_will_install_defs_samples} )
# advanced options (not visible in cmake-gui )
@ -213,7 +198,6 @@ set( HAVE_LIBJASPER 0 )
set( HAVE_LIBOPENJPEG 0 )
if( ENABLE_JPG )
# Note: The function ecbuild_add_extra_search_paths is deprecated but we need it to find Jasper at ECMWF.
# It modifies CMAKE_PREFIX_PATH
# which can affect future package discovery if not undone by the caller.
@ -433,8 +417,7 @@ ecbuild_dont_pack( DIRS
concepts tests.ecmwf doxygen confluence examples.dev templates parameters java
perl config m4 rpms gaussian_experimental gribex examples/F77
examples/extra examples/deprecated bamboo fortran/fortranCtypes tigge/tools
share/eccodes .settings python3
)
share/eccodes .settings python3 )
#ecbuild_dont_pack( DIRS data/bufr DONT_PACK_REGEX "*.bufr" )
#ecbuild_dont_pack( DIRS data/tigge DONT_PACK_REGEX "*.grib" )