-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
73 lines (58 loc) · 3.22 KB
/
CMakeLists.txt
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#This CMakeLists is vaguely based off of Andrew Olivier's from https://github.com/MinervaExpt/NucCCNeutrons/blob/develop/CMakeLists.txt
#It's current intention is solely for the MINERvA GPVMs...
#CMake version set up by default on the MINERvA GPVMs
cmake_minimum_required(VERSION 2.8.12)
project(MINERvANeutronPurity)
#Copying Andrew's Compiler Flags (NOTE: STD of c++1y is worth keeping an eye on if things start behaving unexpectedly... TRYING TO CHANGE TO ++11... THAT DIDN'T WORK EITHER... Hmmm....)
#Also note that this defines the BUILD_TYPE it seems????????
set( GCC_Flags_For_CXX "-std=c++11 -Wall" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_Flags_For_CXX}" )
set( CMAKE_CXX_FLAGS_DEBUG "-ggdb" )
set( CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG" )
#Tell this package where it is installed and version control status
add_definitions(-DINSTALL_DIR="${CMAKE_INSTALL_PREFIX}/")
#Let directories in this package see each other
include_directories( "${PROJECT_SOURCE_DIR}" )
#Find dependencies
list( APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})
find_package(ROOT REQUIRED COMPONENTS RIO Net Tree Core Geom EG GenVector OPTIONAL_COMPONENTS Cintex) #TODO: Remove CintEx if ROOT version > 5.34
if(${ROOT_VERSION} VERSION_LESS 6 AND NOT ${ROOT_Cintex_FOUND})
MESSAGE(FATAL_ERROR "Cintex is optional except when it's not. ROOT 6 has Reflex "
"support built in, so it doesn't have a separate component "
"for Cintex. Cintex was an experimental feature in ROOT 5, "
"so I have to require it as a component there. You appear to "
"be using ${ROOT_VERSION}, so I can't let you get away with "
"skipping out on Cintex support! I need Cintex to load metadata "
"about MnvH1D and MnvH2D at runtime.")
endif()
if(${ROOT_VERSION} VERSION_LESS 6)
MESSAGE("I need Cintex on this platform, so making sure to compile against it...")
else()
MESSAGE("I don't need Cintex on this platform, so skipping it...")
add_definitions(-DNCINTEX)
endif()
include(${ROOT_USE_FILE})
#Need to define the directory env variables $PlotUtils_DIR...
find_package(PlotUtils REQUIRED)
include_directories(${PlotUtils_INCLUDE_DIR})
message("Included PlotUtils from ${PlotUtils_INCLUDE_DIR}")
#find_package(UnfoldUtils REQUIRED)
#include_directories(${UnfoldUtils_INCLUDE_DIR})
#message("Included UnfoldUtils from ${UnfoldUtils_INCLUDE_DIR}")
#Build main executables
add_executable(EventLoop EventLoop.cxx)
add_executable(TestLoop TestLoop.cxx)
add_executable(All1DIntTypeStackedPlots All1DIntTypeStackedPlots.cxx)
add_executable(All1DIntTypeStackedPlots_SignalBKG All1DIntTypeStackedPlots_SignalBKG.cxx)
#Build libraries that EventLoop depends on
add_subdirectory(obj)
#link
target_link_libraries(EventLoop ${ROOT_LIBRARIES} PlotUtils obj)
target_link_libraries(TestLoop ${ROOT_LIBRARIES} PlotUtils obj)
target_link_libraries(All1DIntTypeStackedPlots ${ROOT_LIBRARIES} PlotUtils)
target_link_libraries(All1DIntTypeStackedPlots_SignalBKG ${ROOT_LIBRARIES} PlotUtils)
#install
install(TARGETS EventLoop DESTINATION bin)
install(TARGETS TestLoop DESTINATION bin)
install(TARGETS All1DIntTypeStackedPlots DESTINATION bin)
install(TARGETS All1DIntTypeStackedPlots_SignalBKG DESTINATION bin)