]> git.uio.no Git - u/mrichter/AliRoot.git/blame - CMakeLists.txt
Moving to standard names
[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
73Execute_process(COMMAND svn info $ENV{ALICE_ROOT}
74 OUTPUT_VARIABLE _svn_out)
75
76String(REGEX REPLACE "^.*Revision: ([^\n]*).*$" "\\1"
77 ALIROOT_SVN_REVISION ${_svn_out})
78String(REGEX REPLACE "^.*URL: https://alisoft.cern.ch/AliRoot/([^\n]*).*$" "w \\1"
79 ALIROOT_SVN_BRANCH ${_svn_out})
80
81# Additional targets
82Add_Custom_Target(check-all COMMENT "Checking coding conventions")
83
84# Configure special include file
85If(UNIX)
86 Set(_in ${CMAKE_CURRENT_SOURCE_DIR}/STEER/ARVersion.h.in)
87 Set(_out ${CMAKE_CURRENT_BINARY_DIR}/STEER/ARVersion.h)
88 Add_custom_target(ARversion ALL
89 COMMAND sed < ${_in}
90 -e "s/\\@ALIROOT_SVN_REVISION\\@/${ALIROOT_SVN_REVISION}/"
91 -e "s/\\@ALIROOT_SVN_BRANCH\\@/${ALIROOT_SVN_BRANCH}/"
92 -e "s/\\@ALIROOT_VERSION\\@/${ALIROOT_VERSION}/" > ${_out})
93 Install(FILES ${_out} DESTINATION ${ALIROOT_INSTALL_DIR}/include)
94Endif(UNIX)
95
96# This would work, but just once... we want this to happen at every make
97# Configure_file(${CMAKE_CURRENT_SOURCE_DIR}/STEER/ARVersion.h.in
98#${CMAKE_CURRENT_BINARY_DIR}/STEER/ARVersion.h @ONLY)
99
100# Recurse into the given subdirectories. This does not actually
101# cause another cmake executable to run. The same process will walk through
102# the project's entire directory structure.
103
104#Add_subdirectory(PYTHIA8)
105#Add_subdirectory(TFluka)
106#Add_subdirectory(THydjet)
107
108Add_subdirectory(ACORDE)
109Add_subdirectory(ANALYSIS)
110Add_subdirectory(BCM)
111Add_subdirectory(CORRFW)
112Add_subdirectory(DPMJET)
113Add_subdirectory(EMCAL)
114Add_subdirectory(ESDCheck)
115Add_subdirectory(EVE)
116Add_subdirectory(EVGEN)
117Add_subdirectory(FASTSIM)
118Add_subdirectory(FMD)
119Add_subdirectory(HBTAN)
120Add_subdirectory(HERWIG)
121Add_subdirectory(HIJING)
122Add_subdirectory(HLT)
123Add_subdirectory(HMPID)
124Add_subdirectory(ITS)
125Add_subdirectory(JETAN)
126Add_subdirectory(LHAPDF)
127Add_subdirectory(LHC)
128Add_subdirectory(MICROCERN)
129Add_subdirectory(MONITOR)
130Add_subdirectory(MUON)
131Add_subdirectory(PHOS)
132Add_subdirectory(PMD)
133Add_subdirectory(PWG0)
134Add_subdirectory(PWG1)
135Add_subdirectory(PWG2)
136Add_subdirectory(PWG3)
137Add_subdirectory(PWG4)
138Add_subdirectory(PYTHIA6)
139Add_subdirectory(RALICE)
140Add_subdirectory(RAW)
141Add_subdirectory(STAT)
142Add_subdirectory(STEER)
143Add_subdirectory(STRUCT)
144Add_subdirectory(T0)
145Add_subdirectory(TDPMjet)
146Add_subdirectory(TEPEMGEN)
147Add_subdirectory(THbtp)
148Add_subdirectory(THerwig)
149Add_subdirectory(THijing)
150Add_subdirectory(TIsajet)
151Add_subdirectory(TOF)
152Add_subdirectory(TPC)
153Add_subdirectory(TPHIC)
154Add_subdirectory(TRD)
155Add_subdirectory(TTherminator)
156Add_subdirectory(VZERO)
157Add_subdirectory(ZDC)
158
159Add_subdirectory(ALIROOT)
160