Quickstart

After picking your LIBRA flavor as described here, proceed onward to the appropriate section below. Make sure you’ve checked the requirements first!

  1. Setup your repo:

    Create CMakeLists.txt in the root of your repo. Within that file, create something like this:

    cmake_minimum_required(VERSION 3.21 FATAL_ERROR) # whatever version you like
    project(my_project CXX) # languages can be anything cmake supports
    
    include(libra/project)
    
    # Whatever other cmake config you like starts here
    
  2. Create cmake/project-local.cmake in the root of your project repo. This is where you define what targets you want to build, how to build them, etc. See project-local.cmake: How To Hook Into LIBRA for more details.

  3. Make LIBRA accessible to CMake:

    In conanfile.py put the following:

    def build_requirements(self):
        self.tool_requires("cmake/3.30")
        self.tool_requires("libra/0.8.0") # arbitrary LIBRA version
    
  4. Build your project:

    Via conan:

    conan build .
    

    from the root of the repo. Or:

    cmake --build . -t <target> --preset conan-{debug,release}
    

    from the root of the repo. Or:

    make <target>
    

    from the build/{Debug,Release,...} directory.