-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCMakeLists.txt
192 lines (170 loc) · 4.33 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
cmake_minimum_required(VERSION 3.16)
project(
Graphoffline
VERSION 1.0
LANGUAGES CXX)
add_executable(GraphOffline)
add_executable(GraphCGI)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
if ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"))
target_compile_options(GraphOffline PUBLIC -Wall -std=c++17 -Werror -Wno-defaulted-function-deleted -Wno-range-loop-construct -Wno-unused-function)
target_compile_options(GraphCGI PUBLIC -Wall -std=c++17 -Werror -Wno-defaulted-function-deleted -Wno-range-loop-construct -Wno-unused-function)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_compile_options(GraphOffline PUBLIC -Wall -std=c++17)
target_compile_options(GraphCGI PUBLIC -Wall -std=c++17)
else()
target_compile_options(GraphOffline PUBLIC -Wall /std:c++17)
target_compile_options(GraphCGI PUBLIC -Wall /std:c++17)
endif()
add_definitions(-DRAPIDJSON_HAS_STDSTRING)
target_compile_definitions(GraphOffline
PUBLIC
UNICODE
_UNICODE
)
target_compile_definitions(GraphCGI
PUBLIC
CGI_MODE
UNICODE
_UNICODE
)
set(COMMON_LIB_SOURCES
CGIProcessor.cpp
CGIProcessor.h
IAlgorithmFactory.h
WeightMultiGraph.h
algorithm/AlgorithmFactory.cpp
algorithm/AlgorithmFactory.h
algorithm/BaseAlgorithm.cpp
algorithm/BaseAlgorithm.h
algorithm/BellmanFord.h
algorithm/BellmanFordImpl.h
algorithm/ConnectedComponent.cpp
algorithm/ConnectedComponent.h
algorithm/DijkstraShortPath.h
algorithm/DijkstraShortPathImpl.h
algorithm/EulerianPath.cpp
algorithm/EulerianPath.h
algorithm/GraphLoadTest.cpp
algorithm/GraphLoadTest.h
algorithm/HamiltonianLoop.cpp
algorithm/HamiltonianLoop.h
algorithm/IAlgorithm.h
algorithm/IsomorphismCheck.cpp
algorithm/IsomorphismCheck.h
algorithm/MaxClique.cpp
algorithm/MaxClique.h
algorithm/MaxFlowPushRelabel.h
algorithm/MaxFlowPushRelableImpl.h
algorithm/PrintAllPaths.cpp
algorithm/PrintAllPaths.h
algorithm/ShortestPath.h
bin/emscripten/DebugTest.html
bin/emscripten/ReleaseTest.html
common/Buffer.h
common/CaseFunctions.cpp
common/CaseFunctions.h
common/ConsoleParams.cpp
common/ConsoleParams.h
common/FileReader.h
common/Logger.cpp
common/Logger.h
common/RefCounter.h
common/Utils.h
common/YString.cpp
common/YString.h
graph/Graph.cpp
graph/Graph.h
graph/IGraph.h
graph/MultiGraph.cpp
graph/MultiGraph.h
graph/WeightGraph.h
lib/CBioInfCpp.h
pugixml/foreach.hpp
pugixml/pugiconfig.hpp
pugixml/pugixml.cpp
pugixml/pugixml.hpp
report/ConsoleReporter.h
report/GraphMLReporter.cpp
report/GraphMLReporter.h
report/IReporter.h
report/ReporterFactory.cpp
report/ReporterFactory.h
)
add_library(Common STATIC
${COMMON_LIB_SOURCES}
)
add_library(CommonCGI STATIC
${COMMON_LIB_SOURCES}
)
target_include_directories(Common PUBLIC
.
lib
algorithm
pugixml
report
common
graph
)
target_include_directories(CommonCGI PUBLIC
.
lib
algorithm
pugixml
report
common
graph
)
target_compile_definitions(Common PRIVATE
UNICODE
_UNICODE
)
target_compile_definitions(CommonCGI PRIVATE
CGI_MODE
UNICODE
_UNICODE
)
target_include_directories(GraphOffline PUBLIC
.
lib
algorithm
pugixml
report
common
graph
)
target_include_directories(GraphCGI PUBLIC
.
lib
algorithm
pugixml
report
common
graph
)
target_sources(GraphOffline
PRIVATE
GraphOffline.cpp
)
target_sources(GraphCGI
PRIVATE
GraphOffline.cpp
)
if ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"))
target_link_libraries(GraphOffline Common)
target_link_libraries(GraphCGI CommonCGI)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_link_libraries(GraphOffline Common -lstdc++fs)
target_link_libraries(GraphCGI CommonCGI -ldl -lpthread -lstdc++fs)
else()
target_link_libraries(GraphOffline Common -lstdc++fs)
target_link_libraries(GraphCGI CommonCGI -ldl -lpthread -lstdc++fs)
endif()
# enable testing functionality
#enable_testing()
# define tests
#add_test(
# NAME Sim
# COMMAND $<TARGET_FILE:Sim> -test
#)