Some of the coding violations corrected
[u/mrichter/AliRoot.git] / CMakeLists.txt
index 107282c..f149ca9 100644 (file)
@@ -1,10 +1,12 @@
+# -*- mode: cmake -*-
+
 # Top level CMakeList.txt file for the AliRoot Build System
 #
 # Author: Johny Jose (johny.jose@cern.ch)
 #         Port of previous Makefile build to cmake
 
 
-cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
 
 #--------------------------------------------------------------------------------#
 # Set Basic CMake Configuration                                                  #
@@ -16,6 +18,9 @@ project(AliRoot CXX C Fortran)
 set(ALICE_ROOT $ENV{ALICE_ROOT})
 set(ALICE $ENV{ALICE})
 set(ALICE_INSTALL $ENV{ALICE_INSTALL})
+if(${ALICE_INSTALL} MATCHES ${CMAKE_BINARY_DIR})
+  message(FATAL_ERROR "Install dir should be different from build dir")
+endif(${ALICE_INSTALL} MATCHES ${CMAKE_BINARY_DIR})
 # Environment for SHUTTLE
 set(DIMDIR $ENV{DIMDIR})
 set(ODIR $ENV{ODIR})
@@ -121,7 +126,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 STAT TTherminator CORRFW DPMJET TDPMjet PWG0 PWG1 PWG2 PWG3 PWG4 TRIGGER PYTHIA8 TAmpt OADB )
+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 STAT TTherminator CORRFW DPMJET TDPMjet PWG0 PWG1 PWG2 PWG3 PWG4 TRIGGER PYTHIA8 TAmpt OADB )
 
 if(THydjet)
   list(APPEND ALIROOTMODULES THydjet)
@@ -149,7 +154,7 @@ set(CERNMODULES LHAPDF HIJING MICROCERN HERWIG)
 # Check for Pythia 6
 if(EXISTS ${ROOTINCDIR}/TPythia6.h)
   set(PYTHIA6 TRUE)
-  list(APPEND CERNMODULES PYTHIA6 RALICE EVGEN)
+  list(APPEND CERNMODULES PYTHIA6 EVGEN)
 elseif(NOT NOPYTHIA)
   message(FATAL_ERROR "ROOT must have Pythia6 enabled !")
 endif(EXISTS ${ROOTINCDIR}/TPythia6.h)
@@ -209,31 +214,70 @@ 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-all) 
+add_custom_target(check-hxml)
+add_custom_target(smell-all) 
+add_custom_target(htmldoc) 
 add_custom_target(par-all)
 add_custom_target(test-par-all)
 
-# Add Modules
+#NY file(GLOB CFILES_LIST ${CMAKE_SOURCE_DIR}/macros/*.C)
+
+add_custom_command(TARGET htmldoc
+                  PRE_BUILD
+                  COMMAND mkdir -p html
+                  COMMAND rm -rf html/roothtml
+                  COMMAND rm -f html/picts
+                  COMMAND cd html &&
+                           aliroot -q -b \"mkhtml.C(0,1)\"
+                  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
+
+
+# Add Modules  
 # ------------------------------
 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}-check-all)
   add_custom_target(${MODULE}-par-all)
   add_custom_target(test-${MODULE}-par-all)
-  add_dependencies(check-all "${MODULE}-check-all")
   add_custom_target(${MODULE}-all-static)
   add_dependencies(alilibs-static "${MODULE}-static")
   add_subdirectory(${MODULE})
+  
+#NY  set(dir "${CMAKE_SOURCE_DIR}/${MODULE}")
+#NY  if (EXISTS "${dir}")
+#NY      file(GLOB CFILES_MOD ${dir}/*.C)
+#NY      list(LENGTH CFILES_MOD len)
+#NY      if (${len} GREATER 0)
+#NY        list(APPEND CFILES_LIST "${CFILES_MOD}")
+#NY      endif (${len} GREATER 0)
+#NY  endif(EXISTS "${dir}")
 endforeach(MODULE)
 
+#NY foreach(cfile ${CFILES_LIST})
+#NY     add_custom_command(TARGET htmldoc
+#NY                   PRE_BUILD
+#NY                   COMMAND cd html && 
+#NY                           aliroot -b -q \"mkhtml.C(\"${cfile}\")\" > /dev/null
+#NY                   WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
+#NY endforeach(cfile)
+
 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                                                             #
 #--------------------------------------------------------------------------------#
@@ -244,3 +288,13 @@ endif(DATE_FOUND AND AMORE_FOUND)
 include (InstallRequiredSystemLibraries)
 include (CPack)
 
+# Install data
+# ------------------------------
+install ( DIRECTORY data 
+          DESTINATION . )
+
+
+#
+# EOF
+#
+