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