]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - CMakeLists.txt
correcting AliHLTGlobalTriggerDecision::Clear(): using Delete instead of Clear for...
[u/mrichter/AliRoot.git] / CMakeLists.txt
... / ...
CommitLineData
1# -*- mode: cmake -*-
2
3# Check if cmake has the required version
4cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
5
6# Set name of our project to AliRoot. To be done after check of cmake version
7project(AliRoot NONE)
8
9# Set AliRoot variables
10set(CMAKE_VERBOSE_MAKEFILES OFF)
11#fix for MACOSX
12SET(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem")
13SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem")
14
15set(ALICE_INSTALL $ENV{ALICE_INSTALL})
16set(ALICE_ROOT $ENV{ALICE_ROOT})
17set(ALICE_STATIC_BUILD OFF CACHE BOOL "Build also statics libs")
18execute_process(COMMAND root-config --arch OUTPUT_VARIABLE ALICE_TARGET)
19string (REGEX REPLACE "\n" "" ALICE_TARGET ${ALICE_TARGET})
20
21if(NOT ALICE_INSTALL)
22message(FATAL_ERROR "Please set environment variable ALICE_INSTALL to the AliRoot installation directory")
23endif(NOT ALICE_INSTALL)
24if(NOT ALICE_ROOT)
25message(FATAL_ERROR "Please set environment variable ALICE_ROOT to the AliRoot source directory")
26endif(NOT ALICE_ROOT)
27
28
29message("ALICE_ROOT: ${ALICE_ROOT}")
30
31
32# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/
33#set(PROJECT_BINARY_DIR ${ALICE_INSTALL})
34set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin/tgt_${ALICE_TARGET})
35set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib/tgt_${ALICE_TARGET})
36set(CMAKE_MODULE_PATH "${ALICE_ROOT}/cmake/modules")
37
38# To fix a hack that has been introduced for the Mac
39if(APPLE)
40 set(CMAKE_INSTALL_NAME_TOOL CMAKE_INSTALL_NAME_TOOL-NOTFOUND)
41endif(APPLE)
42
43# Setup ROOT and C, C++ , Fortran Compilers
44find_package(ROOT 5.0.0 REQUIRED)
45set(CMAKE_C_COMPILER $ENV{CC})
46enable_language(C)
47set(CMAKE_CXX_COMPILER $ENV{CXX})
48enable_language(CXX)
49set(CMAKE_Fortran_COMPILER $ENV{F77})
50enable_language(Fortran)
51
52# Load some basic macros which are needed later on
53#Include(WriteConfigFile)
54
55include (CTest)
56include(ALICEMacros)
57
58# Check if the user wants to build the project in the source directory
59Check_out_of_Source_Build()
60
61# searches for needed packages
62
63
64# Setup GEANT3
65find_package(GEANT3)
66
67# Setup RuleChecker
68find_package(RuleChecker)
69
70# Check if DATE is installed
71find_package(DATE)
72
73# Setup system dependent flags
74SetupSystem()
75
76Include(CreateSubCMakeFiles)
77CreateSubCMakeFiles()
78
79
80
81
82# Set the library version in the main CMakeLists.txt
83set(ALIROOT_MAJOR_VERSION 0)
84set(ALIROOT_MINOR_VERSION 0)
85set(ALIROOT_PATCH_VERSION 0)
86set(ALIROOT_VERSION "${ALIROOT_MAJOR_VERSION}.${ALIROOT_MINOR_VERSION}.${ALIROOT_PATCH_VERSION}")
87
88set(ALIROOT_LIBRARY_PROPERTIES ${ALIROOT_LIBRARY_PROPERTIES}
89 VERSION "${ALIROOT_VERSION}"
90 SOVERSION "${ALIROOT_MAJOR_VERSION}"
91 SUFFIX ".so"
92)
93
94# Set version variables
95find_program( READLINK_PROGRAM readlink)
96
97if(READLINK_PROGRAM)
98 execute_process(COMMAND readlink -f ${ALICE_ROOT}
99 COMMAND xargs svn info
100 OUTPUT_VARIABLE _svn_out)
101else(READLINK_PROGRAM)
102 execute_process(COMMAND svn info ${ALICE_ROOT}
103 OUTPUT_VARIABLE _svn_out)
104endif(READLINK_PROGRAM)
105
106string(REGEX REPLACE "^.*Revision: ([^\n]*).*$" "\\1"
107 ALIROOT_SVN_REVISION ${_svn_out})
108string(REGEX REPLACE "^.*URL: ([^\n]*).*$" "\\1"
109 ALIROOT_SVN_BRANCH ${_svn_out})
110string(REGEX REPLACE "^.*AliRoot/([^\n]*)" "\\1" ALIROOT_SVN_BRANCH ${ALIROOT_SVN_BRANCH})
111
112
113# Additional targets
114add_custom_target(check-all COMMENT "Checking coding conventions")
115message(STATUS "REVISION: ${ALIROOT_SVN_REVISION}")
116message(STATUS "BRANCH: ${ALIROOT_SVN_BRANCH}")
117
118# Delete and recreate header ARVersion Header file
119execute_process(COMMAND cmake -E remove "${CMAKE_CURRENT_BINARY_DIR}/STEER/ARVersion.h")
120configure_file(${CMAKE_CURRENT_SOURCE_DIR}/STEER/ARVersion.h.in ${CMAKE_CURRENT_BINARY_DIR}/STEER/ARVersion.h @ONLY)
121
122# Get list of enabled root features
123execute_process(COMMAND root-config --features OUTPUT_VARIABLE FEATURES)
124string(REGEX MATCH "pythia6" PYTHIA6 ${FEATURES})
125string(REGEX MATCH "pythia8" PYTHIA8 ${FEATURES})
126string(REGEX MATCH "opengl" OPENGL ${FEATURES})
127if(PYTHIA6)
128 message(STATUS "Pythia6 enabled")
129endif(PYTHIA6)
130if(PYTHIA8)
131 message(STATUS "Pythia8 enabled")
132endif(PYTHIA8)
133if(OPENGL)
134 message(STATUS "OpenGL enabled")
135endif(OPENGL)
136option (TFLUKA "Build TFluka" OFF)
137option (THYDJET "Build THydjet" OFF)
138option (SHUTTLE "Build SHUTTLE" OFF)
139
140
141add_custom_target(STEER-all)
142add_custom_target(PHOS-all)
143add_custom_target(TRD-all)
144add_custom_target(TPC-all)
145add_custom_target(ZDC-all)
146add_custom_target(MUON-all)
147add_custom_target(PMD-all)
148add_custom_target(FMD-all)
149add_custom_target(TOF-all)
150add_custom_target(ITS-all)
151add_custom_target(ACORDE-all)
152add_custom_target(HMPID-all)
153add_custom_target(T0-all)
154add_custom_target(BCM-all)
155add_custom_target(STRUCT-all)
156add_custom_target(EVGEN-all)
157add_custom_target(RALICE-all)
158add_custom_target(VZERO-all)
159add_custom_target(THijing-all)
160add_custom_target(THbtp-all)
161add_custom_target(EMCAL-all)
162add_custom_target(THerwig-all)
163add_custom_target(TEPEMGEN-all)
164add_custom_target(FASTSIM-all)
165add_custom_target(TPHIC-all)
166add_custom_target(RAW-all)
167add_custom_target(MONITOR-all)
168add_custom_target(ANALYSIS-all)
169add_custom_target(JETAN-all)
170add_custom_target(HLT-all)
171add_custom_target(LHC-all)
172add_custom_target(ESDCheck-all)
173add_custom_target(STAT-all)
174add_custom_target(TTherminator-all)
175add_custom_target(CORRFW-all)
176add_custom_target(DPMJET-all)
177add_custom_target(TDPMjet-all)
178add_custom_target(PWG0-all)
179add_custom_target(PWG1-all)
180add_custom_target(PWG2-all)
181add_custom_target(PWG3-all)
182add_custom_target(PWG4-all)
183add_custom_target(TRIGGER-all)
184add_custom_target(TUHKMgen-all)
185add_custom_target(EPOS-all)
186add_custom_target(PYTHIA8-all)
187add_custom_target(EVE-all)
188add_custom_target(TFluka-all)
189add_custom_target(THydjet-all)
190add_custom_target(SHUTTLE-all)
191add_custom_target(LHAPDF-all)
192add_custom_target(HIJING-all)
193add_custom_target(MICROCERN-all)
194add_custom_target(HERWIG-all)
195add_custom_target(PYTHIA6-all)
196add_custom_target(ALIROOT-all)
197
198set(MODULES STEER PHOS TRD TPC ZDC MUON PMD FMD TOF ITS ACORDE HMPID T0 BCM STRUCT EVGEN RALICE VZERO THijing THbtp EMCAL THerwig TEPEMGEN FASTSIM TPHIC RAW MONITOR ANALYSIS JETAN HLT LHC ESDCheck STAT TTherminator CORRFW DPMJET TDPMjet PWG0 PWG1 PWG2 PWG3 PWG4 TRIGGER TUHKMgen EPOS)
199
200# Recurse into the given subdirectories. This does not actually
201# cause another cmake executable to run. The same process will walk through
202# the project's entire directory structure.
203Add_subdirectory(STEER)
204Add_subdirectory(PHOS)
205Add_subdirectory(TRD)
206Add_subdirectory(TPC)
207Add_subdirectory(ZDC)
208Add_subdirectory(MUON)
209Add_subdirectory(PMD)
210Add_subdirectory(FMD)
211Add_subdirectory(TOF)
212Add_subdirectory(ITS)
213Add_subdirectory(ACORDE)
214Add_subdirectory(HMPID)
215Add_subdirectory(T0)
216Add_subdirectory(BCM)
217Add_subdirectory(STRUCT)
218Add_subdirectory(EVGEN)
219Add_subdirectory(RALICE)
220Add_subdirectory(VZERO)
221Add_subdirectory(THijing)
222Add_subdirectory(THbtp)
223Add_subdirectory(EMCAL)
224Add_subdirectory(THerwig)
225Add_subdirectory(TEPEMGEN)
226Add_subdirectory(FASTSIM)
227Add_subdirectory(TPHIC)
228Add_subdirectory(RAW)
229Add_subdirectory(MONITOR)
230Add_subdirectory(ANALYSIS)
231Add_subdirectory(JETAN)
232Add_subdirectory(HLT)
233Add_subdirectory(LHC)
234Add_subdirectory(ESDCheck)
235Add_subdirectory(STAT)
236Add_subdirectory(TTherminator)
237Add_subdirectory(CORRFW)
238Add_subdirectory(DPMJET)
239Add_subdirectory(TDPMjet)
240Add_subdirectory(PWG0)
241Add_subdirectory(PWG1)
242Add_subdirectory(PWG2)
243Add_subdirectory(PWG3)
244Add_subdirectory(PWG4)
245Add_subdirectory(TRIGGER)
246Add_subdirectory(TUHKMgen)
247Add_subdirectory(EPOS)
248if(PYTHIA8)
249Add_subdirectory(PYTHIA8)
250list(APPEND MODULES PYTHIA8)
251endif(PYTHIA8)
252if(OPENGL)
253Add_subdirectory(EVE)
254list(APPEND MODULES EVE)
255endif(OPENGL)
256if(TFLUKA)
257Add_subdirectory(TFluka)
258list(APPEND MODULES TFluka)
259endif(TFLUKA)
260if(THYDJET)
261Add_subdirectory(THydjet)
262list(APPEND MODULES THydjet)
263endif(THYDJET)
264if(SHUTTLE)
265Add_subdirectory(SHUTTLE)
266list(APPEND MODULES SHUTTLE)
267endif(SHUTTLE)
268Add_subdirectory(LHAPDF)
269Add_subdirectory(HIJING)
270Add_subdirectory(MICROCERN)
271Add_subdirectory(HERWIG)
272list(APPEND MODULES LHAPDF HIJING MICROCERN HERWIG)
273if(PYTHIA6)
274Add_subdirectory(PYTHIA6)
275list(APPEND MODULES PYTHIA6)
276endif(PYTHIA6)
277Add_subdirectory(ALIROOT)
278add_subdirectory(test)
279add_test ("Aliroot_executable" aliroot -q)
280#copy testing files
281configure_file("CTestCustom.ctest" "${PROJECT_BINARY_DIRECTORY}" COPYONLY)
282
283if(DA)
284include(cmakeDA)
285endif(DA)