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}")
+
+# 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)
+message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
+
+
+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 "${AliRoot_SOURCE_DIR}/cmake")
# - 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)
+# Utility to generate PARfiles
+include(cmake/GenParFile.cmake)
-# ROOT dictionaries and maps
-include(CMakeALICE)
+# Shared library suffix
+if (NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
+ set(CMAKE_SHARED_LIBRARY_SUFFIX .so)
+endif (NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
# Checking first for DIM, DATE, AMORE and daqDA
# in case ROOT Extra static library needs to be enabled
endif()
endif(AMORE_CONFIG)
+# id DARPM we enable DA if it is not set
+if(DARPM)
+ if(NOT DA)
+ set(DA ON)
+ endif(NOT DA)
+endif(DARPM)
+
# DA is enabled
if(DA)
if(NOT DIMDIR AND NOT ODIR)
endif(MDCRPM)
# ROOT configuration mandatory
+# FindRoot has to be after the enabling of DA due to libRootExtra
+# Do not put it above DA
if(ROOTSYS)
find_package(ROOT REQUIRED)
message(FATAL_ERROR "ROOT installation not found!\nPlease point to the ROOT installation using -DROOTSYS=ROOT_INSTALL_DIR")
endif(ROOTSYS)
+# ROOT dictionaries and maps
+include(CMakeALICE)
+
+
# If no Fortran, i.e on Windows
# We need to specify ROOT fortran
# (f95 comes before gfortran in default module)
message(STATUS "No Fortran support. Disabling LHAPDF, PHYTIA6, MICROCERN, etc.")
endif()
-# 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)
+# Optional: Doxygen for reference doc generation
+find_package(Doxygen)
+if(DOXYGEN_FOUND AND DOXYGEN_DOT_FOUND)
+ message(STATUS "Doxygen ${DOXYGEN_VERSION} and Graphviz found: ${DOXYGEN_EXECUTABLE}, ${DOXYGEN_DOT_EXECUTABLE}")
+ set(CAN_GENERATE_DOC TRUE)
+else()
+ message(STATUS "Doxygen and Graphviz not found. Disabling support for documentation generation")
+endif(DOXYGEN_FOUND AND DOXYGEN_DOT_FOUND)
# FastJet
find_package(FASTJET)
# 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}")
+# Generating the AliRoot-config.cmake file
+configure_file(${PROJECT_SOURCE_DIR}/cmake/AliRoot-config.cmake.in ${CMAKE_BINARY_DIR}/version/AliRoot-config.cmake @ONLY)
+install(FILES ${PROJECT_BINARY_DIR}/version/AliRoot-config.cmake DESTINATION etc)
# General flags -> Should be moved into a configuration file
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
set(CMAKE_NO_SYSTEM_FROM_IMPORTED TRUE)
+# List of modules for which PARfiles are enabled -- use the cache as global scope and clean it
+set(ALIPARFILES "" CACHE INTERNAL "ALIPARFILES" FORCE)
+
# AliRoot base modules
add_subdirectory(STEER)
add_subdirectory(RAW)
include(Vc/Vc.cmake)
add_subdirectory(Vc)
+# AliRoot common macros
+add_subdirectory(macros)
+
# 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(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(TTherminator)
add_subdirectory(VZERO)
add_subdirectory(ZDC)
+add_subdirectory(doxygen)
# Fortran modules
if(CMAKE_Fortran_COMPILER)
add_subdirectory(TAmpt)
endif(CMAKE_Fortran_COMPILER)
-# 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)
+add_subdirectory(GRP)
+add_subdirectory(OCDB)
+add_subdirectory(QAref)
# 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()
add_subdirectory(ALIROOT)
-# Data
-add_subdirectory(data)
\ No newline at end of file
+# List modules with PARfiles
+string(REPLACE ";" " " ALIPARFILES_FLAT "${ALIPARFILES}")
+message(STATUS "PARfile target enabled for the following modules: ${ALIPARFILES_FLAT}")