This commit is contained in:
2026-03-23 18:06:41 +03:00
parent 48d1bf37f7
commit 9959f45b46
2 changed files with 138 additions and 84 deletions

View File

@@ -27,6 +27,12 @@ option(
ON
)
option(
USE_EIGEN3
"Use of Eigen3 library as dependency for implemetation of PCM construction"
ON
)
option(USE_BSPLINE_PCM "Use of FITPACK bivariate splines for PCM" ON)
option(
@@ -42,6 +48,27 @@ find_package(Threads REQUIRED)
include(FetchContent)
include(ExternalProject)
# ******** Eigen3 LIBRARY *******
if(USE_EIGEN3)
find_package(Eigen3 CONFIG)
if(TARGET Eigen3::Eigen)
message(STATUS "Eigen3 library was found!")
else()
message(STATUS \tfetch Eigen3 ...)
FetchContent_Declare(
eigen
GIT_REPOSITORY "https://gitlab.com/libeigen/eigen.git"
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
OVERRIDE_FIND_PACKAGE
)
FetchContent_MakeAvailable(eigen)
find_package(Eigen3 REQUIRED CONFIG)
endif()
endif()
# ******* SPDLOG LIBRARY *******
if(USE_SPDLOG)
@@ -250,6 +277,10 @@ if(USE_BSPLINE_PCM)
add_subdirectory(fitpack)
endif()
if(USE_EIGEN3)
list(APPEND MCC_SRC include/mcc/mcc_pcm_construct.h)
endif()
add_library(${PROJECT_NAME} INTERFACE ${MCC_SRC})
target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_23)
target_include_directories(
@@ -272,6 +303,10 @@ if(USE_BSPLINE_PCM)
)
endif()
if(USE_EIGEN3)
target_link_libraries(${PROJECT_NAME} INTERFACE Eigen3::Eigen)
endif()
if(USE_ASIO)
target_link_libraries(${PROJECT_NAME} INTERFACE PkgConfig::ASIOLIB)
endif()