]> git.uio.no Git - u/mrichter/AliRoot.git/blame - CMakeLists.txt
Added workarounds for bugs #51285 and #51281: if the AliMagF instance
[u/mrichter/AliRoot.git] / CMakeLists.txt
CommitLineData
e969a926 1# -*- mode: cmake -*-
e969a926 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
f7d3fd75 7Project(AliRoot NONE)
e969a926 8
9# Set AliRoot variables
10Set(ALICE_ROOT $ENV{ALICE_ROOT})
11Set(ALICE $ENV{ALICE})
12Set(ALICE_STATIC_BUILD ON CACHE BOOL "Build also statics libs")
13
14#Set(CMAKE_VERBOSE_MAKEFILE ON)
15
16# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/
17Set(CMAKE_MODULE_PATH "${ALICE_ROOT}/cmake/modules")
18
f7d3fd75 19# To fix a hack that has been introduced for the Mac
20If(APPLE)
21 Set(CMAKE_INSTALL_NAME_TOOL CMAKE_INSTALL_NAME_TOOL-NOTFOUND)
22Endif(APPLE)
23
24
25# Setup ROOT
26Find_package(ROOT 5.0.0 REQUIRED)
27
28Set(CMAKE_C_COMPILER $ENV{CC})
29Enable_Language(C)
30
31Set(CMAKE_CXX_COMPILER $ENV{CXX})
32Enable_Language(CXX)
33
34Set(CMAKE_Fortran_COMPILER $ENV{F77})
35Enable_Language(Fortran)
36
e969a926 37# Load some basic macros which are needed later on
38#Include(WriteConfigFile)
39Include(Dart)
40Include(ALICEMacros)
41
42# Check if the user wants to build the project in the source directory
43Check_out_of_Source_Build()
44
45# searches for needed packages
46
e969a926 47Set(ALIROOT_INSTALL_DIR ${ALICE_ROOT}/${ALICE_TARGET})
48
49# Setup GEANT3
50Find_package(GEANT3 REQUIRED)
51
52# Setup RuleChecker
53Find_Package(RuleChecker)
54
55# Check if DATE is installed
56Find_Package(DATE)
57
58# Setup system dependent flags
59SetupSystem()
60
61# Set the library version in the main CMakeLists.txt
62SET(ALIROOT_MAJOR_VERSION 0)
63SET(ALIROOT_MINOR_VERSION 0)
64SET(ALIROOT_PATCH_VERSION 0)
65SET(ALIROOT_VERSION "${ALIROOT_MAJOR_VERSION}.${ALIROOT_MINOR_VERSION}.${ALIROOT_PATCH_VERSION}")
66SET(ALIROOT_LIBRARY_PROPERTIES ${ALIROOT_LIBRARY_PROPERTIES}
67 VERSION "${ALIROOT_VERSION}"
68 SOVERSION "${ALIROOT_MAJOR_VERSION}"
69 SUFFIX ".so"
70)
71
72# Set version variables
6455495f 73Find_program( READLINK_PROGRAM readlink)
74
75If(READLINK_PROGRAM)
76 Execute_process(COMMAND readlink -f ${ALICE_ROOT}
77 COMMAND xargs svn info
78 OUTPUT_VARIABLE _svn_out)
79Else(READLINK_PROGRAM)
80 Execute_process(COMMAND svn info ${ALICE_ROOT}
81 OUTPUT_VARIABLE _svn_out)
82Endif(READLINK_PROGRAM)
e969a926 83
84String(REGEX REPLACE "^.*Revision: ([^\n]*).*$" "\\1"
85 ALIROOT_SVN_REVISION ${_svn_out})
86String(REGEX REPLACE "^.*URL: https://alisoft.cern.ch/AliRoot/([^\n]*).*$" "w \\1"
87 ALIROOT_SVN_BRANCH ${_svn_out})
249caf77 88String(REPLACE "/" "\\\\/"
89 ALIROOT_SVN_BRANCH ${ALIROOT_SVN_BRANCH})
e969a926 90
91# Additional targets
92Add_Custom_Target(check-all COMMENT "Checking coding conventions")
93
94# Configure special include file
95If(UNIX)
96 Set(_in ${CMAKE_CURRENT_SOURCE_DIR}/STEER/ARVersion.h.in)
97 Set(_out ${CMAKE_CURRENT_BINARY_DIR}/STEER/ARVersion.h)
98 Add_custom_target(ARversion ALL
99 COMMAND sed < ${_in}
100 -e "s/\\@ALIROOT_SVN_REVISION\\@/${ALIROOT_SVN_REVISION}/"
101 -e "s/\\@ALIROOT_SVN_BRANCH\\@/${ALIROOT_SVN_BRANCH}/"
102 -e "s/\\@ALIROOT_VERSION\\@/${ALIROOT_VERSION}/" > ${_out})
103 Install(FILES ${_out} DESTINATION ${ALIROOT_INSTALL_DIR}/include)
104Endif(UNIX)
105
106# This would work, but just once... we want this to happen at every make
107# Configure_file(${CMAKE_CURRENT_SOURCE_DIR}/STEER/ARVersion.h.in
108#${CMAKE_CURRENT_BINARY_DIR}/STEER/ARVersion.h @ONLY)
109
110# Recurse into the given subdirectories. This does not actually
111# cause another cmake executable to run. The same process will walk through
112# the project's entire directory structure.
113
114#Add_subdirectory(PYTHIA8)
115#Add_subdirectory(TFluka)
116#Add_subdirectory(THydjet)
117
118Add_subdirectory(ACORDE)
119Add_subdirectory(ANALYSIS)
120Add_subdirectory(BCM)
121Add_subdirectory(CORRFW)
122Add_subdirectory(DPMJET)
123Add_subdirectory(EMCAL)
fe9fbf07 124Add_subdirectory(EPOS)
e969a926 125Add_subdirectory(ESDCheck)
126Add_subdirectory(EVE)
127Add_subdirectory(EVGEN)
128Add_subdirectory(FASTSIM)
129Add_subdirectory(FMD)
e969a926 130Add_subdirectory(HERWIG)
131Add_subdirectory(HIJING)
132Add_subdirectory(HLT)
133Add_subdirectory(HMPID)
134Add_subdirectory(ITS)
135Add_subdirectory(JETAN)
136Add_subdirectory(LHAPDF)
137Add_subdirectory(LHC)
138Add_subdirectory(MICROCERN)
139Add_subdirectory(MONITOR)
140Add_subdirectory(MUON)
141Add_subdirectory(PHOS)
142Add_subdirectory(PMD)
143Add_subdirectory(PWG0)
144Add_subdirectory(PWG1)
145Add_subdirectory(PWG2)
146Add_subdirectory(PWG3)
147Add_subdirectory(PWG4)
148Add_subdirectory(PYTHIA6)
149Add_subdirectory(RALICE)
150Add_subdirectory(RAW)
151Add_subdirectory(STAT)
152Add_subdirectory(STEER)
153Add_subdirectory(STRUCT)
154Add_subdirectory(T0)
155Add_subdirectory(TDPMjet)
156Add_subdirectory(TEPEMGEN)
157Add_subdirectory(THbtp)
158Add_subdirectory(THerwig)
159Add_subdirectory(THijing)
ddd9c299 160#Add_subdirectory(TIsajet)
e969a926 161Add_subdirectory(TOF)
162Add_subdirectory(TPC)
163Add_subdirectory(TPHIC)
164Add_subdirectory(TRD)
165Add_subdirectory(TTherminator)
fe9fbf07 166Add_subdirectory(TUHKMgen)
e969a926 167Add_subdirectory(VZERO)
168Add_subdirectory(ZDC)
169
170Add_subdirectory(ALIROOT)
171