-# -*- mode: cmake -*-
-
-# Check if cmake has the required version
-Cmake_Minimum_Required(VERSION 2.6 FATAL_ERROR)
-
-# Set name of our project to AliRoot. To be done after check of cmake version
-Project(AliRoot NONE)
-
-# Set AliRoot variables
-Set(ALICE_ROOT $ENV{ALICE_ROOT})
-Set(ALICE $ENV{ALICE})
-Set(ALICE_STATIC_BUILD ON CACHE BOOL "Build also statics libs")
-
-#Set(CMAKE_VERBOSE_MAKEFILE ON)
-
-# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/
-Set(CMAKE_MODULE_PATH "${ALICE_ROOT}/cmake/modules")
-
-# To fix a hack that has been introduced for the Mac
-If(APPLE)
- Set(CMAKE_INSTALL_NAME_TOOL CMAKE_INSTALL_NAME_TOOL-NOTFOUND)
-Endif(APPLE)
-
-
-# Setup ROOT
-Find_package(ROOT 5.0.0 REQUIRED)
-
-Set(CMAKE_C_COMPILER $ENV{CC})
-Enable_Language(C)
-
-Set(CMAKE_CXX_COMPILER $ENV{CXX})
-Enable_Language(CXX)
-
-Set(CMAKE_Fortran_COMPILER $ENV{F77})
-Enable_Language(Fortran)
-
-# Load some basic macros which are needed later on
-#Include(WriteConfigFile)
-Include(Dart)
-Include(ALICEMacros)
-
-# Check if the user wants to build the project in the source directory
-Check_out_of_Source_Build()
-
-# searches for needed packages
-
-Set(ALIROOT_INSTALL_DIR ${ALICE_ROOT}/${ALICE_TARGET})
-
-# Setup GEANT3
-Find_package(GEANT3 REQUIRED)
-
-# Setup RuleChecker
-Find_Package(RuleChecker)
-
-# Check if DATE is installed
-Find_Package(DATE)
-
-# Setup system dependent flags
-SetupSystem()
-
-# Set the library version in the main CMakeLists.txt
-SET(ALIROOT_MAJOR_VERSION 0)
-SET(ALIROOT_MINOR_VERSION 0)
-SET(ALIROOT_PATCH_VERSION 0)
-SET(ALIROOT_VERSION "${ALIROOT_MAJOR_VERSION}.${ALIROOT_MINOR_VERSION}.${ALIROOT_PATCH_VERSION}")
-SET(ALIROOT_LIBRARY_PROPERTIES ${ALIROOT_LIBRARY_PROPERTIES}
- VERSION "${ALIROOT_VERSION}"
- SOVERSION "${ALIROOT_MAJOR_VERSION}"
- SUFFIX ".so"
-)
-
-# Set version variables
-Execute_process(COMMAND readlink -f ${ALICE_ROOT}
- COMMAND xargs svn info
- OUTPUT_VARIABLE _svn_out)
-
-String(REGEX REPLACE "^.*Revision: ([^\n]*).*$" "\\1"
- ALIROOT_SVN_REVISION ${_svn_out})
-String(REGEX REPLACE "^.*URL: https://alisoft.cern.ch/AliRoot/([^\n]*).*$" "w \\1"
- ALIROOT_SVN_BRANCH ${_svn_out})
-
-# Additional targets
-Add_Custom_Target(check-all COMMENT "Checking coding conventions")
-
-# Configure special include file
-If(UNIX)
- Set(_in ${CMAKE_CURRENT_SOURCE_DIR}/STEER/ARVersion.h.in)
- Set(_out ${CMAKE_CURRENT_BINARY_DIR}/STEER/ARVersion.h)
- Add_custom_target(ARversion ALL
- COMMAND sed < ${_in}
- -e "s/\\@ALIROOT_SVN_REVISION\\@/${ALIROOT_SVN_REVISION}/"
- -e "s/\\@ALIROOT_SVN_BRANCH\\@/${ALIROOT_SVN_BRANCH}/"
- -e "s/\\@ALIROOT_VERSION\\@/${ALIROOT_VERSION}/" > ${_out})
- Install(FILES ${_out} DESTINATION ${ALIROOT_INSTALL_DIR}/include)
-Endif(UNIX)
-
-# This would work, but just once... we want this to happen at every make
-# Configure_file(${CMAKE_CURRENT_SOURCE_DIR}/STEER/ARVersion.h.in
-#${CMAKE_CURRENT_BINARY_DIR}/STEER/ARVersion.h @ONLY)
-
-# Recurse into the given subdirectories. This does not actually
-# cause another cmake executable to run. The same process will walk through
-# the project's entire directory structure.
-
-#Add_subdirectory(PYTHIA8)
-#Add_subdirectory(TFluka)
-#Add_subdirectory(THydjet)
-
-Add_subdirectory(ACORDE)
-Add_subdirectory(ANALYSIS)
-Add_subdirectory(BCM)
-Add_subdirectory(CORRFW)
-Add_subdirectory(DPMJET)
-Add_subdirectory(EMCAL)
-Add_subdirectory(ESDCheck)
-Add_subdirectory(EVE)
-Add_subdirectory(EVGEN)
-Add_subdirectory(FASTSIM)
-Add_subdirectory(FMD)
-Add_subdirectory(HBTAN)
-Add_subdirectory(HERWIG)
-Add_subdirectory(HIJING)
-Add_subdirectory(HLT)
-Add_subdirectory(HMPID)
-Add_subdirectory(ITS)
-Add_subdirectory(JETAN)
-Add_subdirectory(LHAPDF)
-Add_subdirectory(LHC)
-Add_subdirectory(MICROCERN)
-Add_subdirectory(MONITOR)
-Add_subdirectory(MUON)
-Add_subdirectory(PHOS)
-Add_subdirectory(PMD)
-Add_subdirectory(PWG0)
-Add_subdirectory(PWG1)
-Add_subdirectory(PWG2)
-Add_subdirectory(PWG3)
-Add_subdirectory(PWG4)
-Add_subdirectory(PYTHIA6)
-Add_subdirectory(RALICE)
-Add_subdirectory(RAW)
-Add_subdirectory(STAT)
-Add_subdirectory(STEER)
-Add_subdirectory(STRUCT)
-Add_subdirectory(T0)
-Add_subdirectory(TDPMjet)
-Add_subdirectory(TEPEMGEN)
-Add_subdirectory(THbtp)
-Add_subdirectory(THerwig)
-Add_subdirectory(THijing)
-Add_subdirectory(TIsajet)
-Add_subdirectory(TOF)
-Add_subdirectory(TPC)
-Add_subdirectory(TPHIC)
-Add_subdirectory(TRD)
-Add_subdirectory(TTherminator)
-Add_subdirectory(VZERO)
-Add_subdirectory(ZDC)
-
-Add_subdirectory(ALIROOT)
-
+# **************************************************************************
+# * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
+# * *
+# * Author: The ALICE Off-line Project. *
+# * Contributors are mentioned in the code where appropriate. *
+# * *
+# * Permission to use, copy, modify and distribute this software and its *
+# * documentation strictly for non-commercial purposes is hereby granted *
+# * without fee, provided that the above copyright notice appears in all *
+# * copies and that both the copyright notice and this permission notice *
+# * appear in the supporting documentation. The authors make no claims *
+# * about the suitability of this software for any purpose. It is *
+# * provided "as is" without express or implied warranty. *
+# **************************************************************************
+
+#--------------------------------------------------------------------------#
+# Set Basic CMake Configuration #
+#--------------------------------------------------------------------------#
+
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
+
+project(AliRoot CXX C)
+
+# Path to additonal modules
+set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
+
+# - CLANG_MAJOR.CLANG_MINOR or
+# - GCC_MAJOR.GCC_MINOR.GCC_PATCH
+include(CheckCompiler)
+
+# ROOT dictionaries and maps
+include(CMakeALICE)
+
+# ROOT configuration mandatory
+if(ROOTSYS)
+ find_package(ROOT REQUIRED)
+
+ # ROOT must be build with XML2 support
+ if(ROOT_HASXML STREQUAL "no")
+ message(FATAL_ERROR "ROOT was not build with xml2 support. Please reinstall or rebuild ROOT with xml2 support")
+ endif(ROOT_HASXML STREQUAL "no")
+else()
+ message(FATAL_ERROR "ROOT installation not found!\nPlease point to the ROOT installation using -DROOTSYS=ROOT_INSTALL_DIR")
+endif(ROOTSYS)
+
+# If no Fortran, i.e on Windows
+# We need to specify ROOT fortran
+# (f95 comes before gfortran in default module)
+include(CheckLanguage)
+
+if(ROOT_FORTRAN)
+ message(STATUS "Using the Fortran compiler defined by ROOT configuration: ${ROOT_FORTRAN}")
+ set(CMAKE_Fortran_COMPILER ${ROOT_FORTRAN})
+else()
+ message(STATUS "Using default system Fortran compiler")
+endif(ROOT_FORTRAN)
+
+check_language(Fortran)
+if(CMAKE_Fortran_COMPILER)
+ enable_language(Fortran OPTIONAL)
+else()
+ message("No Fortran support. Disabling LHAPDF, PHYTIA6, MICROCERN")
+endif()
+
+
+# DATE
+find_package(DATE)
+
+# FastJet
+find_package(FASTJET)
+
+# AliRoot version extracted from Git repository
+# Sets 4 git variables
+# - GIT_REFSPEC - complete name of the current reference
+# - ALIROOT_BRANCH - name of the branch or tag extracted from the current reference
+# - GIT_SHA1 - current hash in the long format
+# - GIT_SHORT_SHA1 - current hash in the short format
+include(CheckGitVersion)
+
+message(STATUS "CMake platform: ${CMAKE_SYSTEM}")
+message(STATUS "Build folder: ${AliRoot_BINARY_DIR}")
+message(STATUS "Source folder: ${AliRoot_SOURCE_DIR}")
+message(STATUS "Installation folder: ${CMAKE_INSTALL_PREFIX}")
+
+
+# AliRoot modules
+add_subdirectory(STEER)
+add_subdirectory(STAT)
+add_subdirectory(OADB)
+add_subdirectory(ANALYSIS)
+add_subdirectory(RAW)
+add_subdirectory(JETAN)
+add_subdirectory(ITS)
+add_subdirectory(TPC)
+add_subdirectory(VZERO)
+add_subdirectory(T0)
+add_subdirectory(TOF)
+add_subdirectory(TRD)
+add_subdirectory(ZDC)
+add_subdirectory(STRUCT)
+add_subdirectory(HMPID)
+add_subdirectory(PMD)
+add_subdirectory(MUON)
+add_subdirectory(FMD)
+add_subdirectory(ACORDE)
+add_subdirectory(EMCAL)
+add_subdirectory(PHOS)
+add_subdirectory(TRIGGER)
+add_subdirectory(BCM)
+add_subdirectory(CORRFW)
+add_subdirectory(FASTSIM)
+if(CMAKE_Fortran_COMPILER)
+ add_subdirectory(LHAPDF)
+ add_subdirectory(PYTHIA6)
+ add_subdirectory(MICROCERN)
+endif(CMAKE_Fortran_COMPILER)
+add_subdirectory(EVGEN)
+add_subdirectory(TUHKMgen)
+add_subdirectory(TTherminator)
+add_subdirectory(TPHIC)
+add_subdirectory(THydjet)
+# Include Vc own cmake
+include(Vc/Vc.cmake)
+add_subdirectory(Vc)
+add_subdirectory(HLT)
+add_subdirectory(STARLIGHT)
+add_subdirectory(EVE)
\ No newline at end of file