|
NEML2 2.1.0
|
NEML2 officially supports GNU Make integration via pkg-config.
After installing NEML2, point PKG_CONFIG_PATH to the directory containing neml2.pc (typically <prefix>/share/pkgconfig), then query compile and link flags from pkg-config.
The following example Makefile compiles a program named foo from main.cxx:
Example usage:
Integrating NEML2 into a project that already uses CMake is fairly straightforward. The following CMakeLists.txt snippet links NEML2 into the target executable called foo:
The above snippet assumes NEML2 is checked out to the directory neml2, i.e., as a git submodule.
Alternatively, you may use CMake's FetchContent module to integrate NEML2 into your project:
NEML2 can also be discovered from its installation location relying on CMake's config mode find_package function
Note that the config mode search defines several imported targets under the neml2:: namespace. For example, neml2::misc corresponds to the misc library of NEML2, etc. The neml2::neml2 is an interface target that transitively links to all NEML2 libraries.