]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - CMakeLists.txt
TENDER becomes Tender, removing .so
[u/mrichter/AliRoot.git] / CMakeLists.txt
index f363c47ec2fc86787e5098a104d9fa8e56add489..ea522245a931309e400b0166f31d80c5de74829b 100644 (file)
 # Set Basic CMake Configuration                                            #
 #--------------------------------------------------------------------------#
 
-cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.11 FATAL_ERROR)
 
 project(AliRoot CXX C)
 
+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}")
+
+if(CMAKE_INSTALL_PREFIX STREQUAL "${AliRoot_SOURCE_DIR}")
+    message(FATAL_ERROR "Please choose a different installation point than the source tree!")
+endif()
+
 # Path to additonal modules
-set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
+set(CMAKE_MODULE_PATH "${AliRoot_SOURCE_DIR}/cmake")
+
+# 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
+#  - ALIROOT_VERSION = ALIROOT_BRANCH
+#  - ALIROOT_REVISION = GIT_SHORT_SHA1
+include(CheckGitVersion)
 
 #       - CLANG_MAJOR.CLANG_MINOR or
 #       - GCC_MAJOR.GCC_MINOR.GCC_PATCH
 include(CheckCompiler)
 
+# You can change the build type using 
+# cmake -DCMAKE_BUILD_TYPE=DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL...
+if (NOT CMAKE_BUILD_TYPE)
+  set(CMAKE_BUILD_TYPE RELWITHDEBINFO)
+endif(NOT CMAKE_BUILD_TYPE)
+
 # ROOT dictionaries and maps
 include(CMakeALICE)
 
+# Checking first for DIM, DATE, AMORE and daqDA 
+# in case ROOT Extra static library needs to be enabled
+
+# DATE
+# date-config needs DIMDIR and ODIR set
+if(DATE_CONFIG)
+    if(DIMDIR AND ODIR)
+        find_package(DATE)
+    else()
+        message(FATAL_ERROR "DATE enabled but no DIMDIR and ODIR set. Please set DIMDIR and ODIR")
+    endif()
+endif()
+
+# daqDA
+if(daqDA)
+    find_package(daqDA)
+endif(daqDA)
+
+# AMORE
+if(AMORE_CONFIG)
+    if(ROOTSYS)
+        find_package(AMORE)
+    else()
+        message(FATAL_ERROR "AMORE enabled but no ROOTSYS defined")
+    endif()
+endif(AMORE_CONFIG)
+
+# DA is enabled
+if(DA)
+    if(NOT DIMDIR AND NOT ODIR)
+        set(DA FALSE)
+        message(FATAL_ERROR "Das enabled but no DIMDIR and ODIR set. Please set DIMDIR to DIM installation and ODIR to platform (default linux)")
+    endif()
+
+    if(NOT DATE_FOUND)
+        set(DA FALSE)
+        message(FATAL_ERROR "DAs enabled but no DATE support found. Please point to your date installation using \"DATE_CONFIG\" variable")
+    endif()
+
+    if(NOT daqDA_FOUND)
+        set(DA FALSE)
+        message(FATAL_ERROR "DAs enabled but no daqDA support found. Please point to your daqDA installation using \"daqDA\" variable")
+    endif()
+
+    if(NOT AMORE_FOUND)
+        set(DA FALSE)
+        message(FATAL_ERROR "DAs enabled but no AMORE support found. Please point to your AMORE installation using \"AMORE_CONFIG\" variable")
+    endif()
+    
+    # Enable static libraries
+    set(ALIROOT_STATIC TRUE)
+    message(STATUS "DAs enabled")
+endif(DA)
+
+# MDC rpm creation enables the static build
+if(MDCRPM)
+    set(ALIROOT_STATIC TRUE)
+    message(STATUS "AliMDC RPM enabled. AliRoot static build enabled")
+endif(MDCRPM)
+
 # ROOT configuration mandatory
 if(ROOTSYS)
     find_package(ROOT REQUIRED)
 
     # ROOT must be build with XML2 support
-    if(ROOT_HASXML STREQUAL "no")
+    if(NOT ROOT_HASXML)
         message(FATAL_ERROR "ROOT was not build with xml2 support. Please reinstall or rebuild ROOT with xml2 support")
-    endif(ROOT_HASXML STREQUAL "no")
+    endif(NOT ROOT_HASXML)
 else()
     message(FATAL_ERROR "ROOT installation not found!\nPlease point to the ROOT installation using -DROOTSYS=ROOT_INSTALL_DIR")
 endif(ROOTSYS)
@@ -59,70 +144,138 @@ check_language(Fortran)
 if(CMAKE_Fortran_COMPILER)
     enable_language(Fortran OPTIONAL)
 else()
-    message("No Fortran support. Disabling LHAPDF, PHYTIA6, MICROCERN")
+    message(STATUS "No Fortran support. Disabling LHAPDF, PHYTIA6, MICROCERN, etc.")
 endif()
 
-
 # DATE
-find_package(DATE)
+if(DATE_CONFIG)
+    find_package(DATE)
+endif(DATE_CONFIG)
+
+# daqDA
+if(daqDA)
+    find_package(daqDA)
+endif(daqDA)
+
+# DA is enabled
+if(DA)
+    if(NOT DATE_FOUND)
+        set(DA FALSE)
+        message(FATAL_ERROR "DAs enabled but no DATE support found. Please point to your date installation using \"DATE_CONFIG\"")
+    endif()
+    
+    if(NOT daqDA_FOUND)
+        set(DA FALSE)
+        message(FATAL_ERROR "DAs enabled but no daqDA support found. Please point to your daqDA installation using \"daqDA\" variable")
+    endif()
+    
+    # Enable static libraries
+    set(ALIROOT_STATIC TRUE)
+    message(STATUS "DAs enabled")
+endif(DA)
 
 # 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)
+# ZEROMQ
+find_package(ZeroMQ)
 
-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}")
+# General flags -> Should be moved into a configuration file
+set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
+set(CMAKE_NO_SYSTEM_FROM_IMPORTED TRUE)
 
-
-# AliRoot modules
+# AliRoot base modules
 add_subdirectory(STEER)
-add_subdirectory(STAT)
-add_subdirectory(OADB)
-add_subdirectory(ANALYSIS)
 add_subdirectory(RAW)
-add_subdirectory(JETAN)
+add_subdirectory(ANALYSIS)
+
+# Include Vc own cmake
+include(Vc/Vc.cmake)
+add_subdirectory(Vc)
+
+# AliRoot modules
+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(TPC)
-add_subdirectory(VZERO)
+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(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)
+add_subdirectory(TTherminator)
+add_subdirectory(VZERO)
+add_subdirectory(ZDC)
+
+# Fortran modules
 if(CMAKE_Fortran_COMPILER)
+  add_subdirectory(DIME)
+  add_subdirectory(DPMJET)
+  add_subdirectory(HERWIG)
+  add_subdirectory(HIJING)
   add_subdirectory(LHAPDF)
-  add_subdirectory(PYTHIA6)
   add_subdirectory(MICROCERN)
-  add_subdirectory(TUHKMgen)
+  add_subdirectory(PYTHIA6)
+  add_subdirectory(TEPEMGEN)
+  add_subdirectory(THbtp)
+  add_subdirectory(THijing)
   add_subdirectory(THydjet)
   add_subdirectory(TPHIC)
-  add_subdirectory(THbtp)
+  add_subdirectory(TUHKMgen)
+  add_subdirectory(TAmpt)
 endif(CMAKE_Fortran_COMPILER)
-add_subdirectory(EVGEN)
-add_subdirectory(TTherminator)
-# Include Vc own cmake
-include(Vc/Vc.cmake)
-add_subdirectory(Vc)
-add_subdirectory(HLT)
-add_subdirectory(STARLIGHT)
-add_subdirectory(EVE)
+
+# PWG libraries
+add_subdirectory(PWG)
+add_subdirectory(PWGCF)
+# Depends on PWGCF - To fix dependencies
+add_subdirectory(PWGGA)
+# Depends on CF  - To fix the dependencies
+add_subdirectory(PWGDQ)
+add_subdirectory(PWGHF)
+# Depends on CF
+add_subdirectory(PWGJE)
+add_subdirectory(PWGLF)
+add_subdirectory(PWGPP)
+add_subdirectory(PWGUD)
+add_subdirectory(data)
+
+# Enable SHUTTLE compilation
+# Check if DIMDIR and ODIR are set
+if(SHUTTLE)
+    if(ROOT_HASALIEN STREQUAL "no")
+       message(FATAL_ERROR "Shuttle needs ROOT build with AliEn support. Please build ROOT with AliEn support. Do not forget to set ALIEN to your AliEn installation")
+    endif()
+    
+    if(DIMDIR AND ODIR AND ALIEN)
+        add_subdirectory(SHUTTLE)
+    else()
+        message(FATAL_ERROR "SHUTTLE enabled! Please specify DIMDIR, ODIR and ALIEN")
+    endif()
+endif(SHUTTLE)
+
+add_subdirectory(ALIROOT)
\ No newline at end of file