|
|
|
# option: global linear system solver (CHOLMOD, EIGEN)
|
|
|
|
set(LINSYSSOLVER "CHOLMOD" CACHE STRING "Linear system solver to use, options: CHOLMOD (default), EIGEN")
|
|
|
|
|
|
|
|
file(GLOB SRCFILES
|
|
|
|
"*.cpp"
|
|
|
|
"LinSysSolver/*.cpp")
|
|
|
|
|
|
|
|
# Static Simulation Project
|
|
|
|
add_library(StaticSim STATIC ${SRCFILES})
|
|
|
|
|
|
|
|
target_include_directories(StaticSim PUBLIC LinSysSolver)
|
|
|
|
|
|
|
|
target_link_libraries(StaticSim PUBLIC mshio::mshio)
|
|
|
|
|
|
|
|
# eigen
|
|
|
|
target_link_libraries(StaticSim PUBLIC Eigen3::Eigen)
|
|
|
|
|
|
|
|
# igl
|
|
|
|
include(libigl)
|
|
|
|
target_link_libraries(StaticSim PUBLIC
|
|
|
|
igl::core
|
|
|
|
igl::predicates
|
|
|
|
)
|
|
|
|
target_link_libraries(StaticSim PUBLIC spdlog::spdlog)
|
|
|
|
|
|
|
|
# tbb
|
|
|
|
find_package(TBB REQUIRED)
|
|
|
|
target_link_libraries(StaticSim PUBLIC TBB::tbb)
|
|
|
|
target_compile_definitions(StaticSim PUBLIC USE_TBB)
|
|
|
|
|
|
|
|
if(LINSYSSOLVER STREQUAL "CHOLMOD")
|
|
|
|
target_compile_definitions(StaticSim PUBLIC LINSYSSOLVER_USE_CHOLMOD)
|
|
|
|
target_compile_definitions(StaticSim PUBLIC USE_CHOLMOD)
|
|
|
|
else()
|
|
|
|
target_compile_definitions(StaticSim PUBLIC LINSYSSOLVER_USE_EIGEN)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# code only support 3D
|
|
|
|
message(STATUS "Building for three dimensions (3D)")
|
|
|
|
target_compile_definitions(StaticSim PUBLIC DIM_=3)
|
|
|
|
|
|
|
|
if(LINSYSSOLVER STREQUAL "CHOLMOD")
|
|
|
|
# SuiteSparse
|
|
|
|
find_package(SuiteSparse REQUIRED)
|
|
|
|
|
|
|
|
target_link_libraries(StaticSim PUBLIC ${SUITESPARSE_LIBRARIES})
|
|
|
|
target_include_directories(StaticSim PUBLIC ${SUITESPARSE_INCLUDE_DIRS})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
find_package(Boost COMPONENTS filesystem REQUIRED)
|
|
|
|
target_link_libraries(StaticSim PUBLIC ${Boost_LIBRARIES})
|