Revision = short SHA1
[u/mrichter/AliRoot.git] / CMakeLists.txt
CommitLineData
d50827fc 1# **************************************************************************
2# * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
3# * *
4# * Author: The ALICE Off-line Project. *
5# * Contributors are mentioned in the code where appropriate. *
6# * *
7# * Permission to use, copy, modify and distribute this software and its *
8# * documentation strictly for non-commercial purposes is hereby granted *
9# * without fee, provided that the above copyright notice appears in all *
10# * copies and that both the copyright notice and this permission notice *
11# * appear in the supporting documentation. The authors make no claims *
12# * about the suitability of this software for any purpose. It is *
13# * provided "as is" without express or implied warranty. *
14# **************************************************************************
15
16#--------------------------------------------------------------------------#
17# Set Basic CMake Configuration #
18#--------------------------------------------------------------------------#
e969a926 19
139cbc46 20cmake_minimum_required(VERSION 2.8.11 FATAL_ERROR)
e969a926 21
d50827fc 22project(AliRoot CXX C)
bf4c2121 23
d50827fc 24# Path to additonal modules
f72dcc4f 25set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
b22a7396 26
27# - CLANG_MAJOR.CLANG_MINOR or
28# - GCC_MAJOR.GCC_MINOR.GCC_PATCH
29include(CheckCompiler)
30
31# ROOT dictionaries and maps
d50827fc 32include(CMakeALICE)
6db31708 33
f82bfa66 34# Checking first for DIM, DATE, AMORE and daqDA
35# in case ROOT Extra static library needs to be enabled
36
37# DATE
ec8c8ea6 38# date-config needs DIMDIR and ODIR set
f82bfa66 39if(DATE_CONFIG)
ec8c8ea6 40 if(DIMDIR AND ODIR)
41 find_package(DATE)
42 else()
43 message(FATAL_ERROR "DATE enabled but no DIMDIR and ODIR set. Please set DIMDIR and ODIR")
44 endif()
45endif()
f82bfa66 46
47# daqDA
48if(daqDA)
49 find_package(daqDA)
50endif(daqDA)
51
52# AMORE
53if(AMORE_CONFIG)
ec8c8ea6 54 if(ROOTSYS)
55 find_package(AMORE)
56 else()
57 message(FATAL_ERROR "AMORE enabled but no ROOTSYS defined")
58 endif()
f82bfa66 59endif(AMORE_CONFIG)
60
61# DA is enabled
62if(DA)
63 if(NOT DIMDIR AND NOT ODIR)
64 set(DA FALSE)
65 message(FATAL_ERROR "Das enabled but no DIMDIR and ODIR set. Please set DIMDIR to DIM installation and ODIR to platform (default linux)")
66 endif()
67
68 if(NOT DATE_FOUND)
69 set(DA FALSE)
70 message(FATAL_ERROR "DAs enabled but no DATE support found. Please point to your date installation using \"DATE_CONFIG\" variable")
71 endif()
72
73 if(NOT daqDA_FOUND)
74 set(DA FALSE)
75 message(FATAL_ERROR "DAs enabled but no daqDA support found. Please point to your daqDA installation using \"daqDA\" variable")
76 endif()
77
78 if(NOT AMORE_FOUND)
79 set(DA FALSE)
80 message(FATAL_ERROR "DAs enabled but no AMORE support found. Please point to your AMORE installation using \"AMORE_CONFIG\" variable")
81 endif()
82
83 # Enable static libraries
84 set(ALIROOT_STATIC TRUE)
85 message(STATUS "DAs enabled")
86endif(DA)
87
d50827fc 88# ROOT configuration mandatory
89if(ROOTSYS)
90 find_package(ROOT REQUIRED)
234c484d 91
92 # ROOT must be build with XML2 support
4d31eb1c 93 if(NOT ROOT_HASXML)
234c484d 94 message(FATAL_ERROR "ROOT was not build with xml2 support. Please reinstall or rebuild ROOT with xml2 support")
7d1be1d5 95 endif(NOT ROOT_HASXML)
d50827fc 96else()
97 message(FATAL_ERROR "ROOT installation not found!\nPlease point to the ROOT installation using -DROOTSYS=ROOT_INSTALL_DIR")
98endif(ROOTSYS)
6db31708 99
1dbe1076 100# If no Fortran, i.e on Windows
101# We need to specify ROOT fortran
102# (f95 comes before gfortran in default module)
103include(CheckLanguage)
104
105if(ROOT_FORTRAN)
106 message(STATUS "Using the Fortran compiler defined by ROOT configuration: ${ROOT_FORTRAN}")
107 set(CMAKE_Fortran_COMPILER ${ROOT_FORTRAN})
108else()
109 message(STATUS "Using default system Fortran compiler")
110endif(ROOT_FORTRAN)
111
112check_language(Fortran)
113if(CMAKE_Fortran_COMPILER)
114 enable_language(Fortran OPTIONAL)
115else()
f82bfa66 116 message(STATUS "No Fortran support. Disabling LHAPDF, PHYTIA6, MICROCERN, etc.")
1dbe1076 117endif()
118
119
56966a5e 120# DATE
f82bfa66 121if(DATE_CONFIG)
122 find_package(DATE)
123endif(DATE_CONFIG)
124
125# daqDA
126if(daqDA)
127 find_package(daqDA)
128endif(daqDA)
129
130# DA is enabled
131if(DA)
132 if(NOT DATE_FOUND)
133 set(DA FALSE)
134 message(FATAL_ERROR "DAs enabled but no DATE support found. Please point to your date installation using \"DATE_CONFIG\"")
135 endif()
136
137 if(NOT daqDA_FOUND)
138 set(DA FALSE)
139 message(FATAL_ERROR "DAs enabled but no daqDA support found. Please point to your daqDA installation using \"daqDA\" variable")
140 endif()
141
142 # Enable static libraries
143 set(ALIROOT_STATIC TRUE)
144 message(STATUS "DAs enabled")
145endif(DA)
56966a5e 146
b5576c4e 147# FastJet
148find_package(FASTJET)
149
3c77e1ef 150# ZEROMQ
151find_package(ZeroMQ)
152
b22a7396 153# AliRoot version extracted from Git repository
154# Sets 4 git variables
d37e8011 155# - GIT_REFSPEC - complete name of the current reference
156# - ALIROOT_BRANCH - name of the branch or tag extracted from the current reference
157# - GIT_SHA1 - current hash in the long format
158# - GIT_SHORT_SHA1 - current hash in the short format
b22a7396 159include(CheckGitVersion)
6db31708 160
d50827fc 161message(STATUS "CMake platform: ${CMAKE_SYSTEM}")
162message(STATUS "Build folder: ${AliRoot_BINARY_DIR}")
163message(STATUS "Source folder: ${AliRoot_SOURCE_DIR}")
164message(STATUS "Installation folder: ${CMAKE_INSTALL_PREFIX}")
165
4d31eb1c 166# General flags -> Should be moved into a configuration file
167set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
139cbc46 168set(CMAKE_NO_SYSTEM_FROM_IMPORTED TRUE)
d50827fc 169
63697604 170# AliRoot base modules
17f9c1f8 171add_subdirectory(STEER)
17f9c1f8 172add_subdirectory(RAW)
63697604 173add_subdirectory(ANALYSIS)
174
175# Include Vc own cmake
176include(Vc/Vc.cmake)
177add_subdirectory(Vc)
178
179# AliRoot modules
180add_subdirectory(ACORDE)
181add_subdirectory(AD)
182add_subdirectory(BCM)
183add_subdirectory(CORRFW)
184add_subdirectory(EMCAL)
9d62600c 185add_subdirectory(EPOS)
63697604 186add_subdirectory(EVE)
187add_subdirectory(EVGEN)
188add_subdirectory(FASTSIM)
189add_subdirectory(FIT)
190add_subdirectory(FMD)
191add_subdirectory(HLT)
192add_subdirectory(HMPID)
17f9c1f8 193add_subdirectory(ITS)
63697604 194add_subdirectory(JETAN)
80afaccc 195add_subdirectory(MFT)
63697604 196add_subdirectory(MONITOR)
197add_subdirectory(MUON)
198add_subdirectory(OADB)
199add_subdirectory(PHOS)
200add_subdirectory(PMD)
a31c2f7d 201add_subdirectory(PYTHIA8)
63697604 202add_subdirectory(STARLIGHT)
203add_subdirectory(STAT)
204add_subdirectory(STRUCT)
97e8d2a8 205add_subdirectory(T0)
72017ac8 206add_subdirectory(TDPMjet)
e706c082 207add_subdirectory(TEvtGen)
16765dcc 208add_subdirectory(THerwig)
97e8d2a8 209add_subdirectory(TOF)
63697604 210add_subdirectory(TPC)
97e8d2a8 211add_subdirectory(TRD)
25f88fb9 212add_subdirectory(TRIGGER)
63697604 213add_subdirectory(TTherminator)
214add_subdirectory(VZERO)
215add_subdirectory(ZDC)
67018bf4 216
63697604 217# Fortran modules
1dbe1076 218if(CMAKE_Fortran_COMPILER)
c462af85 219 add_subdirectory(DIME)
220 add_subdirectory(DPMJET)
64609fcd 221 add_subdirectory(HERWIG)
63697604 222 add_subdirectory(HIJING)
116e4267 223 add_subdirectory(LHAPDF)
116e4267 224 add_subdirectory(MICROCERN)
63697604 225 add_subdirectory(PYTHIA6)
ba812042 226 add_subdirectory(TEPEMGEN)
27b08c46 227 add_subdirectory(THbtp)
a95d9137 228 add_subdirectory(THijing)
63697604 229 add_subdirectory(THydjet)
230 add_subdirectory(TPHIC)
231 add_subdirectory(TUHKMgen)
9b863d49 232 add_subdirectory(TAmpt)
1dbe1076 233endif(CMAKE_Fortran_COMPILER)
67018bf4 234
67018bf4 235# Enable SHUTTLE compilation
236# Check if DIMDIR and ODIR are set
237if(SHUTTLE)
238 if(DIMDIR AND ODIR AND ALIEN)
239 add_subdirectory(SHUTTLE)
240 else()
241 message(FATAL_ERROR "SHUTTLE enabled! Please specify DIMDIR, ODIR and ALIEN")
242 endif()
243endif(SHUTTLE)
034aa4b3 244
245add_subdirectory(ALIROOT)