-
Notifications
You must be signed in to change notification settings - Fork 12
/
CMakeLists.txt
67 lines (45 loc) · 2.2 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
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(clas12hipo4root)
set(CMAKE_INSTALL_BINDIR ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set(CMAKE_INSTALL_LIBDIR ${CMAKE_CURRENT_SOURCE_DIR}/lib)
set(CMAKE_INSTALL_INCLUDEDIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
set(CMAKE_INSTALL_MANDIR ${CMAKE_CURRENT_SOURCE_DIR}/man)
set(CMAKE_CXX_FLAGS "-fPIC -O3")
##########For local ROOT cmake files comment in the line below and remove the lines commented ##USEROOTSYS
#####include("cmake/FindROOT.cmake")
list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS}) ############USEROOTSYS
#---Locate the ROOT package and defines a number of variables (e.g. ROOT_INCLUDE_DIRS)
find_package(ROOT REQUIRED COMPONENTS Proof) ###########USEROOTSYS
#---Define useful ROOT functions and macros (e.g. ROOT_GENERATE_DICTIONARY)
include(${ROOT_USE_FILE}) ##########USEROOTSYS
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ROOT_CXX_FLAGS}")
#find_package(hipo4 REQUIRED) #for cmake
#find_package(PkgConfig REQUIRED) #for pkg
#pkg_check_modules(hipo4 REQUIRED IMPORTED_TARGET hipo4)
#currently load hipo via simple env paths
MESSAGE( CHECK_START "Checking for installed hipo..." )
if (DEFINED ENV{HIPO})
set(HIPOEXT $ENV{HIPO})
set(HIPO_INCLUDE_DIR ${HIPOEXT}/include/)
set(HIPO_LIBS "-L${HIPOEXT}/lib -lhipo4")
MESSAGE( STATUS "HIPO INCLUDE_DIR : " ${HIPO_INCLUDE_DIR} )
MESSAGE( STATUS "HIPO LIBRARIES : " ${HIPO_LIBS} )
else ()
MESSAGE( CHECK_FAIL "$HIPO not set" )
MESSAGE( FATAL_ERROR , "\n ... $HIPO must be set to local install of the hipo library\n ... see clas12root/README.md\n ... cmake exiting")
endif ()
#include clas12-qadb c++ library and rapidjson library
IF (DEFINED ENV{QADB})
include_directories($ENV{QADB}/srcC/include)
include_directories($ENV{QADB}/srcC/rapidjson/include)
add_definitions(-DCLAS_QADB)
ENDIF (DEFINED ENV{QADB})
set(HIPOROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/hipo4)
set(CLAS12ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Clas12Root)
set(CLAS12BANKS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Clas12Banks)
include_directories(${HIPOROOT_DIR})
add_subdirectory (${HIPOROOT_DIR})
include_directories(${CLAS12BANKS_DIR})
add_subdirectory (${CLAS12BANKS_DIR})
include_directories(${CLAS12ROOT_DIR})
add_subdirectory (${CLAS12ROOT_DIR})