Skip to content
Snippets Groups Projects

chore: Use find_package in CMake, fallback to FetchContent

Merged Jerome Hue requested to merge jeromeh/aidge_core:cmake-find-package into dev
Files
2
+ 12
7
Include(FetchContent)
find_package(Catch2 3.7.1)
FetchContent_Declare(
if(NOT Catch2_FOUND)
Catch2
message(STATUS "Catch2 not found in system, retrieving from git")
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
Include(FetchContent)
GIT_TAG v3.0.1 # or a later release
)
FetchContent_MakeAvailable(Catch2)
FetchContent_Declare(
 
Catch2
 
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
 
GIT_TAG v3.7.1 # or a later release
 
)
 
 
FetchContent_MakeAvailable(Catch2)
 
endif()
file(GLOB_RECURSE src_files "*.cpp")
file(GLOB_RECURSE src_files "*.cpp")
Loading