Container made browsable
[u/mrichter/AliRoot.git] / CMakeLists.txt
index 1a08b5d..78d5f24 100644 (file)
@@ -1,3 +1,5 @@
+# -*- mode: cmake -*-
+
 # Top level CMakeList.txt file for the AliRoot Build System
 #
 # Author: Johny Jose (johny.jose@cern.ch)
@@ -11,8 +13,14 @@ cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
 #--------------------------------------------------------------------------------#
 
 project(AliRoot CXX C Fortran)
+
+# Environment variables
 set(ALICE_ROOT $ENV{ALICE_ROOT})
 set(ALICE $ENV{ALICE})
+set(ALICE_INSTALL $ENV{ALICE_INSTALL})
+# Environment for SHUTTLE
+set(DIMDIR $ENV{DIMDIR})
+set(ODIR $ENV{ODIR})
 
 if(NOT ALICE)
   message(WARNING "Environment variable ALICE is not set")
@@ -29,6 +37,7 @@ if(NOT ALICE_INSTALL)
 else()
   message(STATUS "AliRoot files will be installed in ${ALICE_INSTALL}")
 endif(NOT ALICE_INSTALL)
+set(CMAKE_INSTALL_PREFIX ${ALICE_INSTALL})
 
 get_filename_component(PROJECT_SOURCE_DIR "${PROJECT_SOURCE_DIR}" REALPATH)
 set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
@@ -114,7 +123,7 @@ set(BINLIBDIRS "-L${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
 
 # Standard Modules
 # ------------------------------
-set(ALIROOTMODULES STEER PHOS TRD TPC ZDC MUON PMD FMD TOF ITS ACORDE HMPID T0 BCM STRUCT VZERO THijing THbtp EMCAL THerwig TEPEMGEN FASTSIM TPHIC RAW MONITOR ANALYSIS JETAN HLT LHC ESDCheck STAT TTherminator CORRFW DPMJET TDPMjet PWG0 PWG1 PWG2 PWG3 PWG4 TRIGGER PYTHIA8 )
+set(ALIROOTMODULES STEER PHOS TRD TPC ZDC MUON PMD FMD TOF ITS ACORDE HMPID T0 BCM STRUCT VZERO THijing THbtp EMCAL THerwig TEPEMGEN FASTSIM TPHIC RAW MONITOR ANALYSIS JETAN HLT LHC STAT TTherminator CORRFW DPMJET TDPMjet PWG0 PWG1 PWG2 PWG3 PWG4 TRIGGER PYTHIA8 TAmpt OADB )
 
 if(THydjet)
   list(APPEND ALIROOTMODULES THydjet)
@@ -142,8 +151,8 @@ set(CERNMODULES LHAPDF HIJING MICROCERN HERWIG)
 # Check for Pythia 6
 if(EXISTS ${ROOTINCDIR}/TPythia6.h)
   set(PYTHIA6 TRUE)
-  list(APPEND CERNMODULES PYTHIA6 RALICE EVGEN)
-else()
+  list(APPEND CERNMODULES PYTHIA6 EVGEN)
+elseif(NOT NOPYTHIA)
   message(FATAL_ERROR "ROOT must have Pythia6 enabled !")
 endif(EXISTS ${ROOTINCDIR}/TPythia6.h)
 
@@ -161,10 +170,24 @@ set(LIBS ${ROOTCLIBS} ${ROOTPLIBS} ${SYSLIBS})
 # Configure ARVerion.h
 # ------------------------------
 if(Subversion_FOUND)
+  if(EXISTS ${PROJECT_SOURCE_DIR}/.svn/ )
   Subversion_WC_INFO(${PROJECT_SOURCE_DIR} PROJECT)
   set(ALIROOT_SVN_REVISION ${PROJECT_WC_REVISION})
   set(ALIROOT_SVN_BRANCH ${PROJECT_WC_URL})
   string(REGEX MATCH "[^/]+$" ALIROOT_SVN_BRANCH ${ALIROOT_SVN_BRANCH})
+
+  elseif(EXISTS ${PROJECT_SOURCE_DIR}/.git/ )
+    execute_process(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND git svn info OUTPUT_VARIABLE OUTPUTVAR)
+    string(REPLACE "\n" ";" OUTPUTVAR ${OUTPUTVAR})
+    foreach(f ${OUTPUTVAR})
+      if(${f} MATCHES URL)
+       string(REGEX MATCH "[^/]+$" ALIROOT_SVN_BRANCH ${f})
+      elseif(${f} MATCHES Revision)
+       string(REGEX MATCH "[^: ]+$" ALIROOT_SVN_REVISION ${f})
+      endif(${f} MATCHES URL)   
+    endforeach()
+  endif(EXISTS ${PROJECT_SOURCE_DIR}/.svn/ )
+
   message(STATUS "Aliroot Revision - ${ALIROOT_SVN_REVISION} Branch - ${ALIROOT_SVN_BRANCH}")
   if(EXISTS ${CMAKE_INCLUDE_EXPORT_DIRECTORY}/ARVersion.h)
     file(REMOVE ${CMAKE_INCLUDE_EXPORT_DIRECTORY}/ARVersion.h)
@@ -188,9 +211,13 @@ set(EXPORTFILES)
 # ------------------------------
 
 add_custom_target(alilibs-static)
-add_custom_target(include-headers)
+add_custom_target(include-headers ALL)
 add_custom_target(DA-all)
-
+add_custom_target(check-all) 
+add_custom_target(check-hxml)
+add_custom_target(smell-all) 
+add_custom_target(par-all)
+add_custom_target(test-par-all)
 
 # Add Modules
 # ------------------------------
@@ -198,6 +225,8 @@ foreach(MODULE ${MODDIRS})
   set(${MODULE}ALIBS)
   configure_file(${PROJECT_SOURCE_DIR}/cmake/Module.tmp ${PROJECT_SOURCE_DIR}/${MODULE}/CMakeLists.txt @ONLY)
   add_custom_target(${MODULE}-all ALL)
+  add_custom_target(${MODULE}-par-all)
+  add_custom_target(test-${MODULE}-par-all)
   add_custom_target(${MODULE}-all-static)
   add_dependencies(alilibs-static "${MODULE}-static")
   add_subdirectory(${MODULE})
@@ -207,6 +236,15 @@ if(DATE_FOUND AND AMORE_FOUND)
   include (CMakeDA)
 endif(DATE_FOUND AND AMORE_FOUND)
 
+if(RULECHECKER_FOUND)
+    add_custom_target(factfile DEPENDS ${FACTFILE})
+    add_custom_command( OUTPUT ${FACTFILE}
+                        COMMAND ${CMAKE_COMMAND} -E echo "Re-generating factfile"
+                        COMMAND ${JAVA_RUNTIME}  -Xmx1024M -jar ${FACTEXTRACTOR_JAR} ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}                   
+                       DEPENDS check-hxml ${CMAKE_BINARY_DIR}/check-hxml-touchfile ${_factfile_deps} 
+                        WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+endif(RULECHECKER_FOUND)
+
 #--------------------------------------------------------------------------------#
 # Additional Targets                                                             #
 #--------------------------------------------------------------------------------#