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)
+# Shared library suffix
+if (NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
+ set(CMAKE_SHARED_LIBRARY_SUFFIX .so)
+endif (NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
+
+# ROOT configuration mandatory
+if(ROOTSYS)
+ find_package(ROOT REQUIRED)
+
+ # ROOT must be build with XML2 support
+ if(NOT ROOT_HASXML)
+ message(FATAL_ERROR "ROOT was not build with xml2 support. Please reinstall or rebuild ROOT with xml2 support")
+ 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)
# ROOT dictionaries and maps
include(CMakeALICE)
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)
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(NOT ROOT_HASXML)
- message(FATAL_ERROR "ROOT was not build with xml2 support. Please reinstall or rebuild ROOT with xml2 support")
- 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)
-
# 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()
+# 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)
+
# DATE
if(DATE_CONFIG)
find_package(DATE)
# 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)
include(Vc/Vc.cmake)
add_subdirectory(Vc)
+# AliRoot common macros
+add_subdirectory(macros)
+
# AliRoot modules
add_subdirectory(ACORDE)
add_subdirectory(AD)
add_subdirectory(TTherminator)
add_subdirectory(VZERO)
add_subdirectory(ZDC)
+add_subdirectory(doxygen)
# Fortran modules
if(CMAKE_Fortran_COMPILER)
# PWG libraries
add_subdirectory(PWG)
-# Depends on CF and LF - To fix the dependencies
+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)
-# Depends on PP - To fix depedencies
+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()