-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
137 lines (109 loc) · 2.51 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
cmake_minimum_required(VERSION 3.5)
project(OPUS)
# set(CXX_FLAGS -O3)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
enable_testing()
set(CMAKE_CXX_STANDARD 14)
# find_package(Ceres REQUIRED)
find_package (Eigen3 REQUIRED)
find_package(Ceres REQUIRED)
add_definitions(-DPROJECT_ROOT_DIR="${PROJECT_SOURCE_DIR}")
set(SOURCES
test/demo.cpp
src/opus.cpp
src/randomlhs.cpp
src/surrogate.cpp
src/LinearSolver.cpp
src/blockbk.cpp
src/test_utils.cpp
)
set(TEST_SURROGATE_SOURCES
test/test_surrogate.cpp
src/opus.cpp
src/randomlhs.cpp
src/surrogate.cpp
src/LinearSolver.cpp
src/blockbk.cpp
src/test_utils.cpp
)
set(TEST_LINEARSOLVER_SOURCES
test/test_LinearSolver.cpp
src/LinearSolver.cpp
src/test_utils.cpp
src/blockbk.cpp
)
set(TEST_EVAL_SURR_SOURCES
test/test_eval_surrogate.cpp
src/LinearSolver.cpp
src/test_utils.cpp
src/blockbk.cpp
)
set(TEST_BLOCK_BK_SOURCES
test/test_blockbk.cpp
src/blockbk.cpp
src/test_utils.cpp
)
set(TEST_MATRIX_UPDATE_SOURCES
test/test_matrix_update.cpp
src/test_utils.cpp
)
include_directories(
${CERES_INCLUDE_DIR}
)
add_executable(demo ${SOURCES})
add_executable(test_surrogate ${TEST_SURROGATE_SOURCES})
add_executable(test_linearsolver ${TEST_LINEARSOLVER_SOURCES})
add_executable(test_eval_surr ${TEST_EVAL_SURR_SOURCES})
add_executable(test_block_bk ${TEST_BLOCK_BK_SOURCES})
add_executable(test_matrix_update ${TEST_MATRIX_UPDATE_SOURCES})
target_include_directories(demo
PRIVATE
${PROJECT_SOURCE_DIR}/include
${CERES_INCLUDE_DIRS}
)
target_include_directories(test_surrogate
PRIVATE
${PROJECT_SOURCE_DIR}/include
${CERES_INCLUDE_DIRS}
)
target_include_directories(test_linearsolver
PRIVATE
${PROJECT_SOURCE_DIR}/include
)
target_include_directories(test_eval_surr
PRIVATE
${PROJECT_SOURCE_DIR}/include
)
target_include_directories(test_block_bk
PRIVATE
${PROJECT_SOURCE_DIR}/include
)
target_include_directories(test_matrix_update
PRIVATE
${PROJECT_SOURCE_DIR}/include
)
target_link_libraries (demo
PRIVATE
Eigen3::Eigen
${CERES_LIBRARIES}
)
target_link_libraries (test_surrogate
PRIVATE
Eigen3::Eigen
${CERES_LIBRARIES}
)
target_link_libraries (test_linearsolver
PRIVATE
Eigen3::Eigen
${CERES_LIBRARIES}
)
target_link_libraries (test_eval_surr
PRIVATE
Eigen3::Eigen
${CERES_LIBRARIES}
)
target_link_libraries (test_block_bk
PRIVATE
Eigen3::Eigen
${CERES_LIBRARIES}
)