Major Fixes which caused the normal build to crash due to the addition of the par...
authorjjose <jjose@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 9 Nov 2010 16:25:01 +0000 (16:25 +0000)
committerjjose <jjose@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 9 Nov 2010 16:25:01 +0000 (16:25 +0000)
README_CMake
cmake/ALICE_CMake.cmake
cmake/FindRuleChecker.cmake

index 63d03c5..0aa6f89 100644 (file)
@@ -47,7 +47,7 @@ eg.   make STEERbase STEERbase-static
   make check-all
   make <Module>-check-all
   make <Package>-check
-  make <Module>-<ClassName>-check
+  make <Module>-<ClassName>-check  // To use this run cmake with -DCLASSCHECK="YES" option. It is turned off by default since it bloats the Makefile and slows down the internal makefile rule checking
 
   The resulting violations will be written to the folder <Build_Directory>/<Module>/check/viols
 
@@ -55,7 +55,7 @@ eg.   make STEERbase STEERbase-static
 
   make par-all 
   make <Package>.par
-  make <Module>-par-all   build all par packages in the module
+  make <Module>-par-all   //build all par packages in the module
 
 10. To test PARs after building run
 
index 8764f83..a86d57a 100644 (file)
@@ -578,24 +578,27 @@ endmacro(ALICE_GenerateLinkDef)
 
 macro(ALICE_BuildPAR)
   if(EXISTS ${ALICE_ROOT}/${MODULE}/PROOF-INF.${PACKAGE})
-    add_custom_target(${PACKAGE}.par
-                      COMMAND sed -e 's/include .\(ROOTSYS\)\\/test\\/Makefile.arch/include Makefile.arch/\; s/PACKAGE = .*/PACKAGE = ${PACKAGE}/' < Makefile > ${PACKAGE}/Makefile
-                      COMMAND cp -pR ${ROOTSYS}/test/Makefile.arch ${PACKAGE}/Makefile.arch
-                      COMMAND cp -pR PROOF-INF.${PACKAGE} ${PACKAGE}/PROOF-INF
-                      COMMAND cp -pR lib${PACKAGE}.pkg ${PACKAGE}
-                      COMMAND tar --exclude=.svn -czhf ${CMAKE_BINARY_DIR}/${PACKAGE}.par ${PACKAGE}
-                      COMMAND ${CMAKE_COMMAND} -E remove_directory ${PACKAGE}
-                      COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --red --bold "${PACKAGE}.par has been created in ${CMAKE_BINARY_DIR}"
-                      DEPENDS ${SRCS} ${HDRS} ${FSRCS} ${DHDR}
-                      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
-
+    set(PARSRCS)
     foreach(file ${SRCS} ${HDRS} ${FSRCS} ${DHDR})
       get_filename_component(srcdir ${file} PATH)
-      add_custom_command(OUTPUT ${file}                         
-                         COMMAND mkdir -p ${PACKAGE}/${srcdir}
-                         COMMAND cp -pR ${file} ${PACKAGE}/${file}
+      add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}/${file}-par                         
+                         COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}/${srcdir}
+                         COMMAND cp -pR ${file} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}/${file}
                          WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
+      list(APPEND PARSRCS ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}/${file}-par)
     endforeach(file ${SRCS} ${HDRS} ${FSRCS} ${DHDR})
+    
+    add_custom_target(${PACKAGE}.par
+                      COMMAND sed -e 's/include .\(ROOTSYS\)\\/test\\/Makefile.arch/include Makefile.arch/\; s/PACKAGE = .*/PACKAGE = ${PACKAGE}/' < Makefile > ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}/Makefile
+                      COMMAND cp -pR ${ROOTSYS}/test/Makefile.arch ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}/Makefile.arch
+                      COMMAND cp -pR PROOF-INF.${PACKAGE} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}/PROOF-INF
+                      COMMAND cp -pR lib${PACKAGE}.pkg ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}
+                      COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_BINARY_DIR} tar --exclude=.svn -czhf ${CMAKE_BINARY_DIR}/${PACKAGE}.par ${PACKAGE}
+                      COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}
+                      COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --red --bold "${PACKAGE}.par has been created in ${CMAKE_BINARY_DIR}"
+                      DEPENDS ${PARSRCS} 
+                      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
+
 
     add_dependencies(par-all ${PACKAGE}.par)
     add_dependencies(${MODULE}-par-all ${PACKAGE}.par)
index ae1fefc..4843427 100644 (file)
@@ -36,6 +36,12 @@ macro(ALICE_CheckModule)
   if(RULECHECKER_FOUND)
     set(CHECKDIR ${CMAKE_BINARY_DIR}/${MODULE}/check)
     set(violFiles)
+    add_custom_command( OUTPUT ${MODULE}-${PACKAGE}-factFile
+                        COMMAND ${CMAKE_COMMAND} -E make_directory ${CHECKDIR}
+                        COMMAND ${CMAKE_COMMAND} -E make_directory ${CHECKDIR}/viols
+                        COMMAND ${JAVA_RUNTIME} -jar ${FACTEXTRACTOR_JAR} ${CHECKDIR} ${CHECKDIR} 
+                        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+
     foreach(_srcfile ${SRCS})
       string (REGEX REPLACE "cxx$" "h" _header ${_srcfile})
       get_filename_component(_srcname ${_srcfile} NAME)
@@ -43,31 +49,28 @@ macro(ALICE_CheckModule)
       string (REGEX REPLACE "cxx$" "cxx.xml" _srcxml ${_srcname})
       string (REGEX REPLACE "cxx$" "h.xml" _hxml ${_srcname})
       string (REGEX REPLACE ".cxx$" "" _class ${_srcname})
-      set(depends)
+      set(_depends ${_srcfile} ${MODULE}-${PACKAGE}-factFile)
+
       if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_header})
         list(APPEND depends ${_header})
         add_custom_command( OUTPUT ${_viol}
-                          COMMAND ${CMAKE_COMMAND} -E make_directory ${CHECKDIR}
-                          COMMAND ${CMAKE_COMMAND} -E make_directory ${CHECKDIR}/viols
                           COMMAND ${RULECHECKER_SRCML} ${_srcfile} ${CHECKDIR}/${_srcxml}
                           COMMAND ${RULECHECKER_SRCML} ${_header} ${CHECKDIR}/${_hxml}
-                          COMMAND ${JAVA_RUNTIME} -jar ${FACTEXTRACTOR_JAR} ${CHECKDIR} ${CHECKDIR}
                           COMMAND ${JAVA_RUNTIME} -jar ${RULECHECKER_JAR} ${CHECKDIR}/${_srcxml} ${CHECKDIR}/${_hxml} ${CHECKDIR}/factFile.xml ${RULECHECKER_RULES} > ${CHECKDIR}/viols/${_viol}
                           DEPENDS ${_depends}
                           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
         list(APPEND violFiles ${_viol})
       else()
         add_custom_command( OUTPUT ${_viol}
-                          COMMAND ${CMAKE_COMMAND} -E make_directory ${CHECKDIR}
-                          COMMAND ${CMAKE_COMMAND} -E make_directory ${CHECKDIR}/viols
                           COMMAND ${RULECHECKER_SRCML} ${_srcfile} ${CHECKDIR}/${_srcxml}
-                          COMMAND ${JAVA_RUNTIME} -jar ${FACTEXTRACTOR_JAR} ${CHECKDIR} ${CHECKDIR}
                           COMMAND ${JAVA_RUNTIME} -jar ${RULECHECKER_JAR} ${CHECKDIR}/${_srcxml} ${CHECKDIR}/${_hxml} ${CHECKDIR}/factFile.xml ${RULECHECKER_RULES} > ${CHECKDIR}/viols/${_viol}
                           DEPENDS ${_depends}
                           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
         list(APPEND violFiles ${_viol})
       endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_header})
-      add_custom_target(${MODULE}-${_class}-check DEPENDS ${_viol})
+      if(CLASSCHECK STREQUAL "YES")
+        add_custom_target(${MODULE}-${_class}-check DEPENDS ${_viol})
+      endif(CLASSCHECK STREQUAL "YES")
     endforeach(_srcfile ${SRCS})
     if(violFiles)
       add_custom_target(${PACKAGE}-check DEPENDS ${violFiles})