]>
Commit | Line | Data |
---|---|---|
e969a926 | 1 | # -*- mode: cmake -*- |
e969a926 | 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 | |
f7d3fd75 | 7 | Project(AliRoot NONE) |
e969a926 | 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 | ||
f7d3fd75 | 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 | ||
e969a926 | 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 | ||
e969a926 | 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 | |
6455495f | 73 | Find_program( READLINK_PROGRAM readlink) |
74 | ||
75 | If(READLINK_PROGRAM) | |
76 | Execute_process(COMMAND readlink -f ${ALICE_ROOT} | |
77 | COMMAND xargs svn info | |
78 | OUTPUT_VARIABLE _svn_out) | |
79 | Else(READLINK_PROGRAM) | |
80 | Execute_process(COMMAND svn info ${ALICE_ROOT} | |
81 | OUTPUT_VARIABLE _svn_out) | |
82 | Endif(READLINK_PROGRAM) | |
e969a926 | 83 | |
84 | String(REGEX REPLACE "^.*Revision: ([^\n]*).*$" "\\1" | |
85 | ALIROOT_SVN_REVISION ${_svn_out}) | |
86 | String(REGEX REPLACE "^.*URL: https://alisoft.cern.ch/AliRoot/([^\n]*).*$" "w \\1" | |
87 | ALIROOT_SVN_BRANCH ${_svn_out}) | |
249caf77 | 88 | String(REPLACE "/" "\\\\/" |
89 | ALIROOT_SVN_BRANCH ${ALIROOT_SVN_BRANCH}) | |
e969a926 | 90 | |
91 | # Additional targets | |
92 | Add_Custom_Target(check-all COMMENT "Checking coding conventions") | |
93 | ||
94 | # Configure special include file | |
95 | If(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) | |
104 | Endif(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 | ||
118 | Add_subdirectory(ACORDE) | |
119 | Add_subdirectory(ANALYSIS) | |
120 | Add_subdirectory(BCM) | |
121 | Add_subdirectory(CORRFW) | |
122 | Add_subdirectory(DPMJET) | |
123 | Add_subdirectory(EMCAL) | |
124 | Add_subdirectory(ESDCheck) | |
125 | Add_subdirectory(EVE) | |
126 | Add_subdirectory(EVGEN) | |
127 | Add_subdirectory(FASTSIM) | |
128 | Add_subdirectory(FMD) | |
e969a926 | 129 | Add_subdirectory(HERWIG) |
130 | Add_subdirectory(HIJING) | |
131 | Add_subdirectory(HLT) | |
132 | Add_subdirectory(HMPID) | |
133 | Add_subdirectory(ITS) | |
134 | Add_subdirectory(JETAN) | |
135 | Add_subdirectory(LHAPDF) | |
136 | Add_subdirectory(LHC) | |
137 | Add_subdirectory(MICROCERN) | |
138 | Add_subdirectory(MONITOR) | |
139 | Add_subdirectory(MUON) | |
140 | Add_subdirectory(PHOS) | |
141 | Add_subdirectory(PMD) | |
142 | Add_subdirectory(PWG0) | |
143 | Add_subdirectory(PWG1) | |
144 | Add_subdirectory(PWG2) | |
145 | Add_subdirectory(PWG3) | |
146 | Add_subdirectory(PWG4) | |
147 | Add_subdirectory(PYTHIA6) | |
148 | Add_subdirectory(RALICE) | |
149 | Add_subdirectory(RAW) | |
150 | Add_subdirectory(STAT) | |
151 | Add_subdirectory(STEER) | |
152 | Add_subdirectory(STRUCT) | |
153 | Add_subdirectory(T0) | |
154 | Add_subdirectory(TDPMjet) | |
155 | Add_subdirectory(TEPEMGEN) | |
156 | Add_subdirectory(THbtp) | |
157 | Add_subdirectory(THerwig) | |
158 | Add_subdirectory(THijing) | |
ddd9c299 | 159 | #Add_subdirectory(TIsajet) |
e969a926 | 160 | Add_subdirectory(TOF) |
161 | Add_subdirectory(TPC) | |
162 | Add_subdirectory(TPHIC) | |
163 | Add_subdirectory(TRD) | |
164 | Add_subdirectory(TTherminator) | |
165 | Add_subdirectory(VZERO) | |
166 | Add_subdirectory(ZDC) | |
167 | ||
168 | Add_subdirectory(ALIROOT) | |
169 |