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