]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - CMakeLists.txt
Removing the lib files
[u/mrichter/AliRoot.git] / CMakeLists.txt
index 093466ee2f9c28dea987e8429bf5e1a9f1dc2262..cf7b8bfaf8b7569f19e72fb4c72abe97aa7221af 100644 (file)
-# -*- mode: cmake -*-
-
-# Check if cmake has the required version
-cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
-
-# Set name of our project to AliRoot. To be done after check of cmake version
-project(AliRoot NONE)
-
-# Set AliRoot variables
-
-set(ALICE_INSTALL $ENV{ALICE_INSTALL})
-set(ALICE_ROOT $ENV{ALICE_ROOT})
-set(ALICE_STATIC_BUILD OFF CACHE BOOL "Build also statics libs")
-execute_process(COMMAND root-config --arch OUTPUT_VARIABLE ALICE_TARGET)
-string (REGEX REPLACE "\n" "" ALICE_TARGET ${ALICE_TARGET})
-
-if(NOT ALICE_INSTALL)
-message(FATAL_ERROR "Please set environment variable ALICE_INSTALL to the AliRoot installation directory")
-endif(NOT ALICE_INSTALL)
-if(NOT ALICE_ROOT)
-message(FATAL_ERROR "Please set environment variable ALICE_ROOT to the AliRoot source directory")
-endif(NOT ALICE_ROOT)
-
-
-message("ALICE_ROOT: ${ALICE_ROOT}")
-set(CMAKE_VERBOSE_MAKEFILE ON)
-
-# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ 
-set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin/tgt_${ALICE_TARGET})
-set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib/tgt_${ALICE_TARGET})
-set(CMAKE_MODULE_PATH "${ALICE_ROOT}/cmake/modules")
-
-# To fix a hack that has been introduced for the Mac
-if(APPLE)
-  set(CMAKE_INSTALL_NAME_TOOL CMAKE_INSTALL_NAME_TOOL-NOTFOUND)
-endif(APPLE)
-
-# Setup ROOT and C, C++ , Fortran Compilers
-find_package(ROOT 5.0.0 REQUIRED)
-set(CMAKE_C_COMPILER $ENV{CC})
-enable_language(C)
-set(CMAKE_CXX_COMPILER $ENV{CXX})
-enable_language(CXX)
-set(CMAKE_Fortran_COMPILER $ENV{F77})
-enable_language(Fortran)
-
-# Load some basic macros which are needed later on
-#Include(WriteConfigFile)
-
-include (CTest)
-include(ALICEMacros)
-
-# Check if the user wants to build the project in the source directory
-Check_out_of_Source_Build()
-
-# searches for needed packages
-
-Set(ALIROOT_INSTALL_DIR ${ALICE_INSTALL}/${ALICE_TARGET})
-
-# Setup GEANT3
-find_package(GEANT3)
-
-# Setup RuleChecker
-find_package(RuleChecker)
-
-# Check if DATE is installed
+# **************************************************************************
+# * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
+# *                                                                        *
+# * Author: The ALICE Off-line Project.                                    *
+# * Contributors are mentioned in the code where appropriate.              *
+# *                                                                        *
+# * Permission to use, copy, modify and distribute this software and its   *
+# * documentation strictly for non-commercial purposes is hereby granted   *
+# * without fee, provided that the above copyright notice appears in all   *
+# * copies and that both the copyright notice and this permission notice   *
+# * appear in the supporting documentation. The authors make no claims     *
+# * about the suitability of this software for any purpose. It is          *
+# * provided "as is" without express or implied warranty.                  *
+# **************************************************************************
+
+#--------------------------------------------------------------------------#
+# Set Basic CMake Configuration                                            #
+#--------------------------------------------------------------------------#
+
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
+
+project(AliRoot CXX C)
+
+# 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
+if(ROOTSYS)
+    find_package(ROOT REQUIRED)
+
+    # ROOT must be build with XML2 support
+    if(ROOT_HASXML STREQUAL "no")
+        message(FATAL_ERROR "ROOT was not build with xml2 support. Please reinstall or rebuild ROOT with xml2 support")
+    endif(ROOT_HASXML STREQUAL "no")
+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")
+endif()
+
+
+# DATE
 find_package(DATE)
 
-# Setup system dependent flags 
-SetupSystem()
-
-Include(CreateSubCMakeFiles)
-CreateSubCMakeFiles()
-
-
-# Set the library version in the main CMakeLists.txt
-
-set(ALIROOT_MAJOR_VERSION 0)
-set(ALIROOT_MINOR_VERSION 0)
-set(ALIROOT_PATCH_VERSION 0)
-set(ALIROOT_VERSION "${ALIROOT_MAJOR_VERSION}.${ALIROOT_MINOR_VERSION}.${ALIROOT_PATCH_VERSION}")
-
-set(ALIROOT_LIBRARY_PROPERTIES ${ALIROOT_LIBRARY_PROPERTIES}
-    VERSION "${ALIROOT_VERSION}"
-    SOVERSION "${ALIROOT_MAJOR_VERSION}"
-    SUFFIX ".so"
-)
-
-# Set version variables
-find_program( READLINK_PROGRAM readlink)
-
-if(READLINK_PROGRAM) 
-  execute_process(COMMAND readlink -f ${ALICE_ROOT} 
-    COMMAND xargs svn info
-    OUTPUT_VARIABLE _svn_out)
-else(READLINK_PROGRAM)
-  execute_process(COMMAND svn info ${ALICE_ROOT} 
-    OUTPUT_VARIABLE _svn_out)
-endif(READLINK_PROGRAM)
-
-string(REGEX REPLACE "^.*Revision: ([^\n]*).*$" "\\1" 
-  ALIROOT_SVN_REVISION ${_svn_out})
-string(REGEX REPLACE "^.*URL: ([^\n]*).*$" "\\1"
-  ALIROOT_SVN_BRANCH ${_svn_out})
-string(REGEX REPLACE "^.*AliRoot/([^\n]*)" "\\1" ALIROOT_SVN_BRANCH ${ALIROOT_SVN_BRANCH})
-
-
-# Additional targets
-add_custom_target(check-all COMMENT "Checking coding conventions")
-message(STATUS "REVISION: ${ALIROOT_SVN_REVISION}")
-message(STATUS "BRANCH: ${ALIROOT_SVN_BRANCH}")
-
-# Delete and recreate header ARVersion Header file 
-execute_process(COMMAND cmake -E remove "${CMAKE_CURRENT_BINARY_DIR}/STEER/ARVersion.h")
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/STEER/ARVersion.h.in ${CMAKE_CURRENT_BINARY_DIR}/STEER/ARVersion.h @ONLY)
-
-# Get list of enabled root features
-execute_process(COMMAND root-config --features OUTPUT_VARIABLE FEATURES)
-string(REGEX MATCH "pythia6" PYTHIA6 ${FEATURES})
-string(REGEX MATCH "pythia8" PYTHIA8 ${FEATURES})
-string(REGEX MATCH "opengl" OPENGL ${FEATURES})
-if(PYTHIA6)
-  message(STATUS "Pythia6 enabled")
-endif(PYTHIA6)
-if(PYTHIA8)
-  message(STATUS "Pythia8 enabled")
-endif(PYTHIA8)
-if(OPENGL)
-  message(STATUS "OpenGL enabled")     
-endif(OPENGL)  
-option (TFLUKA "Build TFluka" OFF)
-option (THYDJET "Build THydjet" OFF)
-option (SHUTTLE "Build SHUTTLE" OFF)
-
-       
-# Recurse into the given subdirectories.  This does not actually
-# cause another cmake executable to run.  The same process will walk through
-# the project's entire directory structure.
-Add_subdirectory(ACORDE) 
-Add_subdirectory(ANALYSIS) 
-Add_subdirectory(BCM) 
-Add_subdirectory(CORRFW) 
-Add_subdirectory(DPMJET) 
-Add_subdirectory(EMCAL) 
-Add_subdirectory(EPOS) 
-Add_subdirectory(ESDCheck) 
-if(OPENGL)
-Add_subdirectory(EVE) 
-endif(OPENGL)
-Add_subdirectory(EVGEN) 
-Add_subdirectory(FASTSIM) 
-Add_subdirectory(FMD)
-Add_subdirectory(HERWIG) 
-Add_subdirectory(HIJING) 
-Add_subdirectory(HLT) 
-Add_subdirectory(HMPID) 
-Add_subdirectory(ITS) 
-Add_subdirectory(JETAN)
-Add_subdirectory(LHAPDF) 
-Add_subdirectory(LHC) 
-Add_subdirectory(MICROCERN) 
-Add_subdirectory(MONITOR) 
-Add_subdirectory(MUON) 
-Add_subdirectory(PHOS) 
-Add_subdirectory(PMD) 
-Add_subdirectory(PWG0) 
-Add_subdirectory(PWG1) 
-Add_subdirectory(PWG2) 
-Add_subdirectory(PWG3) 
-Add_subdirectory(PWG4)
-if(PYTHIA6)
-Add_subdirectory(PYTHIA6)
-Add_subdirectory(RALICE) 
-Add_subdirectory(TPHIC) 
-endif(PYTHIA6)
-if(PYTHIA8)
-Add_subdirectory(PYTHIA8) 
-endif(PYTHIA8)
-Add_subdirectory(RAW) 
-if(SHUTTLE)
-Add_subdirectory(SHUTTLE)
-endif(SHUTTLE) 
-Add_subdirectory(STAT) 
-Add_subdirectory(STEER)
-Add_subdirectory(STRUCT) 
-Add_subdirectory(T0) 
-Add_subdirectory(TDPMjet) 
-Add_subdirectory(TEPEMGEN) 
-Add_subdirectory(THbtp) 
-Add_subdirectory(THerwig) 
-Add_subdirectory(THijing)
-if(TFLUKA)
-Add_subdirectory(TFluka)
-endif(TFLUKA)
-if(THYDJET)    
-Add_subdirectory(THydjet)
-endif(THYDJET)
-Add_subdirectory(TOF) 
-Add_subdirectory(TPC)
-Add_subdirectory(TRD) 
-Add_subdirectory(TRIGGER) 
-Add_subdirectory(TTherminator) 
-Add_subdirectory(TUHKMgen) 
-Add_subdirectory(VZERO) 
-Add_subdirectory(ZDC) 
-Add_subdirectory(ALIROOT)
-add_subdirectory(test)
-add_test ("Aliroot_executable" aliroot -q) 
-#copy testing files
-configure_file("CTestCustom.cmake" "${CTEST_BINARY_DIRECTORY}" COPYONLY)
-execute_process(COMMAND "cmake" "-E" "copy_directory" "${ALICE_ROOT}/test" "${ALICE_INSTALL}/test")
-
-message("Note : In order for the warnings test to execute successfully you need to log your make build output to make.log in the ALICE_INSTALL Directory using this command \n make -k > make.log 2>&1")
+# 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)
+
+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}")
+
+
+# AliRoot modules
+add_subdirectory(STEER)
+add_subdirectory(STAT)
+add_subdirectory(OADB)
+add_subdirectory(ANALYSIS)
+add_subdirectory(RAW)
+add_subdirectory(JETAN)
+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)
+  add_subdirectory(LHAPDF)
+  add_subdirectory(PYTHIA6)
+  add_subdirectory(MICROCERN)
+endif(CMAKE_Fortran_COMPILER)
+add_subdirectory(EVGEN)
+add_subdirectory(TUHKMgen)
+add_subdirectory(TTherminator)
+add_subdirectory(TPHIC)
+add_subdirectory(THydjet)
+# Include Vc own cmake
+include(Vc/Vc.cmake)
+add_subdirectory(Vc)
+add_subdirectory(HLT)
+add_subdirectory(STARLIGHT)
+add_subdirectory(EVE)
\ No newline at end of file