]>
Commit | Line | Data |
---|---|---|
62e74968 | 1 | # -*- mode: cmake -*- |
2 | ||
6db31708 | 3 | # Top level CMakeList.txt file for the AliRoot Build System |
4 | # | |
5 | # Author: Johny Jose (johny.jose@cern.ch) | |
6 | # Port of previous Makefile build to cmake | |
e969a926 | 7 | |
e969a926 | 8 | |
6b06712c | 9 | cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR) |
e969a926 | 10 | |
6db31708 | 11 | #--------------------------------------------------------------------------------# |
12 | # Set Basic CMake Configuration # | |
13 | #--------------------------------------------------------------------------------# | |
b07a2059 | 14 | |
6db31708 | 15 | project(AliRoot CXX C Fortran) |
bf4c2121 | 16 | |
17 | # Environment variables | |
7f40fabf | 18 | set(ALICE_ROOT $ENV{ALICE_ROOT}) |
573f9121 | 19 | set(ALICE $ENV{ALICE}) |
54e40a8e | 20 | set(ALICE_INSTALL $ENV{ALICE_INSTALL}) |
64f5b205 | 21 | if(${ALICE_INSTALL} MATCHES ${CMAKE_BINARY_DIR}) |
22 | message(FATAL_ERROR "Install dir should be different from build dir") | |
23 | endif(${ALICE_INSTALL} MATCHES ${CMAKE_BINARY_DIR}) | |
1faae52c | 24 | # Environment for SHUTTLE |
25 | set(DIMDIR $ENV{DIMDIR}) | |
26 | set(ODIR $ENV{ODIR}) | |
6db31708 | 27 | |
28 | if(NOT ALICE) | |
29 | message(WARNING "Environment variable ALICE is not set") | |
30 | endif(NOT ALICE) | |
3ea0d710 | 31 | |
3ea0d710 | 32 | if(NOT ALICE_ROOT) |
6db31708 | 33 | message(FATAL_ERROR "Please set ALICE_ROOT to the AliRoot source directory") |
3ea0d710 | 34 | endif(NOT ALICE_ROOT) |
35 | ||
6db31708 | 36 | # Set AliRoot Installation directory |
37 | if(NOT ALICE_INSTALL) | |
38 | message(STATUS "AliRoot files will be installed in ${ALICE_ROOT}. You can specify a different location by setting ALICE_INSTALL environment variable") | |
39 | set(ALICE_INSTALL ${ALICE_ROOT}) | |
40 | else() | |
41 | message(STATUS "AliRoot files will be installed in ${ALICE_INSTALL}") | |
42 | endif(NOT ALICE_INSTALL) | |
24b052aa | 43 | set(CMAKE_INSTALL_PREFIX ${ALICE_INSTALL}) |
6db31708 | 44 | |
dad683d0 | 45 | get_filename_component(PROJECT_SOURCE_DIR "${PROJECT_SOURCE_DIR}" REALPATH) |
f72dcc4f | 46 | set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") |
0742852a | 47 | set(CPACK_COMPONENTS_ALL MDC) |
e969a926 | 48 | |
6db31708 | 49 | include(ALICE_CMake) |
f2cec6fb | 50 | |
6db31708 | 51 | #--------------------------------------------------------------------------------# |
52 | # Find Packages # | |
53 | #--------------------------------------------------------------------------------# | |
e969a926 | 54 | |
6db31708 | 55 | # Subversion |
56 | # ------------------------------ | |
e969a926 | 57 | |
6db31708 | 58 | find_package(Subversion REQUIRED) |
f7d3fd75 | 59 | |
6db31708 | 60 | # ROOT |
61 | # ------------------------------ | |
f7d3fd75 | 62 | |
6db31708 | 63 | find_package(ROOT REQUIRED) |
3ea0d710 | 64 | |
6db31708 | 65 | # IRST Rule Checker |
66 | # ------------------------------ | |
e969a926 | 67 | |
6db31708 | 68 | find_package(RuleChecker) |
e969a926 | 69 | |
6db31708 | 70 | # DATE |
71 | # ------------------------------ | |
e969a926 | 72 | |
6db31708 | 73 | find_package(DATE) |
e969a926 | 74 | |
6db31708 | 75 | # GEANT3 |
76 | # ------------------------------ | |
e969a926 | 77 | |
6db31708 | 78 | find_package(GEANT3) |
e969a926 | 79 | |
6db31708 | 80 | # AMORE |
81 | # ------------------------------ | |
82 | ||
83 | find_package(AMORE) | |
84 | ||
0742852a | 85 | # AliRoot CPack configuration |
86 | #------------------------------- | |
87 | ||
88 | find_package(CPack) | |
89 | ||
90 | ||
6db31708 | 91 | #--------------------------------------------------------------------------------# |
92 | # Environment/Compiler Configuration # | |
93 | #--------------------------------------------------------------------------------# | |
94 | ||
95 | ALICE_CheckOutOfSourceBuild() | |
96 | ALICE_RootConfig(CMAKE_CXX_COMPILER --cxx) | |
97 | ALICE_RootConfig(CMAKE_C_COMPILER --cc) | |
98 | ALICE_RootConfig(CMAKE_Fortran_COMPILER --f77) | |
99 | ALICE_ConfigurePlatform() | |
100 | ALICE_ConfigureCompiler() | |
101 | ||
102 | ||
103 | #--------------------------------------------------------------------------------# | |
104 | # AliRoot Path Settings # | |
105 | #--------------------------------------------------------------------------------# | |
106 | ||
107 | ALICE_DevFlagsOutput() | |
108 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin/tgt_${ALICE_TARGET}") | |
109 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib/tgt_${ALICE_TARGET}") | |
110 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib/tgt_${ALICE_TARGET}") | |
111 | set(CMAKE_INCLUDE_EXPORT_DIRECTORY "${PROJECT_BINARY_DIR}/include") | |
112 | file(MAKE_DIRECTORY ${CMAKE_INCLUDE_EXPORT_DIRECTORY}) | |
113 | set(EXPORTDIRS "${ALICE_INSTALL}/include") | |
114 | set(BINLIBDIRS "-L${CMAKE_LIBRARY_OUTPUT_DIRECTORY}") | |
115 | ||
0742852a | 116 | |
6db31708 | 117 | #--------------------------------------------------------------------------------# |
118 | # AliRoot Modules # | |
119 | #--------------------------------------------------------------------------------# | |
120 | ||
121 | # Exclude Module from all target | |
122 | # ------------------------------ | |
123 | ||
45526b5e | 124 | #set(EXCLUDEMODULES THydjet SHUTTLE) |
6db31708 | 125 | |
0742852a | 126 | |
6db31708 | 127 | # Standard Modules |
128 | # ------------------------------ | |
34dbffe9 | 129 | set(ALIROOTMODULES STEER PHOS TRD TPC ZDC MUON PMD FMD TOF ITS ACORDE HMPID T0 BCM STRUCT VZERO THijing THbtp EMCAL THerwig TEPEMGEN FASTSIM TPHIC RAW MONITOR ANALYSIS JETAN HLT STAT TTherminator CORRFW DPMJET TDPMjet PWGPP PWG PWGCF PWGGA PWGHF PWGDQ PWGJE PWGLF PWGUD TRIGGER PYTHIA8 TAmpt OADB MFT TEvtGen) |
45526b5e | 130 | |
131 | if(THydjet) | |
132 | list(APPEND ALIROOTMODULES THydjet) | |
133 | endif(THydjet) | |
134 | ||
135 | if(SHUTTLE) | |
136 | list(APPEND ALIROOTMODULES SHUTTLE) | |
137 | endif(SHUTTLE) | |
6db31708 | 138 | |
139 | # Additional Modules | |
140 | # ------------------------------ | |
141 | list(APPEND ALIROOTMODULES TUHKMgen EPOS) | |
142 | ||
143 | # EVE | |
144 | # ------------------------------ | |
145 | ALICE_RootConfig(EVE --has-opengl) | |
146 | if(NOT EVE STREQUAL "no") | |
147 | list(APPEND ALIROOTMODULES EVE) | |
148 | endif(NOT EVE STREQUAL "no") | |
149 | ||
150 | # CERN Modules | |
151 | # ------------------------------ | |
152 | set(CERNMODULES LHAPDF HIJING MICROCERN HERWIG) | |
153 | ||
154 | # Check for Pythia 6 | |
155 | if(EXISTS ${ROOTINCDIR}/TPythia6.h) | |
156 | set(PYTHIA6 TRUE) | |
872bf9ef | 157 | list(APPEND CERNMODULES PYTHIA6 EVGEN) |
811ffdcc | 158 | elseif(NOT NOPYTHIA) |
45526b5e | 159 | message(FATAL_ERROR "ROOT must have Pythia6 enabled !") |
6db31708 | 160 | endif(EXISTS ${ROOTINCDIR}/TPythia6.h) |
161 | ||
162 | # Set Final list of modules | |
163 | set(MODULES ${ALIROOTMODULES} ${CERNMODULES} ALIROOT) | |
164 | ||
165 | # Set Module directories | |
166 | set(MODDIRS ${MODULES}) | |
167 | ||
168 | # Libraries for Linking | |
169 | # ------------------------------ | |
820b4d9e | 170 | set(ALILIBS MUON TPC PMD TRD FMD TOF ITS PHOS ACORDE HMPID VZERO ZDC STRUCT T0 EVGEN STEER TRIGGER MFT) |
6db31708 | 171 | set(LIBS ${ROOTCLIBS} ${ROOTPLIBS} ${SYSLIBS}) |
172 | ||
173 | # Configure ARVerion.h | |
174 | # ------------------------------ | |
175 | if(Subversion_FOUND) | |
bf4c2121 | 176 | if(EXISTS ${PROJECT_SOURCE_DIR}/.svn/ ) |
6db31708 | 177 | Subversion_WC_INFO(${PROJECT_SOURCE_DIR} PROJECT) |
178 | set(ALIROOT_SVN_REVISION ${PROJECT_WC_REVISION}) | |
179 | set(ALIROOT_SVN_BRANCH ${PROJECT_WC_URL}) | |
180 | string(REGEX MATCH "[^/]+$" ALIROOT_SVN_BRANCH ${ALIROOT_SVN_BRANCH}) | |
bf4c2121 | 181 | |
182 | elseif(EXISTS ${PROJECT_SOURCE_DIR}/.git/ ) | |
c7872b32 | 183 | if(EXISTS ${PROJECT_SOURCE_DIR}/.git/svn/refs ) |
bf4c2121 | 184 | execute_process(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND git svn info OUTPUT_VARIABLE OUTPUTVAR) |
185 | string(REPLACE "\n" ";" OUTPUTVAR ${OUTPUTVAR}) | |
186 | foreach(f ${OUTPUTVAR}) | |
187 | if(${f} MATCHES URL) | |
188 | string(REGEX MATCH "[^/]+$" ALIROOT_SVN_BRANCH ${f}) | |
189 | elseif(${f} MATCHES Revision) | |
855ce9b3 | 190 | string(REGEX MATCH "[^: ]+$" ALIROOT_SVN_REVISION ${f}) |
bf4c2121 | 191 | endif(${f} MATCHES URL) |
192 | endforeach() | |
c7872b32 | 193 | else() |
194 | execute_process(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND git log -1 OUTPUT_VARIABLE OUTPUTVAR) | |
195 | string(REPLACE "\n" ";" OUTPUTVAR ${OUTPUTVAR}) | |
196 | foreach(f ${OUTPUTVAR}) | |
197 | if(${f} MATCHES "^[ ]*git-svn-id:") | |
198 | string(REGEX REPLACE "^.*/(.*)[@].*$" "\\1" ALIROOT_SVN_BRANCH "${f}" ) | |
199 | string(REGEX REPLACE "^.*/.*[@](.*) .*$" "\\1" ALIROOT_SVN_REVISION "${f}" ) | |
200 | endif(${f} MATCHES "^[ ]*git-svn-id:") | |
201 | endforeach() | |
202 | if(${ALIROOT_SVN_BRANCH}x STREQUAL "x") | |
203 | set(ALIROOT_SVN_BRANCH "git clone") | |
204 | set(ALIROOT_SVN_REVISION "-1") | |
205 | endif(${ALIROOT_SVN_BRANCH}x STREQUAL "x") | |
206 | endif(EXISTS ${PROJECT_SOURCE_DIR}/.git/svn/refs ) | |
bf4c2121 | 207 | endif(EXISTS ${PROJECT_SOURCE_DIR}/.svn/ ) |
208 | ||
6db31708 | 209 | message(STATUS "Aliroot Revision - ${ALIROOT_SVN_REVISION} Branch - ${ALIROOT_SVN_BRANCH}") |
210 | if(EXISTS ${CMAKE_INCLUDE_EXPORT_DIRECTORY}/ARVersion.h) | |
211 | file(REMOVE ${CMAKE_INCLUDE_EXPORT_DIRECTORY}/ARVersion.h) | |
212 | endif(EXISTS ${CMAKE_INCLUDE_EXPORT_DIRECTORY}/ARVersion.h) | |
213 | configure_file(${PROJECT_SOURCE_DIR}/cmake/ARVersion.h.tmp ${CMAKE_INCLUDE_EXPORT_DIRECTORY}/ARVersion.h @ONLY) | |
214 | endif(Subversion_FOUND) | |
7251bfcc | 215 | string (REPLACE "-" "." ALIROOT_SVN_BRANCH_SPEC "${ALIROOT_SVN_BRANCH}") |
6db31708 | 216 | |
217 | #--------------------------------------------------------------------------------# | |
218 | # Build Modules # | |
219 | #--------------------------------------------------------------------------------# | |
220 | ||
221 | # Module Variables | |
222 | # ------------------------------ | |
223 | set(ALLLIBS) | |
224 | set(ALLEXECS) | |
225 | set(INCLUDEFILES) | |
226 | set(BINLIBS) | |
227 | set(EXPORTFILES) | |
228 | ||
229 | # Top Level Build Targets | |
230 | # ------------------------------ | |
231 | ||
232 | add_custom_target(alilibs-static) | |
e93f6949 | 233 | add_custom_target(include-headers ALL) |
45526b5e | 234 | add_custom_target(DA-all) |
e93f6949 | 235 | add_custom_target(check-all) |
236 | add_custom_target(check-hxml) | |
ae388d3b | 237 | add_custom_target(smell-all) |
6a1caa6b | 238 | add_custom_target(htmldoc) |
6a9e2760 | 239 | add_custom_target(par-all) |
3a8dbb31 | 240 | add_custom_target(test-par-all) |
7531a2ac | 241 | |
6a1caa6b | 242 | #NY file(GLOB CFILES_LIST ${CMAKE_SOURCE_DIR}/macros/*.C) |
243 | ||
244 | add_custom_command(TARGET htmldoc | |
245 | PRE_BUILD | |
246 | COMMAND mkdir -p html | |
247 | COMMAND rm -rf html/roothtml | |
248 | COMMAND rm -f html/picts | |
249 | COMMAND cd html && | |
250 | aliroot -q -b \"mkhtml.C(0,1)\" | |
251 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | |
252 | ||
144f39dd | 253 | # Include Vc, which provides the static libVc and the relevant CMake macros |
254 | include(Vc/Vc.cmake) | |
255 | add_subdirectory(Vc) | |
6a1caa6b | 256 | |
257 | # Add Modules | |
6db31708 | 258 | # ------------------------------ |
259 | foreach(MODULE ${MODDIRS}) | |
45526b5e | 260 | set(${MODULE}ALIBS) |
e017f840 | 261 | #RS configure_file(${PROJECT_SOURCE_DIR}/cmake/Module.tmp ${PROJECT_SOURCE_DIR}/${MODULE}/CMakeLists.txt @ONLY) |
6db31708 | 262 | add_custom_target(${MODULE}-all ALL) |
3a8dbb31 | 263 | add_custom_target(${MODULE}-par-all) |
264 | add_custom_target(test-${MODULE}-par-all) | |
529f129e | 265 | add_custom_target(${MODULE}-all-static) |
6db31708 | 266 | add_dependencies(alilibs-static "${MODULE}-static") |
267 | add_subdirectory(${MODULE}) | |
6a1caa6b | 268 | |
269 | #NY set(dir "${CMAKE_SOURCE_DIR}/${MODULE}") | |
270 | #NY if (EXISTS "${dir}") | |
271 | #NY file(GLOB CFILES_MOD ${dir}/*.C) | |
272 | #NY list(LENGTH CFILES_MOD len) | |
273 | #NY if (${len} GREATER 0) | |
274 | #NY list(APPEND CFILES_LIST "${CFILES_MOD}") | |
275 | #NY endif (${len} GREATER 0) | |
276 | #NY endif(EXISTS "${dir}") | |
6db31708 | 277 | endforeach(MODULE) |
278 | ||
6a1caa6b | 279 | #NY foreach(cfile ${CFILES_LIST}) |
280 | #NY add_custom_command(TARGET htmldoc | |
281 | #NY PRE_BUILD | |
282 | #NY COMMAND cd html && | |
283 | #NY aliroot -b -q \"mkhtml.C(\"${cfile}\")\" > /dev/null | |
284 | #NY WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | |
285 | #NY endforeach(cfile) | |
286 | ||
5713c03f | 287 | if(DATE_FOUND) |
c3b22277 | 288 | include (CMakeDA) |
5713c03f | 289 | endif(DATE_FOUND) |
c3b22277 | 290 | |
f09b91ba | 291 | if(RULECHECKER_FOUND) |
e93f6949 | 292 | add_custom_target(factfile DEPENDS ${FACTFILE}) |
62e74968 | 293 | add_custom_command( OUTPUT ${FACTFILE} |
e93f6949 | 294 | COMMAND ${CMAKE_COMMAND} -E echo "Re-generating factfile" |
295 | COMMAND ${JAVA_RUNTIME} -Xmx1024M -jar ${FACTEXTRACTOR_JAR} ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR} | |
296 | DEPENDS check-hxml ${CMAKE_BINARY_DIR}/check-hxml-touchfile ${_factfile_deps} | |
62e74968 | 297 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) |
f09b91ba | 298 | endif(RULECHECKER_FOUND) |
62e74968 | 299 | |
6db31708 | 300 | #--------------------------------------------------------------------------------# |
301 | # Additional Targets # | |
302 | #--------------------------------------------------------------------------------# | |
303 | ||
7531a2ac | 304 | # AliMdc RPM |
305 | # ------------------------------ | |
306 | ||
f17f29d0 | 307 | execute_process( |
308 | COMMAND root-config --libdir | |
309 | OUTPUT_VARIABLE ROOTALIBDIR) | |
310 | string(REPLACE "\n" "" ROOTALIBDIR ${ROOTALIBDIR}) | |
311 | ||
312 | execute_process( | |
313 | COMMAND root-config --arch | |
314 | OUTPUT_VARIABLE ARCHITECTURE) | |
315 | ||
316 | ||
317 | set(AEXT a) | |
318 | set(LIBPATH ${CMAKE_BINARY_DIR}/lib/tgt_${ALICE_TARGET}) | |
319 | set(BINPATH ${CMAKE_BINARY_DIR}/bin/tgt_${ALICE_TARGET}) | |
320 | set(EXPORTDIR ${ALICE_ROOT}/include) | |
321 | set(BINLIBDIRS -L${ALICE_ROOT}/${LIBPATH}) | |
322 | set(RAWDIRO ${CMAKE_BINARY_DIR}/RAW) | |
323 | set(ALIMDCSPECFILE ${RAWDIRO}/alimdc.spec) | |
324 | set(RAWDatabaseALIB ${LIBPATH}/libRAWDatabase.${AEXT}) | |
325 | set(ESDALIB ${LIBPATH}/libESD.${AEXT}) | |
326 | set(STEERBaseALIB ${LIBPATH}/libSTEERBase.${AEXT}) | |
327 | set(MDCALIB ${LIBPATH}/libMDC.${AEXT}) | |
328 | set(MODDIRO RAW/tgt_${ALICE_TARGET}) | |
329 | ||
330 | ||
331 | if( ${ARCHITECTURE} MATCHES "linuxx8664gcc" ) | |
332 | set(ALIMDCARCHDIR x86_64) | |
333 | elseif( ${ARCHITECTURE} MATCHES "linux" ) | |
334 | set(ALIMDCARCHDIR i386) | |
335 | elseif( ${ARCHITECTURE} MATCHES "linuxia64gcc" ) | |
336 | set(ALIMDCARCHDIR ia64) | |
337 | elseif(NOT DEFINED ${ARCHITECTURE}) | |
d9fbc3ca | 338 | message("alimdc-rpm: Unknown architecture" ) |
f17f29d0 | 339 | else( ${ARCHITECTURE} MATCHES "linuxx8664gcc" ) |
d9fbc3ca | 340 | message("alimdc-rpm: Unknown architecture" ) |
f17f29d0 | 341 | endif( ${ARCHITECTURE} MATCHES "linuxx8664gcc" ) |
342 | ||
343 | ||
344 | add_custom_target( alimdc-rpm | |
345 | DEPENDS alimdc-static alimdc-specfile | |
346 | ) | |
347 | ||
348 | add_custom_command( | |
349 | TARGET alimdc-rpm | |
350 | POST_BUILD | |
351 | COMMAND rm -rf ${ALICE_ROOT}/alimdc-root | |
352 | COMMAND mkdir -p ${ALICE_ROOT}/alimdc-root/opt/alimdc/lib | |
353 | COMMAND mkdir -p ${ALICE_ROOT}/alimdc-root/opt/alimdc/include | |
354 | COMMAND cp ${ALICE_ROOT}/RAW/mdc.h ${ALICE_ROOT}/alimdc-root/opt/alimdc/include | |
355 | COMMAND cp ${LIBPATH}/libAliMDC.a ${ALICE_ROOT}/alimdc-root/opt/alimdc/lib | |
356 | COMMAND cp ${ROOTALIBDIR}/libRoot.a ${ALICE_ROOT}/alimdc-root/opt/alimdc/lib | |
d06540f4 | 357 | COMMAND cp ${ROOTALIBDIR}/liblzma.a ${ALICE_ROOT}/alimdc-root/opt/alimdc/lib |
358 | COMMAND cp ${ROOTALIBDIR}/libpcre.a ${ALICE_ROOT}/alimdc-root/opt/alimdc/lib | |
f17f29d0 | 359 | COMMAND cp ${ROOTALIBDIR}/libfreetype.a ${ALICE_ROOT}/alimdc-root/opt/alimdc/lib |
360 | COMMAND cp ${ROOTALIBDIR}/libpcre.a ${ALICE_ROOT}/alimdc-root/opt/alimdc/lib | |
361 | COMMAND rm -rf ${ALICE_ROOT}/RPMS | |
362 | COMMAND mkdir -p ${ALICE_ROOT}/RPMS/${ALIMDCARCHDIR}/ | |
363 | COMMAND rpmbuild --verbose --define "_topdir ${ALICE_ROOT}" --define "_tmppath ${ALICE_ROOT}" -bb ${ALIMDCSPECFILE} | |
364 | COMMAND cp -p ${ALICE_ROOT}/RPMS/${ALIMDCARCHDIR}/alimdc-*.rpm . | |
365 | COMMAND rm -rf ${ALICE_ROOT}/alimdc-root | |
366 | COMMAND rm -rf ${ALICE_ROOT}/RPMS | |
367 | COMMAND echo "***** alimdc RPM created and put in ${CMAKE_BINARY_DIR} folder *****" | |
368 | ) | |
369 | ||
370 | add_custom_command( | |
371 | TARGET ${RAWDIRO} | |
372 | COMMAND mkdir-p ${RAWDIRO} | |
373 | ) | |
374 | ||
375 | ||
376 | add_custom_target( alimdc-specfile | |
377 | DEPENDS ${RAWDIRO} | |
378 | ) | |
379 | ||
380 | add_custom_command( | |
381 | TARGET alimdc-specfile | |
382 | POST_BUILD | |
383 | COMMAND rm -rf ${ALIMDCSPECFILE} | |
384 | COMMAND @echo "***** Making alimdc RPM spec-file ${ALIMDCSPECFILE} *****" | |
385 | COMMAND @echo '\# RPM specfile for alimdc static libs' >> ${ALIMDCSPECFILE} | |
386 | COMMAND @echo '\# Package contains both ROOT and AliRoot' >> ${ALIMDCSPECFILE} | |
387 | COMMAND @echo '\# static libs needed by mStreamRecorder' >> ${ALIMDCSPECFILE} | |
388 | COMMAND @echo '\# in order to ROOT-ify the incoming raw' >> ${ALIMDCSPECFILE} | |
389 | COMMAND @echo '\# data' >> ${ALIMDCSPECFILE} | |
390 | COMMAND @echo '\# Example how-to build alimdc RPM:' >> ${ALIMDCSPECFILE} | |
391 | COMMAND @echo '\# cd ${ALICE_ROOT}' >> ${ALIMDCSPECFILE} | |
392 | COMMAND @echo '\# make alimdc-rpm' >> ${ALIMDCSPECFILE} | |
393 | COMMAND @echo "" >> ${ALIMDCSPECFILE} | |
394 | COMMAND @echo "Summary: AliMDC static libraries" >> ${ALIMDCSPECFILE} | |
395 | COMMAND @echo "Name: alimdc" >> ${ALIMDCSPECFILE} | |
7251bfcc | 396 | COMMAND @echo "Version: ${ALIROOT_SVN_BRANCH_SPEC}" >> ${ALIMDCSPECFILE} |
f17f29d0 | 397 | COMMAND @echo "Release: ${ALIROOT_SVN_REVISION}" >> ${ALIMDCSPECFILE} |
398 | COMMAND @echo '\# Copyright: CERN Alice Off-line' >> ${ALIMDCSPECFILE} | |
399 | COMMAND @echo "License: CERN Alice Off-line" >> ${ALIMDCSPECFILE} | |
400 | COMMAND @echo "Vendor: ALICE Core Off-line Group" >> ${ALIMDCSPECFILE} | |
401 | COMMAND @echo "URL: http://aliceinfo.cern.ch" >> ${ALIMDCSPECFILE} | |
402 | COMMAND @echo "Group: Applications/Alice" >> ${ALIMDCSPECFILE} | |
403 | COMMAND @echo "Prefix: /opt/%{name}" >> ${ALIMDCSPECFILE} | |
404 | COMMAND @echo "BuildRoot: %{_tmppath}/%{name}-root" >> ${ALIMDCSPECFILE} | |
405 | COMMAND @echo "" >> ${ALIMDCSPECFILE} | |
406 | COMMAND @echo '\# automatic dependencies' >> ${ALIMDCSPECFILE} | |
407 | COMMAND @echo "AutoReqProv: yes" >> ${ALIMDCSPECFILE} | |
408 | COMMAND @echo "" >> ${ALIMDCSPECFILE} | |
409 | COMMAND @echo '\# list here required RPM packages for runtime' >> ${ALIMDCSPECFILE} | |
410 | COMMAND @echo "Requires: glibc" >> ${ALIMDCSPECFILE} | |
411 | COMMAND @echo "" >> ${ALIMDCSPECFILE} | |
412 | COMMAND @echo "Provides: alimdc" >> ${ALIMDCSPECFILE} | |
413 | COMMAND @echo "" >> ${ALIMDCSPECFILE} | |
414 | COMMAND @echo '\# description of the package' >> ${ALIMDCSPECFILE} | |
415 | COMMAND @echo "%description" >> ${ALIMDCSPECFILE} | |
416 | COMMAND @echo "Package contains both ROOT and AliRoot" >> ${ALIMDCSPECFILE} | |
417 | COMMAND @echo "static libs needed by mStreamRecorder" >> ${ALIMDCSPECFILE} | |
418 | COMMAND @echo "in order to ROOT-ify the incoming raw" >> ${ALIMDCSPECFILE} | |
419 | COMMAND @echo "data. The package version correspond to" >> ${ALIMDCSPECFILE} | |
420 | COMMAND @echo "the AliRoot one." >> ${ALIMDCSPECFILE} | |
421 | COMMAND @echo "" >> ${ALIMDCSPECFILE} | |
422 | COMMAND @echo '\# list of files to be installed' >> ${ALIMDCSPECFILE} | |
423 | COMMAND @echo "%files" >> ${ALIMDCSPECFILE} | |
424 | COMMAND @echo '%defattr (-,root,root)' >> ${ALIMDCSPECFILE} | |
425 | COMMAND @echo "%{prefix}/lib/libAliMDC.a" >> ${ALIMDCSPECFILE} | |
426 | COMMAND @echo "%{prefix}/lib/libRoot.a" >> ${ALIMDCSPECFILE} | |
427 | COMMAND @echo "%{prefix}/lib/libpcre.a" >> ${ALIMDCSPECFILE} | |
d06540f4 | 428 | COMMAND @echo "%{prefix}/lib/liblzma.a" >> ${ALIMDCSPECFILE} |
f17f29d0 | 429 | COMMAND @echo "%{prefix}/lib/libfreetype.a" >> ${ALIMDCSPECFILE} |
430 | COMMAND @echo "%{prefix}/include/mdc.h" >> ${ALIMDCSPECFILE} | |
431 | ) | |
432 | ||
433 | ||
434 | add_custom_target( alimdc-static | |
435 | DEPENDS ${LIBPATH} ${BINPATH} RAW-all-static STEER-all-static ) | |
436 | ||
437 | add_custom_command( | |
438 | TARGET alimdc-static | |
439 | POST_BUILD | |
440 | COMMAND ar r ${LIBPATH}/alimdccxxo.a ${CMAKE_BINARY_DIR}/RAW/CMakeFiles/alimdc.dir/alimdc_main.cxx.o | |
441 | COMMAND rm -rf ${LIBPATH}/libAliMDC.a | |
442 | COMMAND ar x ${RAWDatabaseALIB} | |
443 | COMMAND ar x ${MDCALIB} | |
444 | COMMAND ar x ${ESDALIB} | |
445 | COMMAND ar x ${STEERBaseALIB} | |
446 | COMMAND ar r ${LIBPATH}/libAliMDC.a *.o | |
447 | COMMAND ar t ${RAWDatabaseALIB} | xargs rm | |
448 | COMMAND ar t ${MDCALIB} | xargs rm | |
449 | COMMAND ar t ${ESDALIB} | xargs rm | |
450 | COMMAND ar t ${STEERBaseALIB} | xargs rm | |
d06540f4 | 451 | COMMAND ${CMAKE_CXX_COMPILER} ${LDFLAGS} -o ${BINPATH}/alimdca ${LIBPATH}/alimdccxxo.a ${LIBPATH}/libAliMDC.a ${ROOTALIBDIR}/libRoot.a ${ROOTALIBDIR}/libfreetype.a ${ROOTALIBDIR}/libpcre.a ${ROOTALIBDIR}/liblzma.a -pthread -ldl -lz |
f17f29d0 | 452 | COMMAND @echo "Target alimdc-static made" |
453 | ) | |
454 | ||
455 | add_custom_command( | |
456 | TARGET ${LIBPATH} | |
457 | COMMAND mkdir -p ${LIBPATH} | |
458 | ) | |
459 | ||
460 | ||
461 | #include (MakefileDA) | |
6db31708 | 462 | include (InstallRequiredSystemLibraries) |
463 | include (CPack) | |
e969a926 | 464 | |
d2884be9 | 465 | # Install data |
466 | # ------------------------------ | |
467 | install ( DIRECTORY data | |
468 | DESTINATION . ) | |
71d5ee50 | 469 | install ( DIRECTORY OCDB |
470 | DESTINATION . | |
471 | PATTERN ".svn" EXCLUDE) | |
472 | install ( DIRECTORY QAref | |
473 | DESTINATION . | |
474 | PATTERN ".svn" EXCLUDE) | |
c2aad3ae | 475 | install ( DIRECTORY GRP |
476 | DESTINATION . | |
477 | PATTERN ".svn" EXCLUDE) | |
d2884be9 | 478 | |
479 | # | |
480 | # EOF | |
481 | # | |
482 |