forked from bgrimstad/splinter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
94 lines (80 loc) · 2.32 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# This file is part of the SPLINTER library.
# Copyright (C) 2012 Bjarne Grimstad ([email protected]).
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
cmake_minimum_required(VERSION 3.21)
project(SPLINTER CXX)
# Read the SPLINTER version from version file
file(STRINGS "version" VERSION)
set(CMAKE_CXX_STANDARD 17)
find_package(Catch2 CONFIG)
#find_package(Eigen3 CONFIG REQUIRED HINTS path-to-eigen)
find_package(Eigen3 CONFIG REQUIRED)
add_library(splinter)
target_sources(splinter PRIVATE
include/bsplinebasis1d.h
include/bsplinebasis.h
include/bsplinebuilder.h
include/bspline.h
include/datapoint.h
include/datatable.h
include/definitions.h
include/function.h
include/knots.h
include/linearsolvers.h
include/mykroneckerproduct.h
include/splinter.h
include/utilities.h
src/bsplinebasis1d.cpp
src/bsplinebasis.cpp
src/bsplinebuilder.cpp
src/bspline.cpp
src/datapoint.cpp
src/datatable.cpp
src/function.cpp
src/knots.cpp
src/mykroneckerproduct.cpp
src/utilities.cpp
)
target_include_directories(splinter PUBLIC include)
target_link_libraries(splinter PUBLIC
Eigen3::Eigen
)
option(SPLINTER_ENABLE_TESTING OFF "Enable testing")
if(SPLINTER_ENABLE_TESTING)
# Testing executable
add_executable(splinter-test)
target_sources(splinter-test PRIVATE
test/approximation/bspline.cpp
test/approximation/pspline.cpp
test/bsplinetestingutilities.cpp
test/bsplinetestingutilities.h
test/general/bspline.cpp
test/general/datatable.cpp
test/main.cpp
test/testfunction.cpp
test/testfunction.h
test/testfunctions.cpp
test/testfunctions.h
test/testingutilities.cpp
test/testingutilities.h
test/unit/bsplinebasis1d.cpp
test/unit/knots.cpp
)
include(Catch)
target_include_directories(splinter-test PRIVATE
test
)
target_link_libraries(splinter-test PRIVATE
splinter
Catch2::Catch2
)
catch_discover_tests(splinter-test)
endif()
# Install the shared library file
install(
TARGETS splinter
DESTINATION ${LIBRARY_INSTALL_DIRECTORY}
)