Skip to content

Embed with CMake FetchContent

FetchContent is a CMake command to automatically download the repository:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
include(FetchContent)

FetchContent_Declare(pareto
        GIT_REPOSITORY https://github.com/alandefreitas/pareto
        GIT_TAG origin/master # or whatever tag you want
        )

FetchContent_GetProperties(pareto)
if (NOT pareto_POPULATED)
    FetchContent_Populate(pareto)
    add_subdirectory(${pareto_SOURCE_DIR} ${pareto_BINARY_DIR} EXCLUDE_FROM_ALL)
endif ()

# ...
target_link_libraries(my_target PRIVATE pareto)

Your target will be able to see the pareto headers now.