CMakeLists.txt 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # CMakeLists.txt for StFemtoEvent package. It creates a library with dictionary
  2. cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
  3. project(StFemtoDst)
  4. # You need to tell CMake where to find the ROOT installation. This can be done in a number of ways:
  5. # - ROOT built with classic configure/make use the provided $ROOTSYS/etc/cmake/FindROOT.cmake
  6. # - ROOT built with CMake. Add in CMAKE_PREFIX_PATH the installation prefix for ROOT
  7. if(ROOT_CMAKE)
  8. list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})
  9. else(ROOT_CMAKE)
  10. set(ROOT_PREINSTALLED "/usr/lib64/Geant4-10.3.0/Modules")
  11. list(APPEND CMAKE_MODULE_PATH ${ROOT_PREINSTALLED})
  12. endif(ROOT_CMAKE)
  13. #---Locate the ROOT package and defines a number of variables (e.g. ROOT_INCLUDE_DIRS)
  14. find_package(ROOT REQUIRED COMPONENTS MathCore RIO Hist Tree Net)
  15. #---Define useful ROOT functions and macros (e.g. ROOT_GENERATE_DICTIONARY)
  16. if(ROOT_CMAKE)
  17. include(${ROOT_USE_FILE})
  18. endif(ROOT_CMAKE)
  19. #---Define _VANILLA_ROOT_ variable needed for the project
  20. add_definitions(-D_VANILLA_ROOT_)
  21. set(INCLUDE_DIRECTORIES
  22. ${CMAKE_SOURCE_DIR}
  23. ${ROOT_INCLUDE_DIRS}
  24. )
  25. include_directories(${INCLUDE_DIRECTORIES})
  26. add_definitions(${ROOT_CXX_FLAGS})
  27. set(CMAKE_BUILD_TYPE Debug)
  28. set(CMAKE_C_FLAGS "-O2")
  29. set(HEADER_FILES
  30. #PhysicalConstants.h
  31. StFemtoArrays.h
  32. StFemtoDst.h
  33. StFemtoDstReader.h
  34. StFemtoEvent.h
  35. StFemtoHelix.h
  36. #StFemtoMessMgr.h
  37. StFemtoPhysicalHelix.h
  38. StFemtoTrack.h
  39. StFemtoV0.h
  40. StFemtoXi.h
  41. #SystemOfUnits.h
  42. )
  43. set(CXX_FILES
  44. StFemtoArrays.cxx
  45. StFemtoDst.cxx
  46. StFemtoDstReader.cxx
  47. StFemtoEvent.cxx
  48. StFemtoHelix.cxx
  49. StFemtoPhysicalHelix.cxx
  50. StFemtoTrack.cxx
  51. StFemtoV0.cxx
  52. StFemtoXi.cxx
  53. )
  54. #---Generate dictionary for the project
  55. ROOT_GENERATE_DICTIONARY(G__StFemtoDst
  56. ${HEADER_FILES}
  57. LINKDEF StFemtoDstLinkDef.h)
  58. #---Create a shared library with generated dictionary
  59. add_library(StFemtoDst SHARED
  60. ${CXX_FILES}
  61. G__StFemtoDst.cxx)
  62. target_link_libraries(StFemtoDst ${ROOT_LIBRARIES})