CMakeLists.txt 13.2 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
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
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
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
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
Mathieu Faverge committed
229 230
set(QTCOLORPICKERDIR
  ${CMAKE_SOURCE_DIR}/externals/qtcolorpicker/src
231 232
  )

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

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

#############################################
#                VBO
#############################################
246 247 248 249
IF(VITE_ENABLE_VBO)
  SET(VITE_HDRS
    ${VITE_HDRS}
    render/vbo.hpp
250
    render/Shader.hpp
251
    render/Render_alternate.hpp
252 253 254 255 256
    )

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

262 263 264
#############################################
#              OTF Parser
#############################################
265 266 267
IF(VITE_ENABLE_OTF)
  SET(VITE_HDRS
    ${VITE_HDRS}
268 269 270
    parser/OTFParser/ParserDefinitionOTF.hpp
    parser/OTFParser/ParserEventOTF.hpp
    parser/OTFParser/ParserOTF.hpp
271 272 273 274
    )

  SET(VITE_SRCS
    ${VITE_SRCS}
275 276 277
    parser/OTFParser/ParserDefinitionOTF.cpp
    parser/OTFParser/ParserEventOTF.cpp
    parser/OTFParser/ParserOTF.cpp
278 279
    )

280 281 282 283 284 285 286 287 288 289 290 291 292 293
  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()
294

295
  INCLUDE_DIRECTORIES(BEFORE ${OTF_INCLUDE_DIR})
296 297 298

ENDIF(VITE_ENABLE_OTF)

François Trahay's avatar
François Trahay committed
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322
#############################################
#              OTF2 Parser
#############################################
IF(VITE_ENABLE_OTF2)
  ADD_DEFINITIONS(-DWITH_OTF2)

  SET(VITE_HDRS
    ${VITE_HDRS}
    parser/OTF2Parser/ParserDefinitionOTF2.hpp
    parser/OTF2Parser/ParserEventOTF2.hpp
    parser/OTF2Parser/ParserOTF2.hpp
    )

  SET(VITE_SRCS
    ${VITE_SRCS}
    parser/OTF2Parser/ParserDefinitionOTF2.cpp
    parser/OTF2Parser/ParserEventOTF2.cpp
    parser/OTF2Parser/ParserOTF2.cpp
    )

  INCLUDE_DIRECTORIES(${OTF2_INCLUDE_DIR})

ENDIF(VITE_ENABLE_OTF2)

323 324 325
#############################################
#              TAU Parser
#############################################
326 327 328 329
IF(VITE_ENABLE_TAU)

  SET(VITE_HDRS
    ${VITE_HDRS}
330 331
    parser/TauParser/ParserTau.hpp
    parser/TauParser/TauStructs.hpp
332 333 334 335
    )

  SET(VITE_SRCS
    ${VITE_SRCS}
336
    parser/TauParser/ParserTau.cpp
337 338 339 340 341 342
    )

  INCLUDE_DIRECTORIES(${TAU_INCLUDE_DIR})

ENDIF(VITE_ENABLE_TAU)

343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367
#############################################
#        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
    )
368

369
ENDIF()
370

371 372 373 374
#############################################
#                BOOST
#############################################
IF(VITE_ENABLE_SERIALIZATION)
Mathieu Faverge's avatar
Mathieu Faverge committed
375 376 377
  link_directories ( ${Boost_LIBRARY_DIRS} )
  include_directories ( ${Boost_INCLUDE_DIRS} )
  add_definitions("-DUSE_ITC -DBOOST_SERIALIZE")
378

Mathieu Faverge's avatar
Mathieu Faverge committed
379
  SET(VITE_HDRS
380
    ${VITE_HDRS}
381 382 383
    parser/ParserSplitted.hpp
    trace/IntervalOfContainer.hpp
    trace/SerializerWriter.hpp
384 385
    trace/SerializerDispatcher.hpp
    )
386

387 388
  SET(VITE_SRCS
    ${VITE_SRCS}
389 390 391
    parser/ParserSplitted.cpp
    trace/IntervalOfContainer.cpp
    trace/SerializerWriter.cpp
392
    trace/SerializerDispatcher.cpp
393 394
    )

395 396
ENDIF(VITE_ENABLE_SERIALIZATION)

397
IF(USE_QT5)
Mathieu Faverge's avatar
Mathieu Faverge committed
398 399 400
  #############################################
  #              QT5
  #############################################
401 402 403
  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})
404

Mathieu Faverge's avatar
Mathieu Faverge committed
405
ELSE(USE_QT5)
Mathieu Faverge's avatar
Mathieu Faverge committed
406 407 408 409 410 411 412
  #############################################
  #              QT4
  #############################################
  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})

413
ENDIF(USE_QT5)
Mathieu Faverge's avatar
Mathieu Faverge committed
414

415

416
INCLUDE_DIRECTORIES(
417
  ${CMAKE_CURRENT_BINARY_DIR}/common
418 419
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}
420
  ${QTCOLORPICKERDIR}
Mathieu Faverge's avatar
Mathieu Faverge committed
421
  )
422
#ADD_LIBRARY(vite2 SHARED ${VITE_SRCS} ${VITE_MOC} ${VITE_RCC_SRCS})
423

424 425 426 427
IF( VITE_ENABLE_OTF )
  LINK_DIRECTORIES( ${OTF_LIBRARY_DIR} )
ENDIF( VITE_ENABLE_OTF )

François Trahay's avatar
François Trahay committed
428 429 430 431
IF(VITE_ENABLE_OTF2)
  LINK_DIRECTORIES(${OTF2_LIBRARY_DIR} )
ENDIF(VITE_ENABLE_OTF2)

432 433 434 435 436 437 438
#resource
IF(WIN32)
  set(VITE_RES
    "${PROJECT_SOURCE_DIR}/src/interface/icon/logo.ico"
	"${PROJECT_SOURCE_DIR}/src/interface/windows_icon.rc"
  )
ENDIF(WIN32)
439

440
if( APPLE )
441
  INCLUDE_DIRECTORIES(/usr/X11/include)
442 443 444
  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})
445
  SET_TARGET_PROPERTIES(vite PROPERTIES
Mathieu Faverge's avatar
Mathieu Faverge committed
446 447 448 449 450 451 452 453
    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)
454
else( APPLE )
455
  ADD_EXECUTABLE(vite ${VITE_SRCS} ${VITE_MOC} ${VITE_RCC_SRCS} ${VITE_RES})
456 457
endif( APPLE )

458 459 460 461 462 463 464
#############################################
#              QT5
#############################################
IF(USE_QT5)
  qt5_use_modules(vite Widgets Core Xml OpenGL UiTools)
ENDIF(USE_QT5)

465 466
TARGET_LINK_LIBRARIES(vite
  ${QT_LIBRARIES}
467 468
  ${OPENGL_gl_LIBRARY}
  ${OPENGL_glu_LIBRARY}
469 470
  ${Boost_LIBRARIES}
  )
471

472 473
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
  TARGET_LINK_LIBRARIES(vite
Mathieu Faverge's avatar
Mathieu Faverge committed
474 475
    rt
    )
476
   #ADD_DEFINITIONS("-DBOOST_GZIP")
477
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
478

479 480 481 482 483 484
IF(VITE_ENABLE_VBO)
  TARGET_LINK_LIBRARIES(vite
    ${GLEW_LIBRARY}
    )
ENDIF(VITE_ENABLE_VBO)

485 486 487 488
IF(VITE_ENABLE_OTF)
  TARGET_LINK_LIBRARIES(vite
    ${OTF_LIBRARY}
    )
489 490 491 492 493 494
  # if OTF is compiled with zlib support we need to add it
  IF(WIN32)
    TARGET_LINK_LIBRARIES(vite
      ${ZLIB_LIBRARY}
      )
  ENDIF(WIN32)
495 496
ENDIF(VITE_ENABLE_OTF)

François Trahay's avatar
François Trahay committed
497 498 499 500 501 502 503 504 505 506 507 508
IF(VITE_ENABLE_OTF2)
  TARGET_LINK_LIBRARIES(vite
    ${OTF2_LIBRARY}
    )
  # if OTF2 is compiled with zlib support we need to add it
  IF(WIN32)
    TARGET_LINK_LIBRARIES(vite
      ${ZLIB_LIBRARY}
      )
  ENDIF(WIN32)
ENDIF(VITE_ENABLE_OTF2)

509 510 511 512 513 514
IF(VITE_ENABLE_TAU)
  TARGET_LINK_LIBRARIES(vite
    ${TAU_LIBRARY}
    )
ENDIF(VITE_ENABLE_TAU)

515 516 517 518 519
IF(WIN32)
  # Remove the console for windows
  set_target_properties(vite PROPERTIES LINK_FLAGS -Wl,-subsystem,windows)
ENDIF(WIN32)

520
INSTALL_TARGETS(/bin vite)