CMakeLists.txt 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # CMakeLists.txt for event package. It creates a library with dictionary and a
  2. # main program
  3. cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
  4. project(ModelTree)
  5. set (CMAKE_CXX_STANDARD 11)
  6. # You need to tell CMake where to find the ROOT installation. This can be done
  7. # in a number of ways:
  8. # - ROOT built with classic configure/make use the provided
  9. # $ROOTSYS/etc/cmake/FindROOT.cmake
  10. # - ROOT built with CMake. Add in CMAKE_PREFIX_PATH the installation prefix
  11. # for ROOT
  12. list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})
  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. include(${ROOT_USE_FILE})
  17. set(INCLUDE_DIRECTORIES
  18. ${CMAKE_SOURCE_DIR}
  19. ${CMAKE_SOURCE_DIR}/Centrality
  20. ${CMAKE_SOURCE_DIR}/Flow
  21. ${ROOT_INCLUDE_DIRS})
  22. include_directories(${INCLUDE_DIRECTORIES})
  23. add_definitions(${ROOT_CXX_FLAGS})
  24. set(CMAKE_BUILD_TYPE Debug)
  25. set(CMAKE_C_FLAGS "-O2")
  26. add_subdirectory(Centrality)
  27. add_subdirectory(Flow)
  28. add_executable(calcCent calcCent.cpp)
  29. target_link_libraries(calcCent Centrality)