Fix for DA
[u/mrichter/AliRoot.git] / cmake / CMakeDA.cmake
index 3350ef13de05a43e0a3a0623616ed64be24dc5cf..4255e5243fc83eeb2c40f8f31e7643edf5bd8014 100644 (file)
@@ -112,15 +112,12 @@ 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}")
   list(APPEND ALIROOTALIBS ${ALIROOTALIBS2})
   
-  message("Listing sub directories for ${DAMODULE}")
-  message("${DAINCDIRS}")
-  
   include_directories(${DAMODULE} ${SUBDIR} ${DAINCDIRS})
 #Get detector algorithms for this detector
 
@@ -191,18 +188,21 @@ foreach(detector ${ONLINEDETECTORS} )
          set(CMAKE_MODULE_LINKER_FLAGS ${LDFLAGS})
 
          set(ZIP)
-         message("${DAEXE}- ${DAMODULE} - ${ALIROOTALIBS}")
          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
+         add_custom_target( ${DALIB} COMMAND rm -rf junk${DAEXE} && mkdir -p junk${DAEXE} 
+                               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})