remove extra printf
[u/mrichter/AliRoot.git] / CMakeLists.txt
CommitLineData
6db31708 1# Top level CMakeList.txt file for the AliRoot Build System
2#
3# Author: Johny Jose (johny.jose@cern.ch)
4# Port of previous Makefile build to cmake
e969a926 5
e969a926 6
6db31708 7cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
e969a926 8
6db31708 9#--------------------------------------------------------------------------------#
10# Set Basic CMake Configuration #
11#--------------------------------------------------------------------------------#
b07a2059 12
6db31708 13project(AliRoot CXX C Fortran)
7f40fabf 14set(ALICE_ROOT $ENV{ALICE_ROOT})
6db31708 15set(ALICE $ENV{ALICE})
16
17if(NOT ALICE)
18 message(WARNING "Environment variable ALICE is not set")
19endif(NOT ALICE)
3ea0d710 20
3ea0d710 21if(NOT ALICE_ROOT)
6db31708 22 message(FATAL_ERROR "Please set ALICE_ROOT to the AliRoot source directory")
3ea0d710 23endif(NOT ALICE_ROOT)
24
6db31708 25# Set AliRoot Installation directory
26if(NOT ALICE_INSTALL)
27 message(STATUS "AliRoot files will be installed in ${ALICE_ROOT}. You can specify a different location by setting ALICE_INSTALL environment variable")
28 set(ALICE_INSTALL ${ALICE_ROOT})
29else()
30 message(STATUS "AliRoot files will be installed in ${ALICE_INSTALL}")
31endif(NOT ALICE_INSTALL)
32
dad683d0 33get_filename_component(PROJECT_SOURCE_DIR "${PROJECT_SOURCE_DIR}" REALPATH)
f72dcc4f 34set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
e969a926 35
6db31708 36include(ALICE_CMake)
f2cec6fb 37
6db31708 38#--------------------------------------------------------------------------------#
39# Find Packages #
40#--------------------------------------------------------------------------------#
e969a926 41
6db31708 42# Subversion
43# ------------------------------
e969a926 44
6db31708 45find_package(Subversion REQUIRED)
f7d3fd75 46
6db31708 47# ROOT
48# ------------------------------
f7d3fd75 49
6db31708 50find_package(ROOT REQUIRED)
3ea0d710 51
6db31708 52# IRST Rule Checker
53# ------------------------------
e969a926 54
6db31708 55find_package(RuleChecker)
e969a926 56
6db31708 57# DATE
58# ------------------------------
e969a926 59
6db31708 60find_package(DATE)
e969a926 61
6db31708 62# GEANT3
63# ------------------------------
e969a926 64
6db31708 65find_package(GEANT3)
e969a926 66
6db31708 67# AMORE
68# ------------------------------
69
70find_package(AMORE)
71
72#--------------------------------------------------------------------------------#
73# Environment/Compiler Configuration #
74#--------------------------------------------------------------------------------#
75
76ALICE_CheckOutOfSourceBuild()
77ALICE_RootConfig(CMAKE_CXX_COMPILER --cxx)
78ALICE_RootConfig(CMAKE_C_COMPILER --cc)
79ALICE_RootConfig(CMAKE_Fortran_COMPILER --f77)
80ALICE_ConfigurePlatform()
81ALICE_ConfigureCompiler()
82
83
84#--------------------------------------------------------------------------------#
85# AliRoot Path Settings #
86#--------------------------------------------------------------------------------#
87
88ALICE_DevFlagsOutput()
89set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin/tgt_${ALICE_TARGET}")
90set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib/tgt_${ALICE_TARGET}")
91set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib/tgt_${ALICE_TARGET}")
92set(CMAKE_INCLUDE_EXPORT_DIRECTORY "${PROJECT_BINARY_DIR}/include")
93file(MAKE_DIRECTORY ${CMAKE_INCLUDE_EXPORT_DIRECTORY})
94set(EXPORTDIRS "${ALICE_INSTALL}/include")
95set(BINLIBDIRS "-L${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
96
97#--------------------------------------------------------------------------------#
98# AliRoot Modules #
99#--------------------------------------------------------------------------------#
100
101# Exclude Module from all target
102# ------------------------------
103
45526b5e 104#set(EXCLUDEMODULES THydjet SHUTTLE)
6db31708 105
106# Standard Modules
107# ------------------------------
45526b5e 108set(ALIROOTMODULES STEER PHOS TRD TPC ZDC MUON PMD FMD TOF ITS ACORDE HMPID T0 BCM STRUCT VZERO THijing THbtp EMCAL THerwig TEPEMGEN FASTSIM TPHIC RAW MONITOR ANALYSIS JETAN HLT LHC ESDCheck STAT TTherminator CORRFW DPMJET TDPMjet PWG0 PWG1 PWG2 PWG3 PWG4 TRIGGER PYTHIA8 )
109
110if(THydjet)
111 list(APPEND ALIROOTMODULES THydjet)
112endif(THydjet)
113
114if(SHUTTLE)
115 list(APPEND ALIROOTMODULES SHUTTLE)
116endif(SHUTTLE)
6db31708 117
118# Additional Modules
119# ------------------------------
120list(APPEND ALIROOTMODULES TUHKMgen EPOS)
121
122# EVE
123# ------------------------------
124ALICE_RootConfig(EVE --has-opengl)
125if(NOT EVE STREQUAL "no")
126 list(APPEND ALIROOTMODULES EVE)
127endif(NOT EVE STREQUAL "no")
128
129# CERN Modules
130# ------------------------------
131set(CERNMODULES LHAPDF HIJING MICROCERN HERWIG)
132
133# Check for Pythia 6
134if(EXISTS ${ROOTINCDIR}/TPythia6.h)
135 set(PYTHIA6 TRUE)
136 list(APPEND CERNMODULES PYTHIA6 RALICE EVGEN)
137else()
45526b5e 138 message(FATAL_ERROR "ROOT must have Pythia6 enabled !")
6db31708 139endif(EXISTS ${ROOTINCDIR}/TPythia6.h)
140
141# Set Final list of modules
142set(MODULES ${ALIROOTMODULES} ${CERNMODULES} ALIROOT)
143
144# Set Module directories
145set(MODDIRS ${MODULES})
146
147# Libraries for Linking
148# ------------------------------
149set(ALILIBS MUON TPC PMD TRD FMD TOF ITS PHOS ACORDE HMPID VZERO ZDC STRUCT T0 EVGEN STEER TRIGGER)
150set(LIBS ${ROOTCLIBS} ${ROOTPLIBS} ${SYSLIBS})
151
152# Configure ARVerion.h
153# ------------------------------
154if(Subversion_FOUND)
155 Subversion_WC_INFO(${PROJECT_SOURCE_DIR} PROJECT)
156 set(ALIROOT_SVN_REVISION ${PROJECT_WC_REVISION})
157 set(ALIROOT_SVN_BRANCH ${PROJECT_WC_URL})
158 string(REGEX MATCH "[^/]+$" ALIROOT_SVN_BRANCH ${ALIROOT_SVN_BRANCH})
159 message(STATUS "Aliroot Revision - ${ALIROOT_SVN_REVISION} Branch - ${ALIROOT_SVN_BRANCH}")
160 if(EXISTS ${CMAKE_INCLUDE_EXPORT_DIRECTORY}/ARVersion.h)
161 file(REMOVE ${CMAKE_INCLUDE_EXPORT_DIRECTORY}/ARVersion.h)
162 endif(EXISTS ${CMAKE_INCLUDE_EXPORT_DIRECTORY}/ARVersion.h)
163 configure_file(${PROJECT_SOURCE_DIR}/cmake/ARVersion.h.tmp ${CMAKE_INCLUDE_EXPORT_DIRECTORY}/ARVersion.h @ONLY)
164endif(Subversion_FOUND)
165
166#--------------------------------------------------------------------------------#
167# Build Modules #
168#--------------------------------------------------------------------------------#
169
170# Module Variables
171# ------------------------------
172set(ALLLIBS)
173set(ALLEXECS)
174set(INCLUDEFILES)
175set(BINLIBS)
176set(EXPORTFILES)
177
178# Top Level Build Targets
179# ------------------------------
180
181add_custom_target(alilibs-static)
182add_custom_target(include-headers)
45526b5e 183add_custom_target(DA-all)
7531a2ac 184
185
6db31708 186# Add Modules
187# ------------------------------
188foreach(MODULE ${MODDIRS})
45526b5e 189 set(${MODULE}ALIBS)
6db31708 190 configure_file(${PROJECT_SOURCE_DIR}/cmake/Module.tmp ${PROJECT_SOURCE_DIR}/${MODULE}/CMakeLists.txt @ONLY)
191 add_custom_target(${MODULE}-all ALL)
529f129e 192 add_custom_target(${MODULE}-all-static)
6db31708 193 add_dependencies(alilibs-static "${MODULE}-static")
194 add_subdirectory(${MODULE})
6db31708 195endforeach(MODULE)
196
c3b22277 197if(DATE_FOUND AND AMORE_FOUND)
198 include (CMakeDA)
199endif(DATE_FOUND AND AMORE_FOUND)
200
6db31708 201#--------------------------------------------------------------------------------#
202# Additional Targets #
203#--------------------------------------------------------------------------------#
204
7531a2ac 205# AliMdc RPM
206# ------------------------------
207
208
6db31708 209include (InstallRequiredSystemLibraries)
210include (CPack)
e969a926 211