1 # **************************************************************************
2 # * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
4 # * Author: The ALICE Off-line Project. *
5 # * Contributors are mentioned in the code where appropriate. *
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 # **************************************************************************
16 #--------------------------------------------------------------------------#
17 # Set Basic CMake Configuration #
18 #--------------------------------------------------------------------------#
20 cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
22 project(AliRoot CXX C)
24 # Path to additonal modules
25 set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
27 # - CLANG_MAJOR.CLANG_MINOR or
28 # - GCC_MAJOR.GCC_MINOR.GCC_PATCH
29 include(CheckCompiler)
31 # ROOT dictionaries and maps
34 # ROOT configuration mandatory
36 find_package(ROOT REQUIRED)
38 # ROOT must be build with XML2 support
39 if(ROOT_HASXML STREQUAL "no")
40 message(FATAL_ERROR "ROOT was not build with xml2 support. Please reinstall or rebuild ROOT with xml2 support")
41 endif(ROOT_HASXML STREQUAL "no")
43 message(FATAL_ERROR "ROOT installation not found!\nPlease point to the ROOT installation using -DROOTSYS=ROOT_INSTALL_DIR")
46 # If no Fortran, i.e on Windows
47 # We need to specify ROOT fortran
48 # (f95 comes before gfortran in default module)
49 include(CheckLanguage)
52 message(STATUS "Using the Fortran compiler defined by ROOT configuration: ${ROOT_FORTRAN}")
53 set(CMAKE_Fortran_COMPILER ${ROOT_FORTRAN})
55 message(STATUS "Using default system Fortran compiler")
58 check_language(Fortran)
59 if(CMAKE_Fortran_COMPILER)
60 enable_language(Fortran OPTIONAL)
62 message("No Fortran support. Disabling LHAPDF, PHYTIA6, MICROCERN, etc.")
75 # AliRoot version extracted from Git repository
76 # Sets 4 git variables
77 # - GIT_REFSPEC - complete name of the current reference
78 # - ALIROOT_BRANCH - name of the branch or tag extracted from the current reference
79 # - GIT_SHA1 - current hash in the long format
80 # - GIT_SHORT_SHA1 - current hash in the short format
81 include(CheckGitVersion)
83 message(STATUS "CMake platform: ${CMAKE_SYSTEM}")
84 message(STATUS "Build folder: ${AliRoot_BINARY_DIR}")
85 message(STATUS "Source folder: ${AliRoot_SOURCE_DIR}")
86 message(STATUS "Installation folder: ${CMAKE_INSTALL_PREFIX}")
89 # AliRoot base modules
90 add_subdirectory(STEER)
92 add_subdirectory(ANALYSIS)
94 # Include Vc own cmake
99 add_subdirectory(ACORDE)
101 add_subdirectory(BCM)
102 add_subdirectory(CORRFW)
103 add_subdirectory(EMCAL)
104 add_subdirectory(EPOS)
105 add_subdirectory(EVE)
106 add_subdirectory(EVGEN)
107 add_subdirectory(FASTSIM)
108 add_subdirectory(FIT)
109 add_subdirectory(FMD)
110 add_subdirectory(HLT)
111 add_subdirectory(HMPID)
112 add_subdirectory(ITS)
113 add_subdirectory(JETAN)
114 add_subdirectory(MFT)
115 add_subdirectory(MONITOR)
116 add_subdirectory(MUON)
117 add_subdirectory(OADB)
118 add_subdirectory(PHOS)
119 add_subdirectory(PMD)
120 add_subdirectory(PYTHIA8)
121 add_subdirectory(STARLIGHT)
122 add_subdirectory(STAT)
123 add_subdirectory(STRUCT)
125 add_subdirectory(TEvtGen)
126 add_subdirectory(THerwig)
127 add_subdirectory(TOF)
128 add_subdirectory(TPC)
129 add_subdirectory(TRD)
130 add_subdirectory(TRIGGER)
131 add_subdirectory(TTherminator)
132 add_subdirectory(VZERO)
133 add_subdirectory(ZDC)
136 if(CMAKE_Fortran_COMPILER)
137 add_subdirectory(HERWIG)
138 add_subdirectory(HIJING)
139 add_subdirectory(LHAPDF)
140 add_subdirectory(MICROCERN)
141 add_subdirectory(PYTHIA6)
142 add_subdirectory(TEPEMGEN)
143 add_subdirectory(THbtp)
144 add_subdirectory(THijing)
145 add_subdirectory(THydjet)
146 add_subdirectory(TPHIC)
147 add_subdirectory(TUHKMgen)
148 endif(CMAKE_Fortran_COMPILER)
150 # Enable SHUTTLE compilation
151 # Check if DIMDIR and ODIR are set
153 if(DIMDIR AND ODIR AND ALIEN)
154 add_subdirectory(SHUTTLE)
156 message(FATAL_ERROR "SHUTTLE enabled! Please specify DIMDIR, ODIR and ALIEN")