Added par targets
authorjjose <jjose@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Nov 2010 11:36:57 +0000 (11:36 +0000)
committerjjose <jjose@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Nov 2010 11:36:57 +0000 (11:36 +0000)
CMakeLists.txt
README_CMake
cmake/ALICE_CMake.cmake

index 0653fa6..0921601 100644 (file)
@@ -191,6 +191,7 @@ add_custom_target(alilibs-static)
 add_custom_target(include-headers)
 add_custom_target(DA-all)
 add_custom_target(check-all)
+add_custom_target(par-all)
 
 # Add Modules
 # ------------------------------
index a4a7f6b..1e41c3a 100644 (file)
@@ -50,6 +50,11 @@ eg.  make STEERbase STEERbase-static
 
   The resulting violations will be written to the folder $ALICE_ROOT/<Module>/check/viols
 
+9. To Build PARs the following targets can be used. The resulting packages will be created in the cmake build directory
+
+  make par-all 
+  make <Package>.par
+
 !IMPORTANT! - Make sure your source folder is clean. If you used the old make system to build aliroot run make clean in the source directory before you run cmake
  
 
index aff924a..e2fd328 100644 (file)
@@ -334,6 +334,7 @@ macro(ALICE_BuildPackage)
       ALICE_BuildExecutable()
     endif(lib)
   endif(PS OR PCS OR PFS)
+  ALICE_BuildPAR()
   ALICE_CheckModule()
 
 endmacro(ALICE_BuildPackage)
@@ -575,4 +576,19 @@ macro(ALICE_GenerateLinkDef)
   file (APPEND ${PDAL} "#endif\n")
 endmacro(ALICE_GenerateLinkDef)
 
+macro(ALICE_BuildPAR)
+  if(EXISTS ${ALICE_ROOT}/${MODULE}/PROOF-INF.${PACKAGE})
+    add_custom_target(${PACKAGE}.par
+                      COMMAND mkdir -p ${PACKAGE}
+                      COMMAND cp -pR ${SRCS} ${HDRS} ${DHDR} ${PACKAGE}
+                      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}
+                      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
+    add_dependencies(par-all ${PACKAGE}.par)
+  endif(EXISTS ${ALICE_ROOT}/${MODULE}/PROOF-INF.${PACKAGE})
+endmacro(ALICE_BuildPAR)