-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
46 lines (38 loc) · 1.41 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
cmake_minimum_required(VERSION 3.12)
project(CSparseSolvers VERSION 1.0 LANGUAGES CXX)
find_package(Sofa.Config REQUIRED)
sofa_find_package(Sofa.Component.LinearSolver.Direct REQUIRED)
# List all files
set(CSPARSESOLVERS_SRC_DIR src/${PROJECT_NAME})
set(HEADER_FILES
${CSPARSESOLVERS_SRC_DIR}/config.h.in
${CSPARSESOLVERS_SRC_DIR}/SparseLUSolver.h
${CSPARSESOLVERS_SRC_DIR}/SparseLUSolver.inl
${CSPARSESOLVERS_SRC_DIR}/SparseCholeskySolver.h
${CSPARSESOLVERS_SRC_DIR}/SparseCholeskySolver.inl
)
set(SOURCE_FILES
${CSPARSESOLVERS_SRC_DIR}/init.cpp
${CSPARSESOLVERS_SRC_DIR}/SparseLUSolver.cpp
${CSPARSESOLVERS_SRC_DIR}/SparseCholeskySolver.cpp
)
set(README_FILES
README.md
)
add_subdirectory(extlibs/csparse)
# Create the plugin library.
add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${README_FILES})
target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Component.LinearSolver.Direct)
target_link_libraries(${PROJECT_NAME} PUBLIC csparse)
# Create package Config, Version & Target files.
# Deploy the headers, resources, scenes & examples.
# Set the plugin 'relocatable' if built within SOFA.
# --> see SofaMacros.cmake
sofa_create_package_with_targets(
PACKAGE_NAME ${PROJECT_NAME}
PACKAGE_VERSION ${PROJECT_VERSION}
TARGETS ${PROJECT_NAME} AUTO_SET_TARGET_PROPERTIES
INCLUDE_SOURCE_DIR "src"
INCLUDE_INSTALL_DIR ${PROJECT_NAME}
RELOCATABLE "plugins"
)