]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
CMake: option to generate documentation only
authordberzano <dario.berzano@cern.ch>
Tue, 10 Feb 2015 18:40:03 +0000 (19:40 +0100)
committerdberzano <dario.berzano@cern.ch>
Tue, 10 Feb 2015 18:40:05 +0000 (19:40 +0100)
With -DDOXYGEN_ONLY=ON, cmake prepares only the doxygen target, and no
additional checks on the environment are performed. With this build
mode it is not possible to build AliRoot, but only the documentation.

CMakeLists.txt

index fcc380cb8165ccb992e3692c0375d4d2a584cafb..362eaa0410c124f711de8d1309769db4662728b8 100644 (file)
@@ -39,7 +39,7 @@ endif(NOT CMAKE_BUILD_TYPE)
 message(STATUS "Build type: ${CMAKE_BUILD_TYPE} (${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}})")
 
 if(CMAKE_INSTALL_PREFIX STREQUAL "${AliRoot_SOURCE_DIR}")
-    message(FATAL_ERROR "Please choose a different installation point than the source tree!")
+  message(FATAL_ERROR "Please choose a different installation point than the source tree!")
 endif()
 
 # Path to additonal modules
@@ -55,8 +55,8 @@ set(CMAKE_MODULE_PATH "${AliRoot_SOURCE_DIR}/cmake")
 #  - ALIROOT_REVISION = GIT_SHORT_SHA1
 include(CheckGitVersion)
 
-#       - CLANG_MAJOR.CLANG_MINOR or
-#       - GCC_MAJOR.GCC_MINOR.GCC_PATCH
+# - CLANG_MAJOR.CLANG_MINOR or
+# - GCC_MAJOR.GCC_MINOR.GCC_PATCH
 include(CheckCompiler)
 
 # Utility to generate PARfiles
@@ -67,252 +67,268 @@ 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
+# 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)
+elseif(DOXYGEN_ONLY)
+  message(FATAL_ERROR "Doxygen and Graphviz not found. Cannot generate documentation")
+else()
+  message(STATUS "Doxygen and Graphviz not found. Disabling support for documentation generation")
+endif()
+
+# Doxygen documentation is always included
+add_subdirectory(doxygen)
 
-# DATE
-# date-config needs DIMDIR and ODIR set
-# Setting variables in cache to be accesible by ccmake
-set(DATE_CONFIG CACHE STRING "date-config script location")
-set(DIMDIT CACHE STRING "dim installation folder")
-set(ODIR CACHE STRING "dim plaform, usually \"linux\"")
-if(DATE_CONFIG)
+if(DEFINED DOXYGEN_ONLY AND DOXYGEN_ONLY)
+  # In this case we do not prepare targets for the rest, but for Doxygen only.
+  # This is useful because no checks are performed, and it means that Doxygen
+  # documentation can be generated on a relatively "dumb" server that has as
+  # requirements only cmake, doxygen and graphviz.
+  message(WARNING "Preparing build for Doxygen documentation only as requested. AliRoot will not be built!")
+else()
+
+  # Standard CMake inclusions and checks if we are actually building AliRoot,
+  # i.e. not only the documentation
+
+  # 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
+  # Setting variables in cache to be accesible by ccmake
+  set(DATE_CONFIG CACHE STRING "date-config script location")
+  set(DIMDIT CACHE STRING "dim installation folder")
+  set(ODIR CACHE STRING "dim plaform, usually \"linux\"")
+  if(DATE_CONFIG)
     if(DIMDIR AND ODIR)
-        find_package(DATE)
+      find_package(DATE)
     else()
-        message(FATAL_ERROR "DATE enabled but no DIMDIR and ODIR set. Please set DIMDIR and ODIR")
+      message(FATAL_ERROR "DATE enabled but no DIMDIR and ODIR set. Please set DIMDIR and ODIR")
     endif()
-endif()
+  endif()
 
-# daqDA
-# Setting variables in cache to be accesible by ccmake
-set(daqDA CACHE STRING "daqDA library folder installation")
-if(daqDA)
+  # daqDA
+  # Setting variables in cache to be accesible by ccmake
+  set(daqDA CACHE STRING "daqDA library folder installation")
+  if(daqDA)
     find_package(daqDA)
-endif(daqDA)
+  endif(daqDA)
 
-# AMORE
-# Setting variables in cache to be accesible by ccmake
-set(AMORE_CONFIG CACHE STRING "amore-config script location")
-if(AMORE_CONFIG)
+  # AMORE
+  # Setting variables in cache to be accesible by ccmake
+  set(AMORE_CONFIG CACHE STRING "amore-config script location")
+  if(AMORE_CONFIG)
     if(ROOTSYS)
-        find_package(AMORE)
+      find_package(AMORE)
     else()
-        message(FATAL_ERROR "AMORE enabled but no ROOTSYS defined")
+      message(FATAL_ERROR "AMORE enabled but no ROOTSYS defined")
     endif()
-endif(AMORE_CONFIG)
+  endif(AMORE_CONFIG)
 
-# id DARPM we enable DA if it is not set
-# Setting variables in cache to be accesible by ccmake
-set(DARPM CACHE STRING "Enable DARPM: ON")
-set(DA CACHE STRING "Enable DA: ON")
-if(DARPM)
+  # id DARPM we enable DA if it is not set
+  # Setting variables in cache to be accesible by ccmake
+  set(DARPM CACHE STRING "Enable DARPM: ON")
+  set(DA CACHE STRING "Enable DA: ON")
+  if(DARPM)
     if(NOT DA)
-        set(DA ON)
+      set(DA ON)
     endif(NOT DA)
-endif(DARPM)
+  endif(DARPM)
 
-# DA is enabled
-# Setting variables in cache to be accesible by ccmake
-set(ALIROOT_STATIC CACHE STRING "ENABLE static building of AliRoot: ON")
-if(DA)
+  # DA is enabled
+  # Setting variables in cache to be accesible by ccmake
+  set(ALIROOT_STATIC CACHE STRING "ENABLE static building of AliRoot: ON")
+  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)")
+      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")
+      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")
+      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")
+      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)
+  endif(DA)
 
-# MDC rpm creation enables the static build
-# Setting variables in cache to be accesible by ccmake
-set(MDCRPM CACHE STRING "Enable mdc rpm build")
-if(MDCRPM)
+  # MDC rpm creation enables the static build
+  # Setting variables in cache to be accesible by ccmake
+  set(MDCRPM CACHE STRING "Enable mdc rpm build")
+  if(MDCRPM)
     set(ALIROOT_STATIC TRUE)
     message(STATUS "AliMDC RPM enabled. AliRoot static build enabled")
-endif(MDCRPM)
-
-# ROOT configuration mandatory
-# FindRoot has to be after the enabling of DA due to libRootExtra
-# Do not put it above DA
-# Setting variables in cache to be accesible by ccmake
-set(ROOTSYS CACHE STRING "ROOT installation folder")
-if(ROOTSYS)
+  endif(MDCRPM)
+
+  # ROOT configuration mandatory
+  # FindRoot has to be after the enabling of DA due to libRootExtra
+  # Do not put it above DA
+  # Setting variables in cache to be accesible by ccmake
+  set(ROOTSYS CACHE STRING "ROOT installation folder")
+  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")
+      message(FATAL_ERROR "ROOT was not build with xml2 support. Please reinstall or rebuild ROOT with xml2 support")
     endif(NOT ROOT_HASXML)
-else()
+  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(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)
-include(CheckLanguage)
+  # 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)
+  if(ROOT_FORTRAN)
     message(STATUS "Using the Fortran compiler defined by ROOT configuration: ${ROOT_FORTRAN}")
     set(CMAKE_Fortran_COMPILER ${ROOT_FORTRAN})
-else()
+  else()
     message(STATUS "Using default system Fortran compiler")
-endif(ROOT_FORTRAN)
+  endif(ROOT_FORTRAN)
 
-check_language(Fortran)
-if(CMAKE_Fortran_COMPILER)
+  check_language(Fortran)
+  if(CMAKE_Fortran_COMPILER)
     enable_language(Fortran OPTIONAL)
-else()
+  else()
     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)
-
-# FastJet
-find_package(FASTJET)
-
-# ZEROMQ
-find_package(ZeroMQ)
-
-# 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)
-add_subdirectory(ANALYSIS)
-
-# Include Vc own cmake
-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(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(MFT)
-add_subdirectory(MONITOR)
-add_subdirectory(MUON)
-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)
-add_subdirectory(doxygen)
-
-# Fortran modules
-if(CMAKE_Fortran_COMPILER)
-  add_subdirectory(DIME)
-  add_subdirectory(DPMJET)
-  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)
-endif(CMAKE_Fortran_COMPILER)
-
-add_subdirectory(data)
-add_subdirectory(GRP)
-add_subdirectory(OCDB)
-add_subdirectory(QAref)
-
-# Enable SHUTTLE compilation
-# Check if DIMDIR and ODIR are set
-# # Setting variables in cache to be accesible by ccmake
-set(SHUTTLE CACHE STRING "Enable SHUTTLE build : ON")
-if(SHUTTLE)
+  endif()
+
+  # FastJet
+  find_package(FASTJET)
+
+  # ZEROMQ
+  find_package(ZeroMQ)
+
+  # 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)
+  add_subdirectory(ANALYSIS)
+
+  # Include Vc own cmake
+  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(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(MFT)
+  add_subdirectory(MONITOR)
+  add_subdirectory(MUON)
+  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(DIME)
+    add_subdirectory(DPMJET)
+    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)
+  endif(CMAKE_Fortran_COMPILER)
+
+  add_subdirectory(data)
+  add_subdirectory(GRP)
+  add_subdirectory(OCDB)
+  add_subdirectory(QAref)
+
+  # Enable SHUTTLE compilation
+  # Check if DIMDIR and ODIR are set
+  # # Setting variables in cache to be accesible by ccmake
+  set(SHUTTLE CACHE STRING "Enable SHUTTLE build : ON")
+  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")
+      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)
+      add_subdirectory(SHUTTLE)
     else()
-        message(FATAL_ERROR "SHUTTLE enabled! Please specify DIMDIR, ODIR and ALIEN")
+      message(FATAL_ERROR "SHUTTLE enabled! Please specify DIMDIR, ODIR and ALIEN")
     endif()
-endif(SHUTTLE)
-
-add_subdirectory(ALIROOT)
-
-# List modules with PARfiles
-string(REPLACE ";" " " ALIPARFILES_FLAT "${ALIPARFILES}")
-message(STATUS "PARfile target enabled for the following modules: ${ALIPARFILES_FLAT}")
-
-# Install Find macros for common packages to be further used by AliPhysics
-install(FILES 
-           cmake/CMakeALICE.cmake
-           cmake/FindROOT.cmake
-           cmake/FindFASTJET.cmake
-           cmake/FindZeroMQ.cmake
-           cmake/GetGitRevisionDescription.cmake
-           cmake/GetGitRevisionDescription.cmake.in
-       DESTINATION cmake)
+  endif(SHUTTLE)
+
+  add_subdirectory(ALIROOT)
+
+  # List modules with PARfiles
+  string(REPLACE ";" " " ALIPARFILES_FLAT "${ALIPARFILES}")
+  message(STATUS "PARfile target enabled for the following modules: ${ALIPARFILES_FLAT}")
+
+  # Install Find macros for common packages to be further used by AliPhysics
+  install(FILES
+    cmake/CMakeALICE.cmake
+    cmake/FindROOT.cmake
+    cmake/FindFASTJET.cmake
+    cmake/FindZeroMQ.cmake
+    cmake/GetGitRevisionDescription.cmake
+    cmake/GetGitRevisionDescription.cmake.in
+    DESTINATION cmake)
+
+endif(DEFINED DOXYGEN_ONLY AND DOXYGEN_ONLY)