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