CMakeLists.txt 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. CMAKE_MINIMUM_REQUIRED (VERSION 2.8)
  2. PROJECT (TTTT CXX)
  3. # Declare semantic versioning for FILVAL
  4. SET(FILVAL_VERSION_MAJOR 0)
  5. SET(FILVAL_VERSION_MINOR 1)
  6. SET(FILVAL_VERSION_PATCH 0)
  7. SET(CMAKE_BUILD_TYPE "Debug")
  8. CONFIGURE_FILE (
  9. "${PROJECT_SOURCE_DIR}/filval/filval.hpp"
  10. "${PROJECT_BINARY_DIR}/filval/filval.hpp"
  11. )
  12. SET( TTTT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
  13. SET( TTTT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} )
  14. # Setup clang as the project compiler
  15. SET (CMAKE_CXX_COMPILER "/usr/bin/clang++")
  16. SET (CMAKE_CXX_FLAGS "-Wall")
  17. SET (CMAKE_CXX_FLAGS_DEBUG "-g")
  18. SET (CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
  19. SET (CMAKE_CXX_FLAGS_RELEASE "-O4 -DNDEBUG")
  20. SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
  21. SET (CMAKE_AR "/usr/bin/llvm-ar")
  22. SET (CMAKE_LINKER "/usr/bin/llvm-ld")
  23. SET (CMAKE_NM "/usr/bin/llvm-nm")
  24. SET (CMAKE_OBJDUMP "/usr/bin/llvm-objdump")
  25. SET (CMAKE_RANLIB "/usr/bin/llvm-ranlib")
  26. LIST( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake )
  27. FIND_PACKAGE(Jupyter)
  28. IF(NBCONVERT_FOUND)
  29. ADD_CUSTOM_TARGET(notebook-docs
  30. ${CMAKE_CURRENT_SOURCE_DIR}/cmake/convert_nb ${NBCONVERT_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/docs
  31. WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
  32. COMMENT "Converting Jupyter Notebooks to HTML" VERBATIM
  33. )
  34. ADD_CUSTOM_TARGET(notebooks
  35. ${CMAKE_CURRENT_SOURCE_DIR}/cmake/convert_nb ${NBCONVERT_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/docs --update
  36. WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
  37. COMMENT "Re-Running notebooks and converting to HTML" VERBATIM
  38. )
  39. ENDIF(NBCONVERT_FOUND)
  40. # add a target to generate API documentation with Doxygen
  41. FIND_PACKAGE(Doxygen)
  42. IF(DOXYGEN_FOUND)
  43. CONFIGURE_FILE(
  44. ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
  45. ${CMAKE_CURRENT_BINARY_DIR}/docs/Doxyfile @ONLY
  46. )
  47. ADD_CUSTOM_TARGET(docs
  48. ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/docs/Doxyfile
  49. WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/docs
  50. COMMENT "Generating API documentation with Doxygen" VERBATIM
  51. DEPENDS notebook-docs
  52. )
  53. ENDIF(DOXYGEN_FOUND)
  54. FIND_PACKAGE(ROOT REQUIRED)
  55. INCLUDE_DIRECTORIES( SYSTEM ${ROOT_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
  56. # Adds the dictionary library for addiitonal type serialization
  57. SET( CLINGDICTFILE ${CMAKE_CURRENT_BINARY_DIR}/clingdict.cpp )
  58. ROOT_GENERATE_DICTIONARY( "" ${CMAKE_CURRENT_SOURCE_DIR}/filval_root/LinkDef.hpp ${CLINGDICTFILE} "" )
  59. ADD_LIBRARY( filval SHARED ${CLINGDICTFILE} )
  60. ADD_EXECUTABLE(main ${CMAKE_CURRENT_SOURCE_DIR}/analysis/TTTT_Analysis.cpp)
  61. TARGET_LINK_LIBRARIES( main filval ${ROOT_LIBRARIES} )