di 0.1.0
|
This package can be built either directly through CMake or using nix. As this library is header only building is rather trivial.
This project exports a CMake package to be used with the find_package
command of CMake:
di
di::di
In general, you can either include find_package(di REQUIRED)
somewhere in your CMake build or call add_subdirectory
on the di source code. When using find_package
, it probably makes sense to use fetch content to download the library during the build. When using add_subdirectory
, this project can be included as a git submodule. Because CMake is CMake, there's several other ways to make things work, and this library tries to be as flexible as possible so that both of the above methods will succeed.
Afterwards, use the library via target_link_libraries(target PRIVATE di::di)
.
To manual build the library, use the following commands.
Afterwards, find_package
should succeed by using a system installation of the di
library.
The CMAKE_INSTALL_INCLUDEDIR
is set to a path other than just include
if the project is configured as a top level project to avoid indirectly including other libraries when installed to a common prefix. Please review the install-rules.cmake file for the full set of install rules.
To consume the library in your flake, add di
as an input:
Then include inputs.di.packages.${system}.default
in the buildInputs
or your derivation. Assuming your project is using CMake, find_package(di)
will succeed automatically.
Alternatively, use the nix
command to build the library manually.
This outputs the result to ./result
.