made project use FetchContent insteaf of relying on submodules

This commit is contained in:
Karl-Wilfried Zimmer 2023-12-31 15:37:43 +01:00
parent 1b145ec9f8
commit f574b0abe1
3 changed files with 11 additions and 6 deletions

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.14)
project(Geometry VERSION 0.1 LANGUAGES CXX)
@ -8,9 +8,16 @@ endif ()
set(CMAKE_CXX_STANDARD 17)
include_directories(${PROJECT_SOURCE_DIR}/include)
include(FetchContent)
add_subdirectory(lib/eigen)
FetchContent_Declare(
eigen
GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
GIT_TAG 3.4.0
)
FetchContent_MakeAvailable(eigen)
include_directories(${PROJECT_SOURCE_DIR}/include)
add_subdirectory(src)

View File

@ -1,5 +1,3 @@
add_executable(Geometry main.cpp)
target_link_libraries(Geometry PUBLIC Eigen3::Eigen)
target_include_directories(Geometry PUBLIC "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/lib/eigen/Eigen")

View File

@ -6,7 +6,7 @@
#define GEOMETRY_MAIN_H
#include <iostream>
#include <Dense>
#include <Eigen/Dense>
using namespace std;