-
Notifications
You must be signed in to change notification settings - Fork 14
/
CMakeLists.txt
41 lines (33 loc) · 1.58 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
cmake_minimum_required (VERSION 2.6)
project (RootAnalysis)
set( CMAKE_VERBOSE_MAKEFILE on )
# Include Boost as an imported target
#On lxplus one needs a newer boost version thant available by default
#set(BOOST_ROOT /cvmfs/cms.cern.ch/slc7_amd64_gcc630/external/boost/1.63.0)
find_package(Boost REQUIRED COMPONENTS regex)
add_library(boost INTERFACE IMPORTED)
set_property(TARGET boost PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR})
MESSAGE("Boost directory: " ${Boost_LIBRARY_DIRS})
##https://root.cern.ch/how/integrate-root-my-project-cmake
list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})
find_package(ROOT REQUIRED COMPONENTS RIO GenVector Physics RooFitCore RooFit)
include(${ROOT_USE_FILE})
if ("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 6.0.0)
SET( CMAKE_CXX_FLAGS "${ROOT_CXX_FLAGS} -Wall -Werror -O3 -std=c++11 -fopenmp")
MESSAGE("Using -std=c++11 for compiler older than 6.0.0")
elseif("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 7.3.0)
SET( CMAKE_CXX_FLAGS "${ROOT_CXX_FLAGS} -Wall -Werror -O3 -std=c++14 -fopenmp")
MESSAGE("Using -std=c++14 for compiler older than 7.3.0")
else()
SET( CMAKE_CXX_FLAGS "${ROOT_CXX_FLAGS} -Wall -Werror -O3 -std=c++17 -fopenmp")
MESSAGE("Using -std=c++17 for compiler newer or equal 7.3.0")
endif()
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX $ENV{PWD} CACHE PATH "..." FORCE)
endif()
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
MESSAGE("Installation prefix set to " ${CMAKE_INSTALL_PREFIX} )
add_subdirectory(Core/src)
add_subdirectory(HTauTau)