@@ -21,7 +21,10 @@ cmake_minimum_required( VERSION 3.12 FATAL_ERROR )
21
21
find_package ( ecbuild 3.7 REQUIRED HINTS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} /../ecbuild)
22
22
23
23
# Initialise project
24
- project ( eccodes VERSION 2.28.1 LANGUAGES C )
24
+ project ( eccodes VERSION 2.29.0 LANGUAGES CXX )
25
+ set (CMAKE_CXX_STANDARD 11)
26
+ set (CMAKE_CXX_STANDARD_REQUIRED ON )
27
+
25
28
26
29
###############################################################################
27
30
# system checks needed for eccodes_config.h and some options like MEMFS
@@ -65,14 +68,12 @@ ecbuild_info("Operating system=${CMAKE_SYSTEM} (${EC_OS_BITS} bits)")
65
68
###############################################################################
66
69
# some variables/options of this project
67
70
68
- ecbuild_add_option( FEATURE EXPERIMENTAL_BUILD_WITH_CXX
69
- DESCRIPTION "Build ecCodes with a C++ compiler (Experimental)"
70
- DEFAULT OFF )
71
- if ( HAVE_EXPERIMENTAL_BUILD_WITH_CXX )
72
- enable_language ( CXX )
73
- if ( "${CMAKE_CXX_COMPILER_ID} " STREQUAL "Cray" )
74
- set (CMAKE_CXX_FLAGS "-hstd=c++11 ${CMAKE_CXX_FLAGS} " )
75
- endif ()
71
+ if ( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
72
+ ecbuild_add_cxx_flags("-Wno-write-strings -Wno-deprecated" )
73
+ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" )
74
+ ecbuild_add_cxx_flags("-Wno-write-strings -Wno-deprecated" )
75
+ elseif ( CMAKE_CXX_COMPILER_ID STREQUAL "Cray" )
76
+ set (CMAKE_CXX_FLAGS "-hstd=c++11 ${CMAKE_CXX_FLAGS} " )
76
77
endif ()
77
78
78
79
ecbuild_add_option( FEATURE PRODUCT_GRIB
@@ -138,17 +139,7 @@ ecbuild_add_option( FEATURE AEC
138
139
139
140
ecbuild_find_python( VERSION 2.6 NO_LIBS )
140
141
find_package ( NumPy )
141
- ecbuild_add_option( FEATURE PYTHON2
142
- DESCRIPTION "Build the ecCodes Python2 interface (deprecated)"
143
- DEFAULT OFF
144
- #CONDITION Python_FOUND AND NumPy_FOUND
145
- CONDITION PYTHON_FOUND AND NUMPY_FOUND
146
- )
147
- # For Python2 we build our own bindings (using SWIG) in the build directory
148
- # but for Python3 one has to add the eccodes from pip3 AFTER the install
149
- if ( PYTHON_VERSION_MAJOR EQUAL 3 )
150
- set ( HAVE_PYTHON 0 )
151
- endif ()
142
+ set ( HAVE_PYTHON 0 )
152
143
153
144
## TODO REQUIRED_LANGUAGES Fortran
154
145
ecbuild_add_option( FEATURE FORTRAN
@@ -432,15 +423,6 @@ if( HAVE_BUILD_TOOLS )
432
423
endif ()
433
424
add_subdirectory ( fortran )
434
425
435
- if ( PYTHON_VERSION_MAJOR GREATER 2 )
436
- # Python3 is no longer built with SWIG but is a separate
437
- # package. User should do: pip3 install eccodes
438
- #add_subdirectory( python3 )
439
- set ( ECCODES_PYTHON_DIR "python3" )
440
- else ()
441
- add_subdirectory ( python )
442
- set ( ECCODES_PYTHON_DIR "python" )
443
- endif ()
444
426
add_subdirectory ( tests )
445
427
add_subdirectory ( examples )
446
428
add_subdirectory ( data )
@@ -478,7 +460,7 @@ ecbuild_pkgconfig(
478
460
IGNORE_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS} ${NUMPY_INCLUDE_DIRS} ${NETCDF_INCLUDE_DIRS}
479
461
VARIABLES HAVE_MEMFS HAVE_JPEG HAVE_LIBJASPER HAVE_LIBOPENJPEG
480
462
HAVE_ECCODES_THREADS HAVE_ECCODES_OMP_THREADS
481
- HAVE_NETCDF HAVE_PYTHON2 HAVE_FORTRAN HAVE_PNG HAVE_AEC
463
+ HAVE_NETCDF HAVE_FORTRAN HAVE_PNG HAVE_AEC
482
464
)
483
465
if ( HAVE_FORTRAN )
484
466
ecbuild_pkgconfig(
@@ -490,7 +472,7 @@ if( HAVE_FORTRAN )
490
472
${PYTHON_INCLUDE_DIRS} ${NUMPY_INCLUDE_DIRS} ${NETCDF_INCLUDE_DIRS}
491
473
VARIABLES HAVE_MEMFS HAVE_JPEG HAVE_LIBJASPER HAVE_LIBOPENJPEG
492
474
HAVE_ECCODES_THREADS HAVE_ECCODES_OMP_THREADS
493
- HAVE_NETCDF HAVE_PYTHON2 HAVE_PNG HAVE_AEC
475
+ HAVE_NETCDF HAVE_PNG HAVE_AEC
494
476
)
495
477
endif ()
496
478
@@ -513,10 +495,6 @@ ecbuild_info(" | ecCodes version ${eccodes_VERSION} |")
513
495
ecbuild_info(" +--------------------------+" )
514
496
ecbuild_info("" )
515
497
516
- if ( HAVE_PYTHON2 )
517
- ecbuild_deprecate("Python2 support is deprecated and will be discontinued" )
518
- endif ()
519
-
520
498
ecbuild_info(" +--------------------------------------+" )
521
499
ecbuild_info(" | Please note: |" )
522
500
ecbuild_info(" | For Python3 support, first install |" )
@@ -525,9 +503,3 @@ ecbuild_info(" | bindings from PyPI with: |")
525
503
ecbuild_info(" | $ pip3 install eccodes |" )
526
504
ecbuild_info(" +--------------------------------------+" )
527
505
ecbuild_info("" )
528
-
529
- if ( HAVE_EXPERIMENTAL_BUILD_WITH_CXX )
530
- ecbuild_warn("Please note:\n "
531
- "The option of building with C++ is currently experimental."
532
- "Do not use in operations." )
533
- endif ()
0 commit comments