CMakeLists.txt 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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(FlowCheck LANGUAGES CXX)
  4. list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})
  5. #---Locate the ROOT package and defines a number of variables (e.g. ROOT_INCLUDE_DIRS)
  6. find_package(ROOT REQUIRED COMPONENTS MathCore RIO Hist Tree Net MathMore EG)
  7. #---Define useful ROOT functions and macros (e.g. ROOT_GENERATE_DICTIONARY)
  8. include(${ROOT_USE_FILE})
  9. #---Add PicoDst submodule with PicoDst shared library
  10. find_library(PicoDst NAMES PicoDst PATHS ${PICO_DST_BIN})
  11. if (NOT PicoDst)
  12. message(FATAL_ERROR "PicoDst is not found!")
  13. endif()
  14. set (CMAKE_CXX_STANDARD 11)
  15. add_definitions(${ROOT_CXX_FLAGS})
  16. set(CMAKE_BUILD_TYPE Debug)
  17. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wall -g")
  18. set(Project_include_dirs
  19. ${CMAKE_SOURCE_DIR}
  20. ${ROOT_INCLUDE_DIRS}
  21. $ENV{PICO_DST_INC}
  22. )
  23. include_directories(${Project_include_dirs})
  24. set(Project_include_libs
  25. ${PicoDst}
  26. ${ROOT_LIBRARIES}
  27. )
  28. #---Compile executables
  29. add_executable(run main.cpp)
  30. target_link_libraries(run ${Project_include_libs})