# Source files grouped by a directory get_source_files(SOURCES) append_source_files(SOURCES Curve) append_source_files(SOURCES InterpolationAlgorithms) append_source_files(SOURCES Integration) append_source_files(SOURCES LinAlg) if(OGS_USE_CVODE) append_source_files(SOURCES ODE) endif() append_source_files(SOURCES Nonlinear) append_source_files(SOURCES LinAlg/Eigen) if(OGS_USE_LIS) append_source_files(SOURCES LinAlg/Lis) append_source_files(SOURCES LinAlg/EigenLis) endif() if(OGS_USE_PETSC) append_source_files(SOURCES LinAlg/PETSc) endif() # Create the library ogs_add_library(MathLib GENERATE_EXPORT_HEADER ${SOURCES}) set_target_properties(MathLib PROPERTIES LINKER_LANGUAGE CXX) target_link_libraries( MathLib PUBLIC BaseLib $<$:LAPACK::LAPACK> $<$:${LIS_LIBRARIES}> $<$:CVODE::CVODE> $<$:petsc> Eigen3::Eigen $<$:OpenMP::OpenMP_CXX> fmt::fmt-header-only ) if(OGS_USE_LIS) target_include_directories(MathLib PUBLIC ${LIS_INCLUDE_DIR}) endif() if(OGS_USE_MKL) target_include_directories(MathLib PUBLIC ${MKL_INCLUDE_DIR}) target_link_libraries(MathLib PUBLIC ${MKL_LIBRARIES}) target_link_options(MathLib PUBLIC ${MKL_LINK_FLAGS}) target_compile_definitions(MathLib PUBLIC ${MKL_DEFINITIONS}) target_link_directories(MathLib PUBLIC ${MKL_LIBRARY_DIR}) endif() target_compile_definitions( MathLib PUBLIC $<$:USE_LIS> $<$:CVODE_FOUND> $<$:EIGEN_NO_DEBUG> $<$:EIGEN_DONT_VECTORIZE> $<$:OGS_EIGEN_DYNAMIC_SHAPE_MATRICES> $<$:USE_EIGEN_UNSUPPORTED> $<$:EIGEN_INITIALIZE_MATRICES_BY_NAN> $<$:EIGEN_INITIALIZE_MATRICES_BY_NAN> $<$,$>:EIGEN_USE_MKL_ALL> PRIVATE $<$:USE_MKL> ) target_precompile_headers( MathLib PRIVATE [["BaseLib/Error.h"]] [["BaseLib/ConfigTree.h"]] [["BaseLib/Logging.h"]] )