X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=CMakeLists.txt;h=dcff1c0a86deabf6ea6df7604f84187bba6e8cad;hb=72017ac833ae45077b25f1a886bb927468ca87be;hp=7e1b94496a4a7cd398c5f1ba16587c74eef01f88;hpb=73ba6874383113e781fdb75dcac129389f052e4e;p=u%2Fmrichter%2FAliRoot.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e1b94496a4..dcff1c0a86d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,17 +21,14 @@ cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR) project(AliRoot CXX C) -# If no Fortran, i.e on Windows -include(CheckLanguage) -check_language(Fortran) -if(CMAKE_Fortran_COMPILER) - enable_language(Fortran OPTIONAL) -else() - message("No Fortran support. Disabling LHAPDF, PHYTIA6, MICROCERN") -endif() - # 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 @@ -46,68 +43,42 @@ 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, etc.") +endif() + + # DATE find_package(DATE) -# Configure ARVerion.h using Git informatiion -# Sets 3 git variables +# FastJet +find_package(FASTJET) + +# ZEROMQ +find_package(ZeroMQ) + +# 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 -if(EXISTS ${PROJECT_SOURCE_DIR}/.git/) - include(GetGitRevisionDescription) - - find_package(Git) - - if(GIT_FOUND) - get_git_head_revision(GIT_REFSPEC GIT_SHA1) - - # GIT_REFSPEC is empty for detached mode = tags in detached mode or checkout to specific hash - - # returns the closest reference to the current hash - # name of the current tag or heads/branch in the case of branches - git_describe(ALIROOT_GIT_TAG "--all" "--abbrev=0") - - STRING(REGEX REPLACE "^(.+/)(.+)/(.*)$" "\\2" BRANCH_TYPE "${GIT_REFSPEC}" ) - - # the revision is not set in the case of a branch, it means we are doing development - # and the revision will trigger a reconfiguration - if(BRANCH_TYPE STREQUAL "heads") - set(ALIROOT_REVISION "ThisIsaBranchNoRevisionProvided") - STRING(REGEX REPLACE "^(.+/)(.+/)(.*)$" "\\3" SHORT_BRANCH "${GIT_REFSPEC}" ) - else() - set(SHORT_BRANCH ${ALIROOT_GIT_TAG}) - set(ALIROOT_REVISION ${GIT_SHA1}) - endif() - - set(ALIROOT_BRANCH ${SHORT_BRANCH}) - - # generate the short version of the revision hash - execute_process(COMMAND git rev-parse --short ${GIT_SHA1} - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - OUTPUT_STRIP_TRAILING_WHITESPACE - RESULT_VARIABLE res - OUTPUT_VARIABLE GIT_SHORT_SHA1) - - # if the rev-parse fails we set the short sha to the long initial one - if(NOT res EQUAL 0) - set(GIT_SHORT_SHA1 ${GIT_SHA1}) - endif() - - message(STATUS "Aliroot branch/tag: \"${ALIROOT_BRANCH}\" - Revision: \"${GIT_SHORT_SHA1}\" ") - - else() - message(STATUS "Git not installed. I can't tell you which revision you are using!") - endif(GIT_FOUND) -else() - message("AliRoot sources not downloaded from a Version Control System. I can't tell which revision you are using!") -endif(EXISTS ${PROJECT_SOURCE_DIR}/.git/) - -configure_file(${PROJECT_SOURCE_DIR}/cmake/ARVersion.h.tmp ${CMAKE_BINARY_DIR}/version/ARVersion.h @ONLY) -install(FILES ${PROJECT_BINARY_DIR}/version/ARVersion.h DESTINATION include) - -string (REPLACE "-" "." ALIROOT_BRANCH_SPEC "${ALIROOT_BRANCH}") +include(CheckGitVersion) message(STATUS "CMake platform: ${CMAKE_SYSTEM}") message(STATUS "Build folder: ${AliRoot_BINARY_DIR}") @@ -115,41 +86,76 @@ message(STATUS "Source folder: ${AliRoot_SOURCE_DIR}") message(STATUS "Installation folder: ${CMAKE_INSTALL_PREFIX}") +# AliRoot base modules +add_subdirectory(STEER) +add_subdirectory(RAW) +add_subdirectory(ANALYSIS) + +# Include Vc own cmake +include(Vc/Vc.cmake) +add_subdirectory(Vc) + # AliRoot modules -add_subdirectory (STEER) -add_subdirectory (STAT) -add_subdirectory (OADB) -add_subdirectory (ANALYSIS) -add_subdirectory (RAW) -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_WORKS) -# add_subdirectory (LHAPDF) -# add_subdirectory (PYTHIA6) -# add_subdirectory (MICROCERN) -#endif(CMAKE_Fortran_COMPILER_WORKS) -#add_subdirectory (EVGEN) -#add_subdirectory (TUHKMgen) -#add_subdirectory (TTherminator) -#add_subdirectory (TPHIC) -#add_subdirectory (THydjet) -#add_subdirectory (PWG) -#add_subdirectory (Vc) -#add_subdirectory (HLT) +add_subdirectory(ACORDE) +add_subdirectory(AD) +add_subdirectory(BCM) +add_subdirectory(CORRFW) +add_subdirectory(EMCAL) +add_subdirectory(EPOS) +add_subdirectory(EVE) +add_subdirectory(EVGEN) +add_subdirectory(FASTSIM) +add_subdirectory(FIT) +add_subdirectory(FMD) +add_subdirectory(HLT) +add_subdirectory(HMPID) +add_subdirectory(ITS) +add_subdirectory(JETAN) +add_subdirectory(MFT) +add_subdirectory(MONITOR) +add_subdirectory(MUON) +add_subdirectory(OADB) +add_subdirectory(PHOS) +add_subdirectory(PMD) +add_subdirectory(PYTHIA8) +add_subdirectory(STARLIGHT) +add_subdirectory(STAT) +add_subdirectory(STRUCT) +add_subdirectory(T0) +add_subdirectory(TDPMjet) +add_subdirectory(TEvtGen) +add_subdirectory(THerwig) +add_subdirectory(TOF) +add_subdirectory(TPC) +add_subdirectory(TRD) +add_subdirectory(TRIGGER) +add_subdirectory(TTherminator) +add_subdirectory(VZERO) +add_subdirectory(ZDC) + +# Fortran modules +if(CMAKE_Fortran_COMPILER) + add_subdirectory(HERWIG) + add_subdirectory(HIJING) + add_subdirectory(LHAPDF) + add_subdirectory(MICROCERN) + add_subdirectory(PYTHIA6) + add_subdirectory(TEPEMGEN) + add_subdirectory(THbtp) + add_subdirectory(THijing) + add_subdirectory(THydjet) + add_subdirectory(TPHIC) + add_subdirectory(TUHKMgen) + add_subdirectory(TAmpt) + add_subdirectory(DIME) +endif(CMAKE_Fortran_COMPILER) + +# Enable SHUTTLE compilation +# Check if DIMDIR and ODIR are set +if(SHUTTLE) + if(DIMDIR AND ODIR AND ALIEN) + add_subdirectory(SHUTTLE) + else() + message(FATAL_ERROR "SHUTTLE enabled! Please specify DIMDIR, ODIR and ALIEN") + endif() +endif(SHUTTLE)