Changed names of static libraries, targets and updated README_CMake
authorjjose <jjose@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 22 Oct 2010 10:18:13 +0000 (10:18 +0000)
committerjjose <jjose@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 22 Oct 2010 10:18:13 +0000 (10:18 +0000)
CMakeLists.txt
README_CMake
cmake/ALICE_CMake.cmake
cmake/CMakeDA.cmake

index 932c987..6972ce8 100644 (file)
@@ -186,7 +186,7 @@ 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}-static)
+  add_custom_target(${MODULE}-all-static)
   add_dependencies(alilibs-static "${MODULE}-static")
   add_subdirectory(${MODULE})
 endforeach(MODULE)
index 70b0985..ad517e0 100644 (file)
@@ -15,13 +15,32 @@ Steps to Build AliRoot with CMake :
 
 3. Execute the following commands to build AliRoot
 
-       cmake ~/trunk
+       cmake <Path to Source>
+
+eg.    cmake ~/trunk
        make
 
 4. In order to build addtional targets like THydjet and SHUTTLE add the following options to the cmake command
 
        cmake -DTHydjet=ON -DSHUTTLE=ON <path_to_source>
 
+5. Static libraries can be built using
+
+       make alilibs-static
+
+6. Individual Modules can be built using
+
+       make <Module>-all
+       make <Module>-all-static 
+
+eg.    make STEER-all STEER-all-static
+
+7. Individual Packages can be built using
+
+       make <Package>
+       make <Package>-static
+
+eg.    make STEERbase STEERbase-static
 
 !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 de3286d..5cb5c0e 100644 (file)
@@ -308,8 +308,8 @@ macro(ALICE_BuildPackage)
   if(lib)
     list(APPEND PMLIBS ${PACKAGE})
     list(APPEND ALLLIBS ${PACKAGE})
-    list(APPEND PMALIBS ${PACKAGE}_a)
-    list(APPEND ALLALIBS ${PACKAGE}_a)
+    list(APPEND PMALIBS ${PACKAGE}-static)
+    list(APPEND ALLALIBS ${PACKAGE}-static)
     list(APPEND BINLIBS ${PACKAGE})
   else()
     list(APPEND ALLEXECS ${PACKAGE})
@@ -437,12 +437,13 @@ macro(ALICE_BuildLibrary)
   
   add_dependencies(${MODULE}-all ${PACKAGE})
      
-  add_library(${PACKAGE}_a STATIC EXCLUDE_FROM_ALL ${PCS} ${PFS} ${PS} ${PDS})
+  add_library(${PACKAGE}-static STATIC EXCLUDE_FROM_ALL ${PCS} ${PFS} ${PS} ${PDS})
+  set_target_properties(${PACKAGE}-static PROPERTIES OUTPUT_NAME ${PACKAGE})
   if(PELIBS OR ALLIB)
-    target_link_libraries(${PACKAGE}_a ${PELIBSDIR} ${PELIBS} ${ALLIB})
+    target_link_libraries(${PACKAGE}-static ${PELIBSDIR} ${PELIBS} ${ALLIB})
   endif(PELIBS OR ALLIB)
 
-  add_dependencies(${MODULE}-static ${PACKAGE}_a)
+  add_dependencies(${MODULE}-all-static ${PACKAGE}-static)
   if(ALIPROFILE STREQUAL "YES")
     add_dependencies(${MODULE}-all ${MODULE}-static)
   endif(ALIPROFILE STREQUAL "YES")
index 33b96ba..0612c52 100644 (file)
@@ -112,7 +112,7 @@ foreach(detector ${ONLINEDETECTORS} )
 
   set(ALIROOTALIBS)
 
-  list(APPEND ALIROOTALIBS RAWDatabase_a RAWDatarec_a RAWDatasim_a STEERBase_a STEER_a CDB_a ESD_a STAT_a AOD_a )
+  list(APPEND ALIROOTALIBS RAWDatabase-static RAWDatarec-static RAWDatasim-static STEERBase-static STEER-static CDB-static ESD-static STAT-static AOD-static )
 
   expand(ALIROOTALIBS2 "\${${DAMODULE}ALIBS}")
   expand(DAINCDIRS "\${${DAMODULE}INC}")
@@ -189,16 +189,20 @@ foreach(detector ${ONLINEDETECTORS} )
 
          set(ZIP)
          foreach(_lib ${ALIROOTALIBS})
-          string(REGEX REPLACE "-all" "_a" _lib ${_lib})
+          string(REGEX REPLACE "-static" "" _lib ${_lib})
           list(APPEND ZIP && ar x "../lib${_lib}.a")
          endforeach(_lib)
          list (APPEND ZIP && ar r "../lib${DALIB}.a" "*.o")
 
          add_custom_target( ${DALIB} COMMAND rm -rf junk && mkdir -p junk 
-                               COMMAND cd junk ${ZIP}
-                               COMMAND cd ../ && rm -rf junk
+                               COMMAND cd junk${DAEXE} ${ZIP}
+                               COMMAND cd ../ && rm -rf junk${DAEXE}
                                DEPENDS ${ALIROOTALIBS}
                                WORKING_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
+         add_custom_command( TARGET clean
+                            COMMAND rm -rf junk${DAEXE}
+                            WORKING_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
+           
 
          add_custom_target(${DATARGETNAME})
          add_executable(${DAEXE} ${DASRC})