-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
282 lines (263 loc) · 7.43 KB
/
CMakeLists.txt
File metadata and controls
282 lines (263 loc) · 7.43 KB
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# Copyright (C) 1995-2019, Rene Brun and Fons Rademakers.
# All rights reserved.
#
# For the licensing terms see $ROOTSYS/LICENSE.
# For the list of contributors see $ROOTSYS/README/CREDITS.
############################################################################
# CMakeLists.txt file for building ROOT core/base package
############################################################################
if(MSVC AND MSVC_VERSION GREATER_EQUAL 1925 AND MSVC_VERSION LESS 1929)
# FIXME: since Visual Studio v16.5.0 the /O2 optimization flag makes most of the roofit/roostats tests failing
# Try to re-enable /O2 after the upgrade of llvm & clang, or when upgrading Visual Studio
string(REPLACE "-O2" "-O1 -Oi" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
string(REPLACE "-O2" "-O1 -Oi" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
endif()
set(BASE_HEADERS
ROOT/RFloat16.hxx
ROOT/TErrorDefaultHandler.hxx
ROOT/TExecutorCRTP.hxx
ROOT/TSequentialExecutor.hxx
ROOT/StringConv.hxx
Buttons.h
Bytes.h
Byteswap.h
KeySymbols.h
MessageTypes.h
Riostream.h
Rtypes.h
TApplication.h
TAtt3D.h
TAttAxis.h
TAttBBox2D.h
TAttBBox.h
TAttFill.h
TAttLine.h
TAttMarker.h
TAttPad.h
TAttText.h
TBase64.h
TBenchmark.h
TBuffer3D.h
TBuffer3DTypes.h
TBuffer.h
TColor.h
TColorGradient.h
TDatime.h
TDirectory.h
TEnv.h
TException.h
TExec.h
TFileCollection.h
TFileInfo.h
TFolder.h
TInetAddress.h
TMacro.h
TMathBase.h
TMD5.h
TMemberInspector.h
TMessageHandler.h
TNamed.h
TNotifyLink.h
TObject.h
TObjString.h
TParameter.h
TPluginManager.h
TPoint.h
TPRegexp.h
TProcessID.h
TProcessUUID.h
TQClass.h
TQCommand.h
TQConnection.h
TQObject.h
TRedirectOutputGuard.h
TRefCnt.h
TRef.h
TRegexp.h
TRemoteObject.h
TROOT.h
TRootIOCtor.h
TStopwatch.h
TStorage.h
TString.h
TStringLong.h
TStyle.h
TSysEvtHandler.h
TSystemDirectory.h
TSystemFile.h
TSystem.h
TTask.h
TThreadSlots.h
TTime.h
TTimer.h
TTimeStamp.h
TUri.h
TUrl.h
TUUID.h
TVersionCheck.h
TVirtualAuth.h
TVirtualFFT.h
TVirtualGL.h
TVirtualMonitoring.h
TVirtualMapFile.h
TVirtualMutex.h
TVirtualPadEditor.h
TVirtualPad.h
TVirtualPadPainter.h
TVirtualPerfStats.h
TVirtualPS.h
TVirtualQConnection.h
TVirtualRWMutex.h
TVirtualTableInterface.h
TVirtualViewer3D.h
TVirtualX.h
)
set(BASE_SOURCES
src/Match.cxx
src/String.cxx
src/Stringio.cxx
src/TApplication.cxx
src/TAtt3D.cxx
src/TAttAxis.cxx
src/TAttBBox2D.cxx
src/TAttBBox.cxx
src/TAttFill.cxx
src/TAttLine.cxx
src/TAttMarker.cxx
src/TAttPad.cxx
src/TAttText.cxx
src/TBase64.cxx
src/TBenchmark.cxx
src/TBuffer3D.cxx
src/TBuffer.cxx
src/TColor.cxx
src/TColorGradient.cxx
src/TDatime.cxx
src/TDirectory.cxx
src/TEnv.cxx
src/TErrorDefaultHandler.cxx
src/TException.cxx
src/TExec.cxx
src/TFileCollection.cxx
src/TFileInfo.cxx
src/TFolder.cxx
src/TInetAddress.cxx
src/TListOfTypes.cxx
src/TListOfTypes.h
src/TMacro.cxx
src/TMathBase.cxx
src/TMD5.cxx
src/TMemberInspector.cxx
src/TMessageHandler.cxx
src/TNamed.cxx
src/TObject.cxx
src/TObjString.cxx
src/TParameter.cxx
src/TPluginManager.cxx
src/TPRegexp.cxx
src/TProcessID.cxx
src/TProcessUUID.cxx
src/TQCommand.cxx
src/TQConnection.cxx
src/TQObject.cxx
src/TRefCnt.cxx
src/TRef.cxx
src/TRegexp.cxx
src/TRemoteObject.cxx
src/TROOT.cxx
src/TStopwatch.cxx
src/TStorage.cxx
src/TString.cxx
src/TStringLong.cxx
src/TStyle.cxx
src/TSysEvtHandler.cxx
src/TSystem.cxx
src/TSystemDirectory.cxx
src/TSystemFile.cxx
src/TTask.cxx
src/TTime.cxx
src/TTimer.cxx
src/TTimeStamp.cxx
src/TUri.cxx
src/TUrl.cxx
src/TUUID.cxx
src/TVirtualFFT.cxx
src/TVirtualGL.cxx
src/TVirtualMonitoring.cxx
src/TVirtualMutex.cxx
src/TVirtualPad.cxx
src/TVirtualPadEditor.cxx
src/TVirtualPadPainter.cxx
src/TVirtualPerfStats.cxx
src/TVirtualPS.cxx
src/TVirtualViewer3D.cxx
src/TVirtualX.cxx
)
set(RELATIVE_BASE_INC_HEADERS ${BASE_HEADERS})
list(TRANSFORM RELATIVE_BASE_INC_HEADERS PREPEND inc/)
# only here complete list of headers can be propogated to parent cmake file
set_property(TARGET Core APPEND PROPERTY DICT_HEADERS ${BASE_HEADERS})
target_sources(Core PRIVATE ${BASE_SOURCES})
if(NOT CMAKE_VERSION VERSION_LESS "3.23.0") # https://discourse.cmake.org/t/file-set-xyz-is-listed-in-interface-file-sets-of-w-but-has-not-been-exported/9131/3
target_sources(
Core
PRIVATE
FILE_SET private_header_files
TYPE HEADERS
BASE_DIRS inc/ src/
FILES
${RELATIVE_BASE_INC_HEADERS}
src/TListOfTypes.h
)
endif()
target_include_directories(Core PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc>
)
if(ROOT_NEED_STDCXXFS)
target_link_libraries(Core PRIVATE stdc++fs)
endif()
# This code about the LIB_CORE_NAME define is important for TROOT::GetSharedLibDir()
set(full_core_filename $<TARGET_FILE_NAME:Core>)
# Absolue CMAKE_INSTALL_<dir> paths are discouraged in CMake, but some
# packagers use them anyway. So we support it.
if(IS_ABSOLUTE ${CMAKE_INSTALL_INCLUDEDIR})
set(install_lib_to_include "${CMAKE_INSTALL_INCLUDEDIR}")
else()
if(IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR})
set(libdir "${CMAKE_INSTALL_LIBDIR}")
else()
set(libdir "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
endif()
file(RELATIVE_PATH install_lib_to_include "${libdir}" "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}")
unset(libdir)
endif()
target_compile_options(Core PRIVATE -DLIB_CORE_NAME=${full_core_filename}
-DINSTALL_LIB_TO_INCLUDE="${install_lib_to_include}"
)
add_dependencies(Core ensure_build_tree_marker)
if(PCRE2_FOUND)
target_link_libraries(Core PRIVATE PCRE2::PCRE2)
set_source_files_properties(src/TPRegexp.cxx
TARGET_DIRECTORY Core
PROPERTIES COMPILE_DEFINITIONS USE_PCRE2)
else()
target_link_libraries(Core PRIVATE PCRE::PCRE)
endif()
ROOT_INSTALL_HEADERS(${BASE_HEADER_DIRS})
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/man)
if(NOT MSVC)
#---addRootC++CmdMan-------------------------------------------------------------------------
generateManual(rootMan ${CMAKE_CURRENT_SOURCE_DIR}/src/root-argparse.py ${CMAKE_BINARY_DIR}/man/root.1)
generateManual(haddMan ${CMAKE_SOURCE_DIR}/main/src/hadd-argparse.py ${CMAKE_BINARY_DIR}/man/hadd.1)
generateManual(rootclingMan ${CMAKE_SOURCE_DIR}/core/dictgen/src/rootcling-argparse.py ${CMAKE_BINARY_DIR}/man/rootcling.1)
#---addRootPyCmdMan---------------------------------------------------------------------------
#generateManual(rootcpMan ${CMAKE_SOURCE_DIR}/main/python/rootcp.py ${CMAKE_BINARY_DIR}/man/rootcp.1)
#generateManual(rootdrawtreeMan ${CMAKE_SOURCE_DIR}/main/python/rootdrawtree.py ${CMAKE_BINARY_DIR}/man/rootdrawtree.1)
#generateManual(rooteventselectorMan ${CMAKE_SOURCE_DIR}/main/python/rooteventselector.py ${CMAKE_BINARY_DIR}/man/rooteventselector.1)
#generateManual(rootmkdirMan ${CMAKE_SOURCE_DIR}/main/python/rootmkdir.py ${CMAKE_BINARY_DIR}/man/rootmkdir.1)
#generateManual(rootmvMan ${CMAKE_SOURCE_DIR}/main/python/rootmv.py ${CMAKE_BINARY_DIR}/man/rootmv.1)
#generateManual(rootprintMan ${CMAKE_SOURCE_DIR}/main/python/rootprint.py ${CMAKE_BINARY_DIR}/man/rootprint.1)
#generateManual(rootrmMan ${CMAKE_SOURCE_DIR}/main/python/rootrm.py ${CMAKE_BINARY_DIR}/man/rootrm.1)
#generateManual(rootslimtreeMan ${CMAKE_SOURCE_DIR}/main/python/rootslimtree.py ${CMAKE_BINARY_DIR}/man/rootslimtree.1)
endif()
ROOT_ADD_TEST_SUBDIRECTORY(test)