CMakeLists.txt 2.12 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#Basic Cmake structure created by R.Longo on 12/13/2018
project(JCaPA)
cmake_minimum_required(VERSION 2.8)
#aux_source_directory(. SRC_LIST)

#Colors definition for messages
if(NOT WIN32)
  string(ASCII 27 Esc)
  set(ColourReset "${Esc}[m")
  set(ColourBold  "${Esc}[1m")
  set(Red         "${Esc}[31m")
  set(Green       "${Esc}[32m")
  set(Yellow      "${Esc}[33m")
  set(Blue        "${Esc}[34m")
  set(White       "${Esc}[37m")
  set(BoldRed     "${Esc}[1;31m")
  set(BoldGreen   "${Esc}[1;32m")
  set(BoldYellow  "${Esc}[1;33m")
  set(BoldBlue    "${Esc}[1;34m")
  set(BoldWhite   "${Esc}[1;37m")
endif()

message("${BoldBlue}
      #  #####           ######     #
      # #     #          #     #   # #
      # #                #     #  #   #
      # #        ####    ######  #     #
#     # #       #    #   #       #######
#     # #     # #    #   #       #     #
 #####   #####   ######  #       #     #
${ColourReset}")

set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR})

#To be commented out on old linux...
add_compile_options(-std=c++11)
#add_compile_options(-arch x86_64)

39
40
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmakeModules/)

41
#Root support
42
43
44
find_package (ROOT REQUIRED)
include_directories (${ROOT_INCLUDE_DIR})

45
46
47
48
49
50
#Xerces-C support
find_package (Xerces REQUIRED)
include_directories (${XERCESC_INCLUDE})



51
52
53
#Test executable - does nothing
add_executable(test_JCaPA  main.cpp)
TARGET_LINK_LIBRARIES(test_JCaPA ${ROOT_LIBRARIES})
54
55
56
TARGET_LINK_LIBRARIES(test_JCaPA ${XERCESC_LIBRARY})


57
58
59
60
61

#Subdirectory structure
#Analysis libraries and user functions 
add_subdirectory(Analysis)

62
63
64
65
66
67
68
69
70
#MonteCarlo folder. The installation will be conditional and disabled by default (not everyone needs to work with it and requires dependencies)
#The starting point will be the work done by Mike Phipps

if (${JCaPA_ENABLE_MC} MATCHES "YES")
    message("${BoldGreen} Monte Carlo extension enabled! ${ColourReset}")
    add_subdirectory(MonteCarlo)

endif (${JCaPA_ENABLE_MC} MATCHES "YES")

71
72
73
74
75
#Install test
install(TARGETS test_JCaPA RUNTIME DESTINATION bin)
#Install doxygen files
install(FILES doxygen/JCaPA_doxy.cnf DESTINATION doxygen)