Skip to content

Commit

Permalink
use local libraries instead of fetching and building them
Browse files Browse the repository at this point in the history
  • Loading branch information
Benedikt Moritz Maurer committed Oct 1, 2024
1 parent 5878c38 commit 2f9e066
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 46 deletions.
28 changes: 15 additions & 13 deletions dev/cmake/ConfigCatch2.cmake
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# cmake/ConfigCatch2.cmake

include(FetchContent)
# include(FetchContent)

FetchContent_Declare(
catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.0.1 # Replace with the latest stable release
)
# FetchContent_Declare(
# catch2
# GIT_REPOSITORY https://github.com/catchorg/Catch2.git
# GIT_TAG v3.0.1 # Replace with the latest stable release
# )

FetchContent_MakeAvailable(catch2)
# FetchContent_MakeAvailable(catch2)

# This ensures that Catch2's target is available in the parent scope
set(target_include_directories
${catch2_SOURCE_DIR}/include
CACHE PATH
"Path to Catch2 include directory"
FORCE)
# # This ensures that Catch2's target is available in the parent scope
# set(target_include_directories
# ${catch2_SOURCE_DIR}/include
# CACHE PATH
# "Path to Catch2 include directory"
# FORCE)

find_package(Catch2 REQUIRED)
24 changes: 13 additions & 11 deletions dev/cmake/ConfigEigen.cmake
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
include(FetchContent)
# include(FetchContent)

# Declare the Eigen dependency
FetchContent_Declare(
eigen
GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
GIT_TAG 3.4.0 # Specify the Eigen version you want to use
)
# # Declare the Eigen dependency
# FetchContent_Declare(
# eigen
# GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
# GIT_TAG 3.4.0 # Specify the Eigen version you want to use
# )

# Make the content available
FetchContent_MakeAvailable(eigen)
# # Make the content available
# FetchContent_MakeAvailable(eigen)

# Optionally, include Armadillo headers if needed explicitly
include_directories(${ARMADILLO_INCLUDE_DIRS})
# # Optionally, include Armadillo headers if needed explicitly
# include_directories(${ARMADILLO_INCLUDE_DIRS})

find_package(Eigen3 REQUIRED)
44 changes: 23 additions & 21 deletions dev/cmake/ConfigYamlCpp.cmake
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
include(FetchContent)
# include(FetchContent)

# Fetch yaml-cpp
FetchContent_Declare(
yaml-cpp
GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git
GIT_TAG yaml-cpp-0.7.0 # Specify the version tag here
)
# # Fetch yaml-cpp
# FetchContent_Declare(
# yaml-cpp
# GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git
# GIT_TAG yaml-cpp-0.7.0 # Specify the version tag here
# )

FetchContent_MakeAvailable(yaml-cpp)
# FetchContent_MakeAvailable(yaml-cpp)

set(target_include_directories
${yaml-cpp_SOURCE_DIR}/include
CACHE PATH
"Path to yaml-cpp include directory"
FORCE)
# set(target_include_directories
# ${yaml-cpp_SOURCE_DIR}/include
# CACHE PATH
# "Path to yaml-cpp include directory"
# FORCE)


#set(YAML-CPP_INCLUDE) ${catch2_SOURCE_DIR}/include CACHE PATH "Path to Catch2 include directory" FORCE)
# #set(YAML-CPP_INCLUDE) ${catch2_SOURCE_DIR}/include CACHE PATH "Path to Catch2 include directory" FORCE)

# Example of another dependency
# FetchContent_Declare(
# some_dependency
# GIT_REPOSITORY https://github.com/some_dependency.git
# GIT_TAG v1.0.0
# )
# FetchContent_MakeAvailable(some_dependency)
# # Example of another dependency
# # FetchContent_Declare(
# # some_dependency
# # GIT_REPOSITORY https://github.com/some_dependency.git
# # GIT_TAG v1.0.0
# # )
# # FetchContent_MakeAvailable(some_dependency)

find_package(yaml-cpp REQUIRED)

2 changes: 1 addition & 1 deletion dev/tests/config/src/config_test.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#define CATCH_CONFIG_MAIN

#include <catch2/catch_all.hpp>
#include <catch2/catch.hpp>
#include <cstdint>
#include <config/config.h>

Expand Down

0 comments on commit 2f9e066

Please sign in to comment.