This project provides a collection of useful CMake modules.
The build type is set by CMAKE_BUILD_TYPE and determines the compiler
settings for the target binary, e.g. Debug
or Release
.
Define the DebugASan
build type for compiling with AddressSanitizer.
If any memory issues are detected when the executable runs, it will exit with
a nonzero error status and a diagnostic report will be displayed. Enable this
in a CMakeLists.txt file using include(DebugASanBuildType)
.
A find module is used with find_package()
to find system libraries and
utilities. These use "modern CMake" and support exported targets and COMPONENTS
where appropriate.
Find the installed NetCDF libraries, with COMPONENTS
for additional
languages (CXX
, F77
, and F90
). The package exports the
NetCDF::netcdf
target.
Find the installed UDUNITS2 library. The package exports the
UDUNITS2::udunits2
target.
Place module files in CMAKE_MODULE_PATH.
Create a development environment and run tests:
$ make dev test