CMakeLists.txt 12.3 KB
Newer Older
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
#
# This file is part of the ViTE project.
#
# This software is governed by the CeCILL-A license under French law
# and abiding by the rules of distribution of free software. You can
# use, modify and/or redistribute the software under the terms of the
# CeCILL-A license as circulated by CEA, CNRS and INRIA at the following
# URL: "http://www.cecill.info".
#
# As a counterpart to the access to the source code and rights to copy,
# modify and redistribute granted by the license, users are provided
# only with a limited warranty and the software's author, the holder of
# the economic rights, and the successive licensors have only limited
# liability.
#
# In this respect, the user's attention is drawn to the risks associated
# with loading, using, modifying and/or developing or reproducing the
# software by the user in light of its specific status of free software,
# that may mean that it is complicated to manipulate, and that also
# therefore means that it is reserved for developers and experienced
# professionals having in-depth computer knowledge. Users are therefore
# encouraged to load and test the software's suitability as regards
# their requirements in conditions enabling the security of their
# systems and/or data to be ensured and, more generally, to use and
# operate it in the same conditions as regards security.
#
# The fact that you are presently reading this means that you have had
# knowledge of the CeCILL-A license and that you accept its terms.
#
# ViTE developers are (for version 0.* to 1.0):
#
#        - COULOMB Kevin
#        - FAVERGE Mathieu
#        - JAZEIX Johnny
#        - LAGRASSE Olivier
#        - MARCOUEILLE Jule
#        - NOISETTE Pascal
#        - REDONDY Arthur
#        - VUCHENER Clment
#        - (RICHART Nicolas)
#
#

SET(VITE_HDRS
  common/Errors.hpp
46
  common/Info.hpp
47
  common/Memory.hpp
48 49 50 51 52
  common/Message.hpp
  common/Palette.hpp
  common/Session.hpp
  common/Tools.hpp
  common/common.hpp
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
  # Data structure headers
  trace/values/Color.hpp
  trace/values/Date.hpp
  trace/values/Double.hpp
  trace/values/Hex.hpp
  trace/values/Integer.hpp
  trace/values/Name.hpp
  trace/values/String.hpp
  trace/values/Value.hpp
  trace/values/Values.hpp
  trace/tree/BinaryTree.hpp
  trace/tree/Node.hpp
  trace/tree/Interval.hpp
  trace/ContainerType.hpp
  trace/EntityType.hpp
  trace/EventType.hpp
  trace/StateType.hpp
  trace/LinkType.hpp
  trace/VariableType.hpp
  trace/EntityTypes.hpp
  trace/EntityValue.hpp
  trace/Container.hpp
  trace/Entity.hpp
  trace/Event.hpp
  trace/State.hpp
  trace/StateChange.hpp
  trace/Link.hpp
  trace/Entitys.hpp
  trace/Variable.hpp
  trace/DrawTrace.hpp
  trace/DrawTree.hpp
  trace/Trace.hpp
Augustin Degomme's avatar
Augustin Degomme committed
85
  trace/IntervalOfContainer.hpp
86
  # Render headers
87
  render/GanttDiagram.hpp
88
  render/Geometry.hpp
89
  render/Hook_event.hpp
90
  render/Minimap.hpp
91
  render/Render_opengl.hpp
Olivier Lagrasse's avatar
Olivier Lagrasse committed
92
  render/Render_svg.hpp
93 94 95
  render/render_stats.hpp
  render/render_stats_opengl.hpp
  render/render_stats_svg.hpp
96
  render/Ruler.hpp
97 98
  # Interface headers
  interface/resource.hpp
99
  interface/Interface.hpp
100
  interface/Settings_window.hpp
101
  interface/Interface_graphic.hpp
Augustin Degomme's avatar
fixes :  
Augustin Degomme committed
102 103
  interface/Node_select.hpp
  interface/viteqtreewidget.hpp
104 105 106
  interface/Interval_select.hpp
  interface/qxtspanslider.h
  interface/qxtspanslider_p.h
107 108
  # Core header
  core/Core.hpp
Augustin Degomme's avatar
fixes :  
Augustin Degomme committed
109
  core/getopt.h
110
  # Parser headers
111
  parser/ParsingThread.hpp
112
  parser/Parser.hpp
113
  parser/ParserFactory.hpp
114
  # Paje
115 116 117 118 119 120
  parser/PajeParser/PajeDefinition.hpp
  parser/PajeParser/PajeFileManager.hpp
  parser/PajeParser/ParserDefinitionPaje.hpp
  parser/PajeParser/ParserEventPaje.hpp
  parser/PajeParser/ParserPaje.hpp
  parser/PajeParser/ParserVite.hpp
121 122 123 124 125 126 127
  # Statistics headers
  statistics/Stats_window.hpp
  statistics/Statistic.hpp
  statistics/DrawStats.hpp
  statistics/DrawVDiagram.hpp
  statistics/DrawHDiagram.hpp
  statistics/DrawCounter.hpp
128 129
  # Plugin header
  plugin/Command_window.hpp
130 131
  plugin/Plugin_window.hpp
  plugin/Plugin.hpp
Mathieu Faverge's avatar
Mathieu Faverge committed
132
  )
133 134 135

SET(VITE_UIS
  interface/info_window.ui
136
  interface/settings.ui
137 138 139
  interface/main_window.ui
  interface/option_export_window.ui
  interface/stats_viewer.ui
140
  interface/global_cmd.ui
Mathieu Faverge's avatar
Mathieu Faverge committed
141
  interface/list_of_counter_to_export.ui
Augustin Degomme's avatar
fixes :  
Augustin Degomme committed
142
  interface/node_select.ui
143
  interface/interval_select.ui
Mathieu Faverge's avatar
Mathieu Faverge committed
144
  )
145 146

SET(VITE_SRCS
147
  # Messages & Errors
148
  common/Errors.cpp
149
  common/Info.cpp
150
  common/Memory.cpp
151 152 153 154
  common/Message.cpp
  common/Palette.cpp
  common/Session.cpp
  common/Tools.cpp
155 156 157 158 159 160 161 162 163
  # Data structure code files
  trace/values/Color.cpp
  trace/values/Date.cpp
  trace/values/Double.cpp
  trace/values/Hex.cpp
  trace/values/Integer.cpp
  trace/values/Name.cpp
  trace/values/String.cpp
  trace/tree/Interval.cpp
Thibault Soucarre's avatar
Thibault Soucarre committed
164
  trace/Container.cpp
165
  trace/ContainerType.cpp
Thibault Soucarre's avatar
Thibault Soucarre committed
166
  trace/Entity.cpp
167
  trace/EntityType.cpp
Thibault Soucarre's avatar
Thibault Soucarre committed
168 169
  trace/EntityValue.cpp
  trace/Event.cpp
170
  trace/EventType.cpp
Thibault Soucarre's avatar
Thibault Soucarre committed
171 172
  trace/IntervalOfContainer.cpp
  trace/Link.cpp
173 174 175
  trace/LinkType.cpp
  trace/State.cpp
  trace/StateChange.cpp
Thibault Soucarre's avatar
Thibault Soucarre committed
176
  trace/StateType.cpp
177
  trace/Trace.cpp
Thibault Soucarre's avatar
Thibault Soucarre committed
178 179
  trace/Variable.cpp
  trace/VariableType.cpp
180
  # Render code files
181
  render/GanttDiagram.hpp
182
  render/Geometry.cpp
183
  render/Hook_event.cpp
184
  render/Minimap.cpp
185
  render/Render_opengl.cpp
Olivier Lagrasse's avatar
Olivier Lagrasse committed
186
  render/Render_svg.cpp
Thibault Soucarre's avatar
Thibault Soucarre committed
187
  render/Ruler.cpp
188 189 190
  render/render_stats_opengl.cpp
  render/render_stats_svg.cpp
  # Parser code files
191 192 193 194
  parser/Parser.cpp
  parser/ParserFactory.cpp
  parser/ParsingThread.cpp
  # Paje Parser
195 196 197 198 199 200
  parser/PajeParser/PajeDefinition.cpp
  parser/PajeParser/PajeFileManager.cpp
  parser/PajeParser/ParserDefinitionPaje.cpp
  parser/PajeParser/ParserEventPaje.cpp
  parser/PajeParser/ParserPaje.cpp
  parser/PajeParser/ParserVite.cpp
201 202 203 204
  # Statistics code files
  statistics/Statistic.cpp
  statistics/Stats_window.cpp
  # Interface code files
205
  interface/Interface_graphic.cpp
206
  interface/Interval_select.cpp
Thibault Soucarre's avatar
Thibault Soucarre committed
207 208
  interface/Node_select.cpp
  interface/Settings_window.cpp
209
  interface/qxtspanslider.cpp
Thibault Soucarre's avatar
Thibault Soucarre committed
210
  interface/viteqtreewidget.cpp
211 212
  # Plugin code file
  plugin/Command_window.cpp
213
  plugin/Plugin.cpp
Thibault Soucarre's avatar
Thibault Soucarre committed
214
  plugin/Plugin_window.cpp
215
  # Core code files
216
  core/Core.cpp
Augustin Degomme's avatar
fixes :  
Augustin Degomme committed
217
  core/getopt.c
218 219 220 221 222 223 224 225
  # Main
  main.cpp
  )

SET(VITE_RCCS
  interface/vite.qrc
  )

226 227 228
#############################################
#           QtColorPicker
#############################################
Mathieu Faverge's avatar
Test  
Mathieu Faverge committed
229 230
set(QTCOLORPICKERDIR
  ${CMAKE_SOURCE_DIR}/externals/qtcolorpicker/src
231 232
  )

Mathieu Faverge's avatar
Test  
Mathieu Faverge committed
233
set(VITE_HDRS
234
  ${VITE_HDRS}
235
  ${QTCOLORPICKERDIR}/qtcolorpicker.h
236 237
  )

Mathieu Faverge's avatar
Test  
Mathieu Faverge committed
238
set(VITE_SRCS
239 240 241 242 243 244 245
  ${VITE_SRCS}
  ${QTCOLORPICKERDIR}/qtcolorpicker.cpp
  )

#############################################
#                VBO
#############################################
246 247 248 249 250 251
IF(VITE_ENABLE_VBO)
  ADD_DEFINITIONS(-DWITH_VBO)

  SET(VITE_HDRS
    ${VITE_HDRS}
    render/vbo.hpp
252
    render/Shader.hpp
253
    render/Render_alternate.hpp
254 255 256 257 258
    )

  SET(VITE_SRCS
    ${VITE_SRCS}
    render/vbo.cpp
259
    render/Shader.cpp
260
    render/Render_alternate.cpp
261
    )
262 263
ENDIF(VITE_ENABLE_VBO)

264 265 266
#############################################
#              OTF Parser
#############################################
267 268 269 270 271
IF(VITE_ENABLE_OTF)
  ADD_DEFINITIONS(-DWITH_OTF)

  SET(VITE_HDRS
    ${VITE_HDRS}
272 273 274
    parser/OTFParser/ParserDefinitionOTF.hpp
    parser/OTFParser/ParserEventOTF.hpp
    parser/OTFParser/ParserOTF.hpp
275 276 277 278
    )

  SET(VITE_SRCS
    ${VITE_SRCS}
279 280 281
    parser/OTFParser/ParserDefinitionOTF.cpp
    parser/OTFParser/ParserEventOTF.cpp
    parser/OTFParser/ParserOTF.cpp
282 283
    )

284 285 286 287 288 289 290 291 292 293 294 295 296 297
  IF(VITE_ENABLE_MT_PARSERS)
    SET(VITE_HDRS
      ${VITE_HDRS}
      parser/OTFParser/mt_ParserEventOTF.hpp
      parser/OTFParser/mt_ParserOTF.hpp
      parser/OTFParser/OTFTraceBuilderThread.hpp
      )
    SET(VITE_SRCS
      ${VITE_SRCS}
      parser/OTFParser/mt_ParserEventOTF.cpp
      parser/OTFParser/mt_ParserOTF.cpp
      parser/OTFParser/OTFTraceBuilderThread.cpp
      )
  ENDIF()
298 299
  
  INCLUDE_DIRECTORIES(BEFORE ${OTF_INCLUDE_DIR})
300 301 302

ENDIF(VITE_ENABLE_OTF)

303 304 305
#############################################
#              TAU Parser
#############################################
306 307 308 309 310
IF(VITE_ENABLE_TAU)
  ADD_DEFINITIONS(-DWITH_TAU)

  SET(VITE_HDRS
    ${VITE_HDRS}
311 312
    parser/TauParser/ParserTau.hpp
    parser/TauParser/TauStructs.hpp
313 314 315 316
    )

  SET(VITE_SRCS
    ${VITE_SRCS}
317
    parser/TauParser/ParserTau.cpp
318 319 320 321 322 323
    )

  INCLUDE_DIRECTORIES(${TAU_INCLUDE_DIR})

ENDIF(VITE_ENABLE_TAU)

324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348
#############################################
#        Multi-threaded Paje Parser
#############################################

IF(VITE_ENABLE_MT_PARSERS)

  SET(VITE_HDRS
    ${VITE_HDRS}
    #Multithread Paje
    parser/PajeParser/mt_ParserEventPaje.hpp
    parser/PajeParser/mt_ParserPaje.hpp
    parser/PajeParser/mt_PajeFileManager.hpp
    parser/PajeParser/BuilderThread.hpp
    trace/TraceBuilderThread.hpp
    )

  SET(VITE_SRCS
    ${VITE_SRCS}
    #Multithread Paje Parser
    parser/PajeParser/mt_ParserEventPaje.cpp
    parser/PajeParser/mt_ParserPaje.cpp
    parser/PajeParser/mt_PajeFileManager.cpp
    parser/PajeParser/BuilderThread.cpp
    trace/TraceBuilderThread.cpp
    )
349

350
ENDIF()
351

352 353 354 355
#############################################
#                BOOST
#############################################
IF(VITE_ENABLE_SERIALIZATION)
Mathieu Faverge's avatar
Mathieu Faverge committed
356 357 358
  link_directories ( ${Boost_LIBRARY_DIRS} )
  include_directories ( ${Boost_INCLUDE_DIRS} )
  add_definitions("-DUSE_ITC -DBOOST_SERIALIZE")
359

Mathieu Faverge's avatar
Mathieu Faverge committed
360
  SET(VITE_HDRS
361
    ${VITE_HDRS}
362 363 364
    parser/ParserSplitted.hpp
    trace/IntervalOfContainer.hpp
    trace/SerializerWriter.hpp
365 366
    trace/SerializerDispatcher.hpp
    )
367

368 369
  SET(VITE_SRCS
    ${VITE_SRCS}
370 371 372
    parser/ParserSplitted.cpp
    trace/IntervalOfContainer.cpp
    trace/SerializerWriter.cpp
373
    trace/SerializerDispatcher.cpp
374 375
    )

376 377
ENDIF(VITE_ENABLE_SERIALIZATION)

378 379 380 381 382 383 384 385
#############################################
#              QT5
#############################################
IF(USE_QT5)
  QT5_WRAP_UI(VITE_UIS_H ${VITE_UIS})
  QT5_WRAP_CPP(VITE_MOC ${VITE_UIS_H} ${VITE_MOC_HDRS})
  QT5_ADD_RESOURCES(VITE_RCC_SRCS ${VITE_RCCS})
  ADD_DEFINITIONS(-DQT_NO_DEBUG)
Mathieu Faverge's avatar
Mathieu Faverge committed
386 387 388
  #############################################
  #              QT4
  #############################################
389
ELSE(USE_QT5)
Mathieu Faverge's avatar
Mathieu Faverge committed
390 391 392 393 394 395 396 397 398 399 400 401 402 403 404
  QT4_AUTOMOC(${VITE_SRCS})
  FOREACH(_hdrs_file ${VITE_HDRS})
    GET_FILENAME_COMPONENT(_abs_file ${_hdrs_file} ABSOLUTE)
    FILE(READ ${_abs_file} _contents)
    STRING(REGEX MATCHALL "Q_OBJECT" _match "${_contents}")
    IF(_match)
      SET(VITE_MOC_HDRS ${VITE_MOC_HDRS} ${_hdrs_file})
    ENDIF(_match)
  ENDFOREACH(_hdrs_file ${VITE_HDRS})

  QT4_WRAP_UI(VITE_UIS_H ${VITE_UIS})
  QT4_WRAP_CPP(VITE_MOC ${VITE_UIS_H} ${VITE_MOC_HDRS})
  QT4_ADD_RESOURCES(VITE_RCC_SRCS ${VITE_RCCS})

  ADD_DEFINITIONS(-DQT_NO_DEBUG)
405

406
ENDIF(USE_QT5)
407 408
#############################################

409 410 411
INCLUDE_DIRECTORIES(
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}
412
  ${QTCOLORPICKERDIR}
Mathieu Faverge's avatar
Mathieu Faverge committed
413
  )
414
#ADD_LIBRARY(vite2 SHARED ${VITE_SRCS} ${VITE_MOC} ${VITE_RCC_SRCS})
415

416 417 418 419 420
IF( VITE_ENABLE_OTF )
  LINK_DIRECTORIES( ${OTF_LIBRARY_DIR} )
ENDIF( VITE_ENABLE_OTF )


421
if( APPLE )
422
  INCLUDE_DIRECTORIES(/usr/X11/include)
423 424 425
  SET( OSX_ICON_FILES "interface/icon/mac_logo.icns")
  set_source_files_properties(${OSX_ICON_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
  ADD_EXECUTABLE(vite MACOSX_BUNDLE ${VITE_SRCS} ${VITE_MOC} ${VITE_RCC_SRCS} ${OSX_ICON_FILES})
426
  SET_TARGET_PROPERTIES(vite PROPERTIES
Mathieu Faverge's avatar
Mathieu Faverge committed
427 428 429 430 431 432 433 434
    MACOSX_BUNDLE_INFO_STRING "ViTE"
    MACOSX_BUNDLE_ICON_FILE "mac_logo.icns"
    MACOSX_BUNDLE_LONG_VERSION_STRING "Visual Trace Explorer - version ${VITE_VERSION_MAJOR}.${VITE_VERSION_MINOR}"
    MACOSX_BUNDLE_BUNDLE_NAME "Vite-MacOSX"
    MACOSX_BUNDLE_SHORT_VERSION_STRING "ViTE-${VITE_VERSION_MAJOR}.${VITE_VERSION_MINOR}"
    MACOSX_BUNDLE_BUNDLE_VERSION "1.0"
    MACOSX_BUNDLE_COPYRIGHT "INRIA 2006-2012"
    MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/vite-info.plist.in)
435 436 437 438
else( APPLE )
  ADD_EXECUTABLE(vite ${VITE_SRCS} ${VITE_MOC} ${VITE_RCC_SRCS})
endif( APPLE )

439 440 441 442 443 444 445
#############################################
#              QT5
#############################################
IF(USE_QT5)
  qt5_use_modules(vite Widgets Core Xml OpenGL UiTools)
ENDIF(USE_QT5)

446 447
TARGET_LINK_LIBRARIES(vite
  ${QT_LIBRARIES}
448
  ${GLU_LIBRARY}
449 450
  ${Boost_LIBRARIES}
  )
451

452 453
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
  TARGET_LINK_LIBRARIES(vite
Mathieu Faverge's avatar
Mathieu Faverge committed
454 455
    rt
    )
456
  ADD_DEFINITIONS("-DBOOST_GZIP")
457
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
458

459 460 461 462 463 464
IF(VITE_ENABLE_VBO)
  TARGET_LINK_LIBRARIES(vite
    ${GLEW_LIBRARY}
    )
ENDIF(VITE_ENABLE_VBO)

465 466 467 468 469 470
IF(VITE_ENABLE_OTF)
  TARGET_LINK_LIBRARIES(vite
    ${OTF_LIBRARY}
    )
ENDIF(VITE_ENABLE_OTF)

471 472 473 474 475 476
IF(VITE_ENABLE_TAU)
  TARGET_LINK_LIBRARIES(vite
    ${TAU_LIBRARY}
    )
ENDIF(VITE_ENABLE_TAU)

477
INSTALL_TARGETS(/bin vite)