CMakeLists.txt 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. # CMakeLists.txt for FAS package. It creates a library with dictionary and a main program
  2. cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
  3. project(MpdFlowScripts)
  4. # You need to tell CMake where to find the ROOT installation. This can be done
  5. # in a number of ways:
  6. # - ROOT built with classic configure/make use the provided
  7. # $ROOTSYS/etc/cmake/FindROOT.cmake
  8. # - ROOT built with CMake. Add in CMAKE_PREFIX_PATH the installation prefix
  9. # for ROOT
  10. list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})
  11. #---Locate the ROOT package and defines a number of variables (e.g. ROOT_INCLUDE_DIRS)
  12. find_package(ROOT REQUIRED COMPONENTS MathCore RIO Hist Tree Net)
  13. #---Add option if one wants to compile ROOT-only dependent part or full project
  14. option(ONLY_ROOT "Build targets that require only ROOT package" OFF)
  15. #---Add FairRoot package
  16. if(NOT ONLY_ROOT)
  17. set(FAIRSOFT_PATH $ENV{FAIRROOTPATH}/share/fairbase/cmake/modules)
  18. list(APPEND CMAKE_MODULE_PATH ${FAIRSOFT_PATH})
  19. find_package(FairRoot REQUIRED COMPONENTS Base)
  20. endif()
  21. #---Define useful ROOT functions and macros (e.g. ROOT_GENERATE_DICTIONARY)
  22. include(${ROOT_USE_FILE})
  23. set (CMAKE_CXX_STANDARD 11)
  24. #add_definitions(${ROOT_CXX_FLAGS})
  25. set(CMAKE_BUILD_TYPE Debug)
  26. #set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -Wall -pthread")
  27. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wall")
  28. set(MPDROOTDIR $ENV{VMCWORKDIR})
  29. option(BUILD_GETDCA "Build target get-dca from project" ON)
  30. option(BUILD_GETCENTRALITY "Build target get-centrality from project" ON)
  31. option(BUILD_REDUCEDTREECREATOR "Build target reducedTreeCreator from project" ON)
  32. #option(BUILD_PICODST "Build target PicoDst format from project" ON)
  33. option(BUILD_TESTPUREROOT "Build target test_pure_root from project" ON)
  34. option(BUILD_COUNTER "Build target count-data from project" ON)
  35. if(NOT ONLY_ROOT)
  36. if(BUILD_GETDCA)
  37. add_subdirectory(get-dca)
  38. endif()
  39. if(BUILD_GETCENTRALITY)
  40. add_subdirectory(get-centrality)
  41. endif()
  42. # if(BUILD_PICODST)
  43. # add_subdirectory(PicoDst)
  44. # endif()
  45. if(BUILD_REDUCEDTREECREATOR)
  46. add_subdirectory(reducedTreeCreator)
  47. endif()
  48. if(BUILD_TESTPUREROOT)
  49. add_subdirectory(test_pure_root)
  50. endif()
  51. if(BUILD_COUNTER)
  52. add_subdirectory(count-data)
  53. endif()
  54. else(ONLY_ROOT)
  55. if(BUILD_PICODST)
  56. add_subdirectory(PicoDst)
  57. endif()
  58. if(BUILD_TESTPUREROOT)
  59. add_subdirectory(test_pure_root)
  60. endif()
  61. if(BUILD_COUNTER)
  62. add_subdirectory(count-data)
  63. endif()
  64. endif()