From 31c60ca72efab410f1cbb758a9135da6e7163ad7 Mon Sep 17 00:00:00 2001
From: Attila Krasznahorkay <krasznaa@cern.ch>
Date: Fri, 4 Nov 2016 08:07:38 +0100
Subject: [PATCH] Taught the package how to build with CMake when tdaq-common
 is not available (ByteStreamData-01-08-26)

2016-11-04 Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
	* Taught the package how to build without tdaq-common. As it
	  is the case in AthAnalysisBase.
	* Removed the executable flag from the source files of the
	  package.
	* Tagging as ByteStreamData-01-08-26
---
 .../ByteStreamData/ByteStream.h               |  0
 .../ByteStreamData/ByteStreamUserMetadata.h   |  0
 Event/ByteStreamData/ByteStreamData/ROBData.h |  0
 .../ByteStreamData/ByteStreamData/RawEvent.h  |  0
 Event/ByteStreamData/CMakeLists.txt           | 49 ++++++++++---------
 Event/ByteStreamData/cmt/requirements         |  0
 Event/ByteStreamData/src/ROBData.cxx          |  0
 Event/ByteStreamData/src/ROBData_t.cxx        |  0
 8 files changed, 26 insertions(+), 23 deletions(-)
 mode change 100755 => 100644 Event/ByteStreamData/ByteStreamData/ByteStream.h
 mode change 100755 => 100644 Event/ByteStreamData/ByteStreamData/ByteStreamUserMetadata.h
 mode change 100755 => 100644 Event/ByteStreamData/ByteStreamData/ROBData.h
 mode change 100755 => 100644 Event/ByteStreamData/ByteStreamData/RawEvent.h
 mode change 100755 => 100644 Event/ByteStreamData/cmt/requirements
 mode change 100755 => 100644 Event/ByteStreamData/src/ROBData.cxx
 mode change 100755 => 100644 Event/ByteStreamData/src/ROBData_t.cxx

diff --git a/Event/ByteStreamData/ByteStreamData/ByteStream.h b/Event/ByteStreamData/ByteStreamData/ByteStream.h
old mode 100755
new mode 100644
diff --git a/Event/ByteStreamData/ByteStreamData/ByteStreamUserMetadata.h b/Event/ByteStreamData/ByteStreamData/ByteStreamUserMetadata.h
old mode 100755
new mode 100644
diff --git a/Event/ByteStreamData/ByteStreamData/ROBData.h b/Event/ByteStreamData/ByteStreamData/ROBData.h
old mode 100755
new mode 100644
diff --git a/Event/ByteStreamData/ByteStreamData/RawEvent.h b/Event/ByteStreamData/ByteStreamData/RawEvent.h
old mode 100755
new mode 100644
diff --git a/Event/ByteStreamData/CMakeLists.txt b/Event/ByteStreamData/CMakeLists.txt
index 4692a1894ea..851553d77be 100644
--- a/Event/ByteStreamData/CMakeLists.txt
+++ b/Event/ByteStreamData/CMakeLists.txt
@@ -1,3 +1,4 @@
+# $Id: CMakeLists.txt 782284 2016-11-04 08:07:16Z krasznaa $
 ################################################################################
 # Package: ByteStreamData
 ################################################################################
@@ -6,36 +7,38 @@
 atlas_subdir( ByteStreamData )
 
 # Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/CLIDSvc
-                          Control/DataModel
-                          Control/SGTools )
+atlas_depends_on_subdirs(
+   PUBLIC
+   Control/CLIDSvc
+   Control/DataModel
+   Control/SGTools )
 
 # External dependencies:
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
 find_package( tdaq-common )
 
+# Treat tdaq-common as an optional dependency:
+set( extra_inc )
+set( extra_lib )
+if( TDAQ-COMMON_FOUND )
+   set( extra_inc INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS} )
+   set( extra_lib ${TDAQ-COMMON_LIBRARIES} )
+endif()
+
 # Component(s) in the package:
 atlas_add_library( ByteStreamData
-                   src/ROBData.cxx
-                   src/ByteStreamMetadata.cxx
-                   PUBLIC_HEADERS ByteStreamData
-                   INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS}
-                   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} DataModel SGTools
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} )
+   ByteStreamData/*.h
+   src/ROBData.cxx
+   src/ByteStreamMetadata.cxx
+   PUBLIC_HEADERS ByteStreamData
+   ${extra_inc}
+   LINK_LIBRARIES DataModel SGTools ${extra_lib} )
 
 atlas_add_library( ByteStreamData_test
-                   src/ROBData_t.cxx
-                   PUBLIC_HEADERS ByteStreamData
-                   INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS}
-                   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} DataModel SGTools ByteStreamData
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} )
+   src/ROBData_t.cxx
+   NO_PUBLIC_HEADERS
+   LINK_LIBRARIES ByteStreamData )
 
 atlas_add_dictionary( ByteStreamDataDict
-                      ByteStreamData/ByteStreamDataDict.h
-                      ByteStreamData/selection.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${TDAQ-COMMON_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} DataModel SGTools ByteStreamData ByteStreamData_test )
-
+   ByteStreamData/ByteStreamDataDict.h
+   ByteStreamData/selection.xml
+   LINK_LIBRARIES ByteStreamData )
diff --git a/Event/ByteStreamData/cmt/requirements b/Event/ByteStreamData/cmt/requirements
old mode 100755
new mode 100644
diff --git a/Event/ByteStreamData/src/ROBData.cxx b/Event/ByteStreamData/src/ROBData.cxx
old mode 100755
new mode 100644
diff --git a/Event/ByteStreamData/src/ROBData_t.cxx b/Event/ByteStreamData/src/ROBData_t.cxx
old mode 100755
new mode 100644
-- 
GitLab