Skip to content
Snippets Groups Projects
Commit de1d8254 authored by Oliver Heidmann's avatar Oliver Heidmann
Browse files

added eccodes to CMakeLists.txt, removed project definitions

parent d55e1ace
No related branches found
No related tags found
1 merge request!114M300433/cmake cleanup 1
cmake_minimum_required( VERSION 3.30 FATAL_ERROR )
message("Entering libcdi")
project(libcdi VERSION 2.5.1 LANGUAGES C )
set(CMAKE_C_STANDARD 11)
add_compile_definitions(CDI=1)
add_compile_definitions(PACKAGE_NAME="libcdi")
add_compile_definitions(VERSION="${CMAKE_PROJECT_VERSION}")
include(CTest)
include(CheckIncludeFile)
find_package(eccodes)
if (${eccodes_FOUND})
add_compile_definitions(HAVE_ECCODES=${eccodes_FOUND})
message(STATUS "added compile definition HAVE_ECCODES=${eccodes_FOUND}")
add_compile_definitions(HAVE_LIBGRIB=${eccodes_FOUND})
message(STATUS "added compile definition HAVE_LIBGRIB=${eccodes_FOUND}")
add_compile_definitions(HAVE_LIBGRIB_API=${eccodes_FOUND})
message(STATUS "added compile definition HAVE_LIBGRIB_API=${eccodes_FOUND}")
else()
message(WARNING "netcdf not found, compiling without netcdf")
endif ()
#NetCDF
find_package(netCDF COMPONENTS C REQUIRED)
check_include_file("netcdf.h" ${netcdf_flag} C)
......@@ -19,6 +28,9 @@ else()
message(WARNING "netcdf not found, compiling without netcdf")
endif ()
message("looking for config.h in: ${PROJECT_BINARY_DIR}/src")
include_directories( "${PROJECT_BINARY_DIR}/src/config.h")
#adding subdirectories
## lib and general files
......@@ -26,3 +38,6 @@ add_subdirectory(src)
## cdi executable
add_subdirectory(app)
#tests
add_subdirectory( tests )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment