-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
225 lines (202 loc) · 8.56 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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
cmake_minimum_required(VERSION 3.4)
PROJECT (METABOPOLIS)
# using Qt meta-system (precompiler)
# Tell CMake to run moc when necessary:
# As moc files are generated in the binary dir, tell CMake
# to always look for includes there:
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
#set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wno-deprecated -DIL_STD -std=c++11")
# compiler setting
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
else()
set(CMAKE_CXX_STANDARD 11)
endif()
if (UNIX AND NOT APPLE)
message(status "Setting G++ flags")
set(CPLEX_INCLUDE "/opt/ibm/ILOG/CPLEX_Studio128/cplex/include/")
set(CONCERT_INCLUDE "/opt/ibm/ILOG/CPLEX_Studio128/concert/include/")
set(CPLEX_LIB "/opt/ibm/ILOG/CPLEX_Studio128/cplex/lib/x86-64_linux/static_pic/")
set(CONCERT_LIB "/opt/ibm/ILOG/CPLEX_Studio128/concert/lib/x86-64_linux/static_pic/")
set( GRAPHVIZ_PATH_DIR "/home/$ENV{USER}/MyLib/release/graphviz")
set( QT5_PATH_DIR "/home/$ENV{USER}/MyLib/release/qt5-package/5.8/gcc_64")
# add the libraries you need below
set( OPENGL_FLAG -lGL -lGLU -lglut )
find_package(OpenGL REQUIRED)
find_package(GLUT REQUIRED)
find_package(CGAL QUIET COMPONENTS Core REQUIRED)
set( CXX_FLAGS "${CXX_FLAGS}-ltinyxml -lsbml -lcgraph -lgvc -lgmp -lmpfr -lCGAL -lboost_thread -lboost_system -lilocplex -lconcert -lcplex -ldl -lpthread ${OPENGL_FLAG}")
elseif(APPLE)
message(status "Setting CLANG flags")
set(CPLEX_INCLUDE "/Users/$ENV{USER}/Applications/IBM/ILOG/CPLEX_Studio128/cplex/include/")
set(CONCERT_INCLUDE "/Users/$ENV{USER}/Applications/IBM/ILOG/CPLEX_Studio128/concert/include/")
set(CPLEX_LIB "/Users/$ENV{USER}/Applications/IBM/ILOG/CPLEX_Studio128/cplex/lib/x86-64_osx/static_pic/")
set(CONCERT_LIB "/Users/$ENV{USER}/Applications/IBM/ILOG/CPLEX_Studio128/concert/lib/x86-64_osx/static_pic/")
# add the libraries you need below
# set( OPENGL_FLAG "-framework OpenGL" )
# find_package(GLUT REQUIRED)
# find_package(OpenGL REQUIRED)
# set(CXX_FLAGS "${CXX_FLAGS}-ltinyxml -lsbml -lcgraph -lgvc -lCGAL -lgmp -lmpfr -lilocplex -lconcert -lcplex ${OPENGL_FLAG}")
set(CXX_FLAGS "${CXX_FLAGS}-ltinyxml -lsbml -lcgraph -lgvc -lCGAL -lgmp -lmpfr -lilocplex -lconcert -lcplex")
endif()
include_directories(
/opt/local/include
${CMAKE_SOURCE_DIR}/include
${CPLEX_INCLUDE}
${CONCERT_INCLUDE}
${GRAPHVIZ_PATH_DIR}/include
${QT5_PATH_DIR}/include
)
link_directories(
/opt/local/lib
${CMAKE_SOURCE_DIR}/src
${CPLEX_LIB}
${CONCERT_LIB}
${GRAPHVIZ_PATH_DIR}/lib
${QT5_PATH_DIR}/lib
)
# automatically grab all the source files
set(UI_FILES include/DiaLayout.ui)
#set(RESOURCES *.qrc)
set(HEADERS
include/boost/create_dual_graph.hpp
include/graph/BaseEdgeProperty.h
include/graph/BaseGraph.h
include/graph/BaseGraphProperty.h
include/graph/BaseVertexProperty.h
include/graph/FlowEdgeProperty.h
include/graph/FlowGraph.h
include/graph/FlowVertexProperty.h
include/graph/MetaboliteEdgeProperty.h
include/graph/MetaboliteGraph.h
include/graph/MetaboliteVertexProperty.h
include/graph/PropertyGraph.h
include/graph/RelationEdgeProperty.h
include/graph/RelationGraph.h
include/graph/RelationVertexProperty.h
include/graph/RoadEdgeProperty.h
include/graph/RoadGraph.h
include/graph/RoadVertexProperty.h
include/hola/Hola.h
include/hola/TreeMap.h
include/optimization/Deformation.h
include/optimization/Floorplan.h
include/optimization/Flow.h
include/optimization/Layout.h
include/optimization/MIP.h
include/optimization/QMIP.h
include/render/GraphicsArrowItem.h
include/render/GraphicsBallItem.h
include/render/GraphicsBase.h
include/render/GraphicsBaseItem.h
include/render/GraphicsCurveItem.h
include/render/GraphicsDomainItem.h
include/render/GraphicsEdgeItem.h
include/render/GraphicsFlowItem.h
include/render/GraphicsMetaboliteItem.h
include/render/GraphicsNameItem.h
include/render/GraphicsReactionItem.h
include/render/GraphicsRouterItem.h
include/render/GraphicsTreemapItem.h
include/render/GraphicsTreemapNameItem.h
include/render/GraphicsVertexItem.h
include/render/GraphicsView.h
include/render/Widget.h
include/render/Window.h
include/xml/bionetsbgnml.h
include/xml/bionetsbml.h
include/Common.h
include/CommonClass.h
include/ConfigSpace.h
include/Coord2.h
include/DiaLayout.h
include/GraphVizAPI.h
include/Line2.h
include/Pathway.h
include/PathwayData.h
include/Rectangle2.h
include/Color.h
)
set(SOURCES
src/graph/BaseEdgeProperty.cpp
src/graph/BaseGraph.cpp
src/graph/BaseGraphProperty.cpp
src/graph/BaseVertexProperty.cpp
src/graph/FlowEdgeProperty.cpp
src/graph/FlowGraph.cpp
src/graph/FlowVertexProperty.cpp
src/graph/MetaboliteEdgeProperty.cpp
src/graph/MetaboliteGraph.cpp
src/graph/MetaboliteVertexProperty.cpp
src/graph/RelationEdgeProperty.cpp
src/graph/RelationGraph.cpp
src/graph/RelationVertexProperty.cpp
src/graph/RoadEdgeProperty.cpp
src/graph/RoadGraph.cpp
src/graph/RoadVertexProperty.cpp
src/hola/Hola.cpp
src/hola/TreeMap.cpp
src/optimization/Deformation.cpp
src/optimization/Floorplan.cpp
src/optimization/Flow.cpp
src/optimization/Layout.cpp
src/optimization/MIP.cpp
src/optimization/QMIP.cpp
src/render/GraphicsArrowItem.cpp
src/render/GraphicsBallItem.cpp
src/render/GraphicsBaseItem.cpp
src/render/GraphicsCurveItem.cpp
src/render/GraphicsDomainItem.cpp
src/render/GraphicsEdgeItem.cpp
src/render/GraphicsFlowItem.cpp
src/render/GraphicsMetaboliteItem.cpp
src/render/GraphicsNameItem.cpp
src/render/GraphicsReactionItem.cpp
src/render/GraphicsRouterItem.cpp
src/render/GraphicsTreemapItem.cpp
src/render/GraphicsTreemapNameItem.cpp
src/render/GraphicsVertexItem.cpp
src/render/GraphicsView.cpp
src/render/Window.cpp
src/render/Widget.cpp
src/xml/bionetsbgnml.cpp
src/xml/bionetsbml.cpp
src/Common.cpp
src/ConfigSpace.cpp
src/Coord2.cpp
src/DiaLayout.cpp
src/GraphVizAPI.cpp
src/Line2.cpp
src/Pathway.cpp
src/PathwayData.cpp
src/Rectangle2.cpp
src/Color.cpp
src/main.cpp
)
set( DEFINEQT5 ON )
#set(Qt_REQUIRED_COMPONENTS Core Gui Svg Widgets)
#find_package(Qt5 COMPONENTS ${Qt_REQUIRED_COMPONENTS} REQUIRED)
find_package(Qt5 COMPONENTS Core Gui Svg Widgets REQUIRED)
# using Qt meta-system (precompiler)
QT5_ADD_RESOURCES( RES_SOURCES ${RESOURCES} )
QT5_WRAP_UI( UI_HEADERS ${UI_FILES} )
QT5_WRAP_CPP( MOC_SRCS ${UI_HEADERS})
QT5_WRAP_CPP( MOC_SRCS ${MOC_HEADERS} )
QT5_WRAP_CPP( MOC_DIALAYOUT ${CMAKE_CURRENT_SOURCE_DIR}/include/DiaLayout.h )
QT5_WRAP_CPP( MOC_WINDOW ${CMAKE_CURRENT_SOURCE_DIR}/include/render/Window.h )
QT5_WRAP_CPP( MOC_WIDGET ${CMAKE_CURRENT_SOURCE_DIR}/include/render/Widget.h )
QT5_WRAP_CPP( MOC_GRAPHICSVIEW ${CMAKE_CURRENT_SOURCE_DIR}/include/render/GraphicsView.h )
set_property( SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/cmake-build-debug/moc_ui_DiaLayout.cpp PROPERTY SKIP_AUTOGEN ON )
set_property( SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/cmake-build-debug/include/moc_DiaLayout.cpp PROPERTY SKIP_AUTOGEN ON )
set_property( SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/cmake-build-debug/include/render/moc_Window.cpp PROPERTY SKIP_AUTOGEN ON )
set_property( SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/cmake-build-debug/include/render/moc_Widget.cpp PROPERTY SKIP_AUTOGEN ON )
set_property( SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/cmake-build-debug/include/render/moc_GraphicsView.cpp PROPERTY SKIP_AUTOGEN ON )
set_property( SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/cmake-build-debug/include/render/moc_GraphicsVertexItem.cpp PROPERTY SKIP_AUTOGEN ON )
add_executable (metabopolis ${SOURCES} ${MOC_SRCS} ${MOC_DIALAYOUT} ${MOC_WINDOW} ${MOC_WIDGET} ${MOC_GRAPHICSVIEW})
target_link_libraries (metabopolis ${CXX_FLAGS})
# qt stuff
qt5_use_modules(metabopolis Core Gui Svg Widgets)