-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
165 lines (127 loc) · 5.71 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
project(OrcaRoot)
set(ORCAROOT_MAJOR_VERSION 0)
set(ORCAROOT_MINOR_VERSION 1)
set(ORCAROOT_PATCH_VERSION 0)
set(ORCAROOT_VERSION ${ORCAROOT_MAJOR_VERSION}.${ORCAROOT_MINOR_VERSION}.${ORCAROOT_PATCH_VERSION})
include(cmake/FindROOT.cmake)
include_directories(${ROOT_INCLUDE_DIR})
link_directories(${ROOT_LIBRARY_DIR})
find_library(ROOT_XML_LIBRARY XMLParser ${ROOT_LIBRARY_DIR})
find_package (Threads)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
get_filename_component(BUILD_PARENT_DIR ${CMAKE_BINARY_DIR} PATH)
set(CMAKE_INSTALL_PREFIX "${BUILD_PARENT_DIR}/install" CACHE PATH "Install path prefix, prepended onto install directories." FORCE)
endif()
include_directories(
${PROJECT_SOURCE_DIR}/Decoders
${PROJECT_SOURCE_DIR}/IO
${PROJECT_SOURCE_DIR}/Management
${PROJECT_SOURCE_DIR}/Processors
${PROJECT_SOURCE_DIR}/Util
)
file(GLOB UTIL_SRC ${PROJECT_SOURCE_DIR}/Util/*.cc)
file(GLOB UTIL_HEADERS ${PROJECT_SOURCE_DIR}/Util/*.hh)
add_library(ORUtil SHARED ${UTIL_SRC} ${UTIL_HEADERS})
target_link_libraries(ORUtil ${ROOT_LIBRARIES} ${ROOT_XML_LIBRARY})
install(TARGETS ORUtil LIBRARY DESTINATION lib)
file(GLOB DECODERS_SRC ${PROJECT_SOURCE_DIR}/Decoders/*.cc)
file(GLOB DECODERS_HEADERS ${PROJECT_SOURCE_DIR}/Decoders/*.hh)
add_library(ORDecoders SHARED ${DECODERS_SRC} ${DECODERS_HEADERS})
target_link_libraries(ORDecoders ${ROOT_LIBRARIES} ${ROOT_XML_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ORUtil)
install(TARGETS ORDecoders LIBRARY DESTINATION lib)
file(GLOB IO_SRC ${PROJECT_SOURCE_DIR}/IO/*.cc)
file(GLOB IO_HEADERS ${PROJECT_SOURCE_DIR}/IO/*.hh)
add_library(ORIO SHARED ${IO_SRC} ${IO_HEADERS})
target_link_libraries(ORIO ${ROOT_LIBRARIES} ${ROOT_XML_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ORUtil ORDecoders )
install(TARGETS ORIO LIBRARY DESTINATION lib)
file(GLOB PROCESSORS_SRC ${PROJECT_SOURCE_DIR}/Processors/*.cc)
file(GLOB PROCESSORS_HEADERS ${PROJECT_SOURCE_DIR}/Processors/*.hh)
add_library(ORProcessors SHARED ${PROCESSORS_SRC} ${PROCESSORS_HEADERS})
target_link_libraries(ORProcessors ${ROOT_LIBRARIES} ${ROOT_XML_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ORDecoders ORIO)
install(TARGETS ORProcessors LIBRARY DESTINATION lib)
file(GLOB MANAGEMENT_SRC ${PROJECT_SOURCE_DIR}/Management/*.cc)
file(GLOB MANAGEMENT_HEADERS ${PROJECT_SOURCE_DIR}/Management/*.hh)
add_library(ORManagement SHARED ${MANAGEMENT_SRC} ${MANAGEMENT_HEADERS})
target_link_libraries(ORManagement ${ROOT_LIBRARIES} ${ROOT_XML_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ORProcessors)
install(TARGETS ORManagement LIBRARY DESTINATION lib)
set(SOURCES
${DECODERS_SRC}
${IO_SRC}
${MANAGEMENT_SRC}
${PROCESSORS_SRC}
${UTIL_SRC}
)
set(HEADERS
${DECODERS_HEADERS}
${IO_HEADERS}
${MANAGEMENT_HEADERS}
${PROCESSORS_HEADERS}
${UTIL_HEADERS}
)
install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
add_library(OrcaRoot SHARED ${SOURCES} ${HEADERS})
target_link_libraries(OrcaRoot ${ROOT_LIBRARIES} ${ROOT_XML_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
install(TARGETS OrcaRoot LIBRARY DESTINATION lib)
add_executable(getHeaderInRootFile Applications/getHeaderInRootFile.cc)
target_link_libraries(getHeaderInRootFile OrcaRoot)
add_executable(orcaroot_exe Applications/orcaroot.cc)
target_link_libraries(orcaroot_exe OrcaRoot)
add_executable(orcarootIgor Applications/orcarootIgor.cc)
target_link_libraries(orcarootIgor OrcaRoot)
add_executable(orcaroot_KATRIN_Filter Applications/orcaroot_KATRIN_Filter.cc)
target_link_libraries(orcaroot_KATRIN_Filter OrcaRoot)
add_executable(orcaroot_KATRIN_PS Applications/orcaroot_KATRIN_PS.cc)
target_link_libraries(orcaroot_KATRIN_PS OrcaRoot)
add_executable(orcaroot_ipe_katrin Applications/orcaroot_ipe_katrin.cc)
target_link_libraries(orcaroot_ipe_katrin OrcaRoot)
add_executable(orcaroot_ipe_unc Applications/orcaroot_ipe_unc.cc)
target_link_libraries(orcaroot_ipe_unc OrcaRoot)
add_executable(orcaroot_minesh Applications/orcaroot_minesh.cc)
target_link_libraries(orcaroot_minesh OrcaRoot)
add_executable(orcaroot_vme_unc Applications/orcaroot_vme_unc.cc)
target_link_libraries(orcaroot_vme_unc OrcaRoot)
add_executable(orhexdump Applications/orhexdump.cc)
target_link_libraries(orhexdump OrcaRoot)
add_executable(testHeaderReadin Applications/testHeaderReadin.cc)
target_link_libraries(testHeaderReadin OrcaRoot)
add_executable(testStopper Applications/testStopper.cc)
target_link_libraries(testStopper OrcaRoot)
add_executable(testUtil Applications/testUtil.cc)
target_link_libraries(testUtil OrcaRoot)
add_executable(writeShaperTree Applications/writeShaperTree.cc)
target_link_libraries(writeShaperTree OrcaRoot)
install(TARGETS
getHeaderInRootFile
orcaroot_exe
orcarootIgor
orcaroot_KATRIN_Filter
orcaroot_KATRIN_PS
orcaroot_ipe_katrin
orcaroot_ipe_unc
orcaroot_minesh
orcaroot_vme_unc
orhexdump
testHeaderReadin
testStopper
testUtil
writeShaperTree
DESTINATION bin)
option(BUILD_TOOLKIT "Build Toolkit" ON)
if(BUILD_TOOLKIT)
add_subdirectory(Toolkit)
endif()
#CMAKE Specifics
export(PACKAGE OrcaRoot)
configure_file(ModuleConfig.cmake.in "${PROJECT_BINARY_DIR}/OrcaRootConfig.cmake" @ONLY)
configure_file(ModuleConfigInstalled.cmake.in "${PROJECT_BINARY_DIR}/OrcaRootConfigInstalled.cmake" @ONLY)
configure_file(ModuleConfigVersion.cmake.in "${PROJECT_BINARY_DIR}/OrcaRootConfigVersion.cmake" @ONLY)
#Now for the Environment Variables
configure_file(OrcaRootEnv.sh "${PROJECT_BINARY_DIR}/OrcaRootEnv.sh" @ONLY)
install(FILES
"${PROJECT_BINARY_DIR}/OrcaRootConfig.cmake"
"${PROJECT_BINARY_DIR}/OrcaRootConfigVersion.cmake"
"${PROJECT_BINARY_DIR}/OrcaRootConfigInstalled.cmake"
"${PROJECT_BINARY_DIR}/OrcaRootEnv.sh"
DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT dev)
install(PROGRAMS ${CMAKE_INSTALL_PREFIX}/bin/orcaroot_exe DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/orcaroot)