]> git.uio.no Git - u/mrichter/AliRoot.git/blame - CMakeLists.txt
RAW + ROOT map including ROOT libs
[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
cbd58b9c 20cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
e969a926 21
d50827fc 22project(AliRoot CXX C)
bf4c2121 23
d50827fc 24# If no Fortran, i.e on Windows
25include(CheckLanguage)
26check_language(Fortran)
27if(CMAKE_Fortran_COMPILER)
28 enable_language(Fortran OPTIONAL)
29else()
30 message("No Fortran support. Disabling LHAPDF, PHYTIA6, MICROCERN")
6a8ffaaa 31endif()
6db31708 32
d50827fc 33# Path to additonal modules
f72dcc4f 34set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
d50827fc 35include(CMakeALICE)
6db31708 36
d50827fc 37# ROOT configuration mandatory
38if(ROOTSYS)
39 find_package(ROOT REQUIRED)
234c484d 40
41 # ROOT must be build with XML2 support
42 if(ROOT_HASXML STREQUAL "no")
43 message(FATAL_ERROR "ROOT was not build with xml2 support. Please reinstall or rebuild ROOT with xml2 support")
44 endif(ROOT_HASXML STREQUAL "no")
d50827fc 45else()
46 message(FATAL_ERROR "ROOT installation not found!\nPlease point to the ROOT installation using -DROOTSYS=ROOT_INSTALL_DIR")
47endif(ROOTSYS)
6db31708 48
d50827fc 49# Configure ARVerion.h using Git informatiion
d37e8011 50# Sets 3 git variables
51# - GIT_REFSPEC - complete name of the current reference
52# - ALIROOT_BRANCH - name of the branch or tag extracted from the current reference
53# - GIT_SHA1 - current hash in the long format
54# - GIT_SHORT_SHA1 - current hash in the short format
0492edf5 55if(EXISTS ${PROJECT_SOURCE_DIR}/.git/)
d50827fc 56 include(GetGitRevisionDescription)
57
58 find_package(Git)
59
60 if(GIT_FOUND)
61 get_git_head_revision(GIT_REFSPEC GIT_SHA1)
62
63 # GIT_REFSPEC is empty for detached mode = tags in detached mode or checkout to specific hash
64
65 # returns the closest reference to the current hash
66 # name of the current tag or heads/branch in the case of branches
67 git_describe(ALIROOT_GIT_TAG "--all" "--abbrev=0")
68
69 STRING(REGEX REPLACE "^(.+/)(.+)/(.*)$" "\\2" BRANCH_TYPE "${GIT_REFSPEC}" )
70
71 # the revision is not set in the case of a branch, it means we are doing development
72 # and the revision will trigger a reconfiguration
73 if(BRANCH_TYPE STREQUAL "heads")
74 set(ALIROOT_REVISION "ThisIsaBranchNoRevisionProvided")
75 STRING(REGEX REPLACE "^(.+/)(.+/)(.*)$" "\\3" SHORT_BRANCH "${GIT_REFSPEC}" )
76 else()
77 set(SHORT_BRANCH ${ALIROOT_GIT_TAG})
78 set(ALIROOT_REVISION ${GIT_SHA1})
79 endif()
80
81 set(ALIROOT_BRANCH ${SHORT_BRANCH})
d37e8011 82
d50827fc 83 # generate the short version of the revision hash
84 execute_process(COMMAND git rev-parse --short ${GIT_SHA1}
d37e8011 85 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
86 OUTPUT_STRIP_TRAILING_WHITESPACE
87 RESULT_VARIABLE res
88 OUTPUT_VARIABLE GIT_SHORT_SHA1)
89
d50827fc 90 # if the rev-parse fails we set the short sha to the long initial one
91 if(NOT res EQUAL 0)
92 set(GIT_SHORT_SHA1 ${GIT_SHA1})
93 endif()
d37e8011 94
d50827fc 95 message(STATUS "Aliroot branch/tag: \"${ALIROOT_BRANCH}\" - Revision: \"${GIT_SHORT_SHA1}\" ")
0492edf5 96
d50827fc 97 else()
98 message(STATUS "Git not installed. I can't tell you which revision you are using!")
99 endif(GIT_FOUND)
0492edf5 100else()
d50827fc 101 message("AliRoot sources not downloaded from a Version Control System. I can't tell which revision you are using!")
0492edf5
A
102endif(EXISTS ${PROJECT_SOURCE_DIR}/.git/)
103
d50827fc 104configure_file(${PROJECT_SOURCE_DIR}/cmake/ARVersion.h.tmp ${CMAKE_BINARY_DIR}/version/ARVersion.h @ONLY)
105install(FILES ${PROJECT_BINARY_DIR}/version/ARVersion.h DESTINATION include)
0492edf5
A
106
107string (REPLACE "-" "." ALIROOT_BRANCH_SPEC "${ALIROOT_BRANCH}")
6db31708 108
d50827fc 109message(STATUS "CMake platform: ${CMAKE_SYSTEM}")
110message(STATUS "Build folder: ${AliRoot_BINARY_DIR}")
111message(STATUS "Source folder: ${AliRoot_SOURCE_DIR}")
112message(STATUS "Installation folder: ${CMAKE_INSTALL_PREFIX}")
113
114
115# AliRoot modules
116add_subdirectory (STEER)
22f3e2f8 117add_subdirectory (STAT)
615f3d04 118add_subdirectory (OADB)
7205bde1 119add_subdirectory (ANALYSIS)
a0f34e87 120add_subdirectory (RAW)
d50827fc 121#add_subdirectory (ITS)
122#add_subdirectory (TPC)
123#add_subdirectory (VZERO)
124#add_subdirectory (T0)
125#add_subdirectory (TOF)
126#add_subdirectory (TRD)
127#add_subdirectory (ZDC)
128#add_subdirectory (STRUCT)
129#add_subdirectory (HMPID)
130#add_subdirectory (PMD)
131#add_subdirectory (MUON)
132#add_subdirectory (FMD)
133#add_subdirectory (ACORDE)
134#add_subdirectory (EMCAL)
135#add_subdirectory (PHOS)
136#add_subdirectory (TRIGGER)
137#add_subdirectory (BCM)
138#add_subdirectory (CORRFW)
139#add_subdirectory (FASTSIM)
140#if(CMAKE_Fortran_COMPILER_WORKS)
141# add_subdirectory (LHAPDF)
142# add_subdirectory (PYTHIA6)
143# add_subdirectory (MICROCERN)
144#endif(CMAKE_Fortran_COMPILER_WORKS)
145#add_subdirectory (EVGEN)
146#add_subdirectory (TUHKMgen)
147#add_subdirectory (TTherminator)
148#add_subdirectory (TPHIC)
149#add_subdirectory (THydjet)
150#add_subdirectory (PWG)
151#add_subdirectory (Vc)
152#add_subdirectory (HLT)