Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libcdi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpim-sw
libcdi
Merge requests
!121
M300433/cmake improvements and define cleanups
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
M300433/cmake improvements and define cleanups
m300433/cmake_improvements_and_define_cleanups
into
develop
Overview
11
Commits
6
Pipelines
9
Changes
6
4 unresolved threads
Hide all comments
Merged
Oliver Heidmann
requested to merge
m300433/cmake_improvements_and_define_cleanups
into
develop
2 months ago
Overview
11
Commits
6
Pipelines
9
Changes
1
4 unresolved threads
Hide all comments
Expand
0
0
Merge request reports
Compare
version 6
version 8
35993632
1 month ago
version 7
8bd1681a
1 month ago
version 6
07f0fb07
1 month ago
version 5
5c79c36d
1 month ago
version 4
f79cd8a1
2 months ago
version 3
5e113671
2 months ago
version 2
8abd8f88
2 months ago
version 1
5c500eb0
2 months ago
develop (base)
and
latest version
latest version
c8067751
6 commits,
1 month ago
version 8
35993632
7 commits,
1 month ago
version 7
8bd1681a
6 commits,
1 month ago
version 6
07f0fb07
5 commits,
1 month ago
version 5
5c79c36d
4 commits,
1 month ago
version 4
f79cd8a1
3 commits,
2 months ago
version 3
5e113671
3 commits,
2 months ago
version 2
8abd8f88
2 commits,
2 months ago
version 1
5c500eb0
2 commits,
2 months ago
Show latest version
1 file
+
35
−
26
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
CMakeLists.txt
+
35
−
26
Options
cmake_minimum_required
(
VERSION 3.
30
FATAL_ERROR
)
cmake_minimum_required
(
VERSION 3.
27
FATAL_ERROR
)
message
(
VERBOSE
"Entering libcdi"
)
project
(
cdilib VERSION 2.5.1 LANGUAGES C
)
@@ -10,11 +10,14 @@ include(CheckIncludeFile)
# Finding libraries
### -------------- Pthread ---------------------------
message
(
"Start check for pthread"
)
include
(
FindThreads
)
find_package
(
Threads REQUIRED
)
set_target_properties
(
Threads::Threads PROPERTIES THREADS_PREFER_PTHREAD_FLAG TRUE
)
list
(
APPEND cdi_compile_defs HAVE_PTHREAD=1
)
option
(
enable_pthread
"Use the pthread library [default=ON]"
ON
)
if
(
${
enable_pthread
}
)
include
(
FindThreads
)
find_package
(
Threads REQUIRED
)
set_target_properties
(
Threads::Threads PROPERTIES THREADS_PREFER_PTHREAD_FLAG TRUE
)
list
(
APPEND cdi_compile_defs HAVE_PTHREAD=1
)
endif
()
# enable default internal libs
option
(
enable_libgrib
"GRIB support [default=ON]"
ON
)
@@ -42,29 +45,35 @@ if(${enable_service})
list
(
APPEND cdi_compile_defs HAVE_LIBSERVICE=1
)
endif
()
# ecCodes
find_package
(
eccodes
)
if
(
${
eccodes_FOUND
}
)
list
(
APPEND cdi_compile_defs HAVE_LIBGRIB_API=
${
eccodes_FOUND
}
)
message
(
VERBOSE
"added compile definition HAVE_LIBGRIB_API=
${
eccodes_FOUND
}
"
)
else
()
message
(
WARNING
"eccodes not found, compiling without eccodes"
)
endif
()
option
(
enable_eccodes
"Use the eccodes library [default=ON]"
ON
)
if
(
${
enable_eccodes
}
OR eccodes_ROOT
)
find_package
(
eccodes
)
if
(
${
eccodes_FOUND
}
)
list
(
APPEND cdi_compile_defs HAVE_LIBGRIB_API=
${
eccodes_FOUND
}
)
message
(
VERBOSE
"added compile definition HAVE_LIBGRIB_API=
${
eccodes_FOUND
}
"
)
else
()
message
(
WARNING
"eccodes not found, compiling without eccodes"
)
endif
()
endif
()
# NetCDF
find_package
(
netCDF COMPONENTS C REQUIRED
)
if
(
TARGET netCDF::netcdf
)
list
(
APPEND cdi_compile_defs
HAVE_LIBNETCDF=
${
netCDF_FOUND
}
HAVE_LIBNC_DAP=
${
netCDF_FOUND
}
HAVE_NETCDF4=
${
netCDF_FOUND
}
HAVE_LIBGRIB_API=
${
netCDF_FOUND
}
HAVE_LIBGRIB=
${
netCDF_FOUND
}
)
message
(
VERBOSE
"added to list of definitions:
${
cdi_compile_defs
}
"
)
else
()
message
(
WARNING
"netcdf not found, compiling without netcdf"
)
endif
()
option
(
enable_netcdf
"Use the netcdf library [default=ON]"
ON
)
if
(
${
enable_netcdf
}
OR netCDF_ROOT
)
find_package
(
netCDF COMPONENTS C REQUIRED
)
if
(
TARGET netCDF::netcdf
)
list
(
APPEND cdi_compile_defs
HAVE_LIBNETCDF=
${
netCDF_FOUND
}
HAVE_LIBNC_DAP=
${
netCDF_FOUND
}
HAVE_NETCDF4=
${
netCDF_FOUND
}
HAVE_LIBGRIB_API=
${
netCDF_FOUND
}
HAVE_LIBGRIB=
${
netCDF_FOUND
}
)
else
()
message
(
WARNING
"netcdf target not found, compiling without netcdf"
)
endif
()
endif
()
message
(
VERBOSE
"looking for config.h in:
${
PROJECT_BINARY_DIR
}
/src"
)
Loading