Getting started
Every example of this site is a runnable project, collected under examples in the source repository, and each one is also exposed as a flake template. The quickest way from an empty directory to a working Conan configuration is to instantiate one of them:
mkdir -p hello-conan && cd hello-conangit initnix flake init -t "git+https://codeberg.org/tarcisio/conan-flake"#templates.devenv-module-recipeThat template is the devenv example featuring a
local-recipe-index remote; it carries a complete C++ project — a
conanfile.py recipe, its sources and a test package — alongside the Conan
configuration itself, which is the devenv.nix shown in the
devenv chapter.
The shell can be activated with direnv:
direnv allow .It can take a while before completing. After that, the conan command is
available in the path, with the profile and the other Conan settings already in
place, so the Conan package defined by the recipe can be built and tested with a
call to conan create:
conan create . --build=missingWhose output can be used to validate if the configuration was applied successfully:
hello-world: Hello World Release! hello-world: __x86_64__ defined hello-world: _GLIBCXX_USE_CXX11_ABI 1 hello-world: __cplusplus201703 hello-world: __GNUC__15 hello-world: __GNUC_MINOR__2example/0.0.1 test_packageWorking from a clone
Section titled “Working from a clone”It’s also possible to interact directly with the example projects from a clone of this repository:1
git clone ssh://git@codeberg.org/tarcisio/conan-flake.gitcd conan-flakeThe example above is on the examples/devenv-module-recipe directory:
cd examples/devenv-module-recipedirenv allow .And the same conan create call applies from there.
Where to go next
Section titled “Where to go next”- The option reference lists
every option of the module, and carries the initial setup instructions for
flake-partsscenarios. - The templates chapter lists the remaining templates, one per integration style.
- The flake-parts, devenv and standalone chapters walk through each of those styles.
Footnotes
Section titled “Footnotes”-
Or, via https:
↩Terminal window git clone https://codeberg.org/tarcisio/conan-flake.gitcd conan-flake