Mods for CMake
authorfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 14 Oct 2008 17:19:21 +0000 (17:19 +0000)
committerfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 14 Oct 2008 17:19:21 +0000 (17:19 +0000)
HLT/CMake_libAliHLTMUON.txt
cmake/modules/ALICEMacros.cmake

index 518a261..edc6d7f 100644 (file)
@@ -1,20 +1,6 @@
 # -*- mode: cmake -*-
 
 set(SRCS
-MUON/OfflineInterface/AliHLTMUONAgent.cxx
-MUON/OfflineInterface/AliHLTMUONTriggerRecordsSource.cxx
-MUON/OfflineInterface/AliHLTMUONRecHitsSource.cxx
-MUON/OfflineInterface/AliHLTMUONDigitPublisherComponent.cxx
-MUON/OfflineInterface/AliHLTMUONRootifierComponent.cxx
-MUON/OfflineInterface/AliHLTMUONESDMaker.cxx
-MUON/OnlineAnalysis/AliHLTMUONTriggerReconstructorComponent.cxx
-MUON/OnlineAnalysis/AliHLTMUONHitReconstructorComponent.cxx
-MUON/OnlineAnalysis/AliHLTMUONMansoTrackerFSMComponent.cxx
-MUON/OnlineAnalysis/AliHLTMUONDecisionComponent.cxx
-MUON/OnlineAnalysis/AliHLTMUONClusterFinderComponent.cxx
-MUON/utils/AliHLTMUONEmptyEventFilterComponent.cxx
-MUON/utils/AliHLTMUONDataCheckerComponent.cxx
-MUON/utils/AliHLTMUONRawDataHistoComponent.cxx
 MUON/AliHLTMUONProcessor.cxx
 MUON/AliHLTMUONRecHit.cxx
 MUON/AliHLTMUONTriggerRecord.cxx
@@ -36,6 +22,20 @@ MUON/OnlineAnalysis/AliHLTMUONCalculations.cxx
 MUON/OnlineAnalysis/AliHLTMUONTriggerReconstructor.cxx
 MUON/OnlineAnalysis/AliHLTMUONHitReconstructor.cxx
 MUON/OnlineAnalysis/AliHLTMUONMansoTrackerFSM.cxx
+MUON/OfflineInterface/AliHLTMUONAgent.cxx
+MUON/OfflineInterface/AliHLTMUONTriggerRecordsSource.cxx
+MUON/OfflineInterface/AliHLTMUONRecHitsSource.cxx
+MUON/OfflineInterface/AliHLTMUONDigitPublisherComponent.cxx
+MUON/OfflineInterface/AliHLTMUONRootifierComponent.cxx
+MUON/OfflineInterface/AliHLTMUONESDMaker.cxx
+MUON/OnlineAnalysis/AliHLTMUONTriggerReconstructorComponent.cxx
+MUON/OnlineAnalysis/AliHLTMUONHitReconstructorComponent.cxx
+MUON/OnlineAnalysis/AliHLTMUONMansoTrackerFSMComponent.cxx
+MUON/OnlineAnalysis/AliHLTMUONDecisionComponent.cxx
+MUON/OnlineAnalysis/AliHLTMUONClusterFinderComponent.cxx
+MUON/utils/AliHLTMUONEmptyEventFilterComponent.cxx
+MUON/utils/AliHLTMUONDataCheckerComponent.cxx
+MUON/utils/AliHLTMUONRawDataHistoComponent.cxx
 )
 
 # fill list of header files from list of source files
index 47d4351..96caee6 100644 (file)
@@ -42,18 +42,36 @@ Function (AddLibrary LIB SRCS DHDRS)
 
 # Adds an AliRoot library as a target
 
-  Set(LDEF "${LIB}LinkDef.h")
+  Set(_path)
+  List(LENGTH SRCS _len)
+  If(_len GREATER 0)
+    List(GET SRCS 0 _file)
+    Get_filename_component(_path ${_file} PATH)
+#    Message(STATUS Debug ${_file} ${_path})
+  Endif(_len GREATER 0)
+
+  Set(LDEF)
+  If(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIB}LinkDef.h)
+    Set(LDEF "${LIB}LinkDef.h")
+  Endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIB}LinkDef.h)
+
+  If(_path)
+    If(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_path}/${LIB}LinkDef.h)
+      Set(LDEF "${_path}/${LIB}LinkDef.h")
+    Endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_path}/${LIB}LinkDef.h)
+  Endif(_path)
+
   Set(DICT)
-  If(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LDEF})
+  If(LDEF)
 # even with no cxx files, one may want to build an empty lib as a placeholder
 # in AliRoot this is signalled by the existence of an (empty) ${LIB}LinkDef.h
     Set(DICT "G__${LIB}.cxx")
     Set(ASRCS ${SRCS} ${DICT})
     Root_Generate_Dictionary("${DHDRS}" "${LDEF}" "${DICT}" "${INCLUDE_DIRECTORIES}")
-  Else(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LDEF})
-    Message(STATUS "${LDEF} not found... probably building empty lib")
+  Else(LDEF)
+    Message(STATUS "${LIB}LinkDef.h not found... probably building empty lib")
     Set(ASRCS ${SRCS})
-  Endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LDEF})
+  Endif(LDEF)
 
   Add_Library(${LIB} SHARED ${ASRCS})
   Target_Link_Libraries(${LIB} ${ALIROOT_LIBRARIES})