From 75e088f968329e817d805f824ba023d608f735bc Mon Sep 17 00:00:00 2001
From: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
Date: Fri, 6 Nov 2020 09:52:20 +0100
Subject: [PATCH] Cleaned up the CMake configuration of xAODEventFormatCnv.

Shuffled the sources between xAODEventFormatCnvTestLib and
xAODEventFormatCnvTest such that both of them would only hold
what it really needs to, and fixed the build of the package's
dictionary.
---
 Event/xAOD/xAODEventFormatCnv/CMakeLists.txt | 48 ++++++++------------
 1 file changed, 19 insertions(+), 29 deletions(-)

diff --git a/Event/xAOD/xAODEventFormatCnv/CMakeLists.txt b/Event/xAOD/xAODEventFormatCnv/CMakeLists.txt
index c24bb3a933b..77e8bf65231 100644
--- a/Event/xAOD/xAODEventFormatCnv/CMakeLists.txt
+++ b/Event/xAOD/xAODEventFormatCnv/CMakeLists.txt
@@ -3,36 +3,27 @@
 # Declare the package name.
 atlas_subdir( xAODEventFormatCnv )
 
+# Find the necessary "externals".
 find_package( xAODUtilities )
 
+# Set up the "main library" of the package.
 atlas_add_component( xAODEventFormatCnv
   src/*.h src/*.cxx src/components/*.cxx
   LINK_LIBRARIES
     GaudiKernel AthenaKernel AthenaBaseComps StoreGateLib xAODEventFormat )
 
-atlas_add_component( xAODEventFormatCnvTest
-  src/test/*.h src/test/*.cxx
-  LINK_LIBRARIES
-    GaudiKernel
-    AthenaBaseComps
-    AthContainers
-    AthContainersInterfaces
-    StoreGateLib
-    xAODCore
-    xAODEventFormat )
-
+# Set up the test code of the package.
 atlas_add_library( xAODEventFormatCnvTestLib
-  src/test/*.h src/test/*.cxx
+  xAODEventFormatCnv/test/*.h xAODEventFormatCnv/test/versions/*.h
+  src/test/A_v1.cxx src/test/AAuxContainer_v1.cxx
   PUBLIC_HEADERS xAODEventFormatCnv
-  PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-  LINK_LIBRARIES
-    GaudiKernel
-    AthenaKernel
-    AthContainers
-    AthContainersInterfaces
-    xAODCore
-    xAODEventFormat
-  PRIVATE_LINK_LIBRARIES AthenaBaseComps StoreGateLib )
+  LINK_LIBRARIES AthContainers xAODCore
+  PRIVATE_LINK_LIBRARIES AthContainersInterfaces )
+
+atlas_add_component( xAODEventFormatCnvTest
+  src/test/*.h src/test/ACreatorAlg.cxx src/test/EventFormatPrinterAlg.cxx
+  LINK_LIBRARIES GaudiKernel AthenaKernel AthenaBaseComps StoreGateLib
+  xAODEventFormat xAODEventFormatCnvTestLib )
 
 atlas_add_poolcnv_library( xAODEventFormatCnvTestAthenaPoolCnv
   src/test/cnv/*.h src/test/cnv/*.cxx
@@ -46,24 +37,23 @@ atlas_add_poolcnv_library( xAODEventFormatCnvTestAthenaPoolCnv
     xAODMakerTest::AAuxContainer
   CNV_PFX xAODMakerTest
   LINK_LIBRARIES
+    GaudiKernel
+    AthenaKernel
     AthenaPoolCnvSvcLib
-    AthenaPoolUtilities
     AthContainers
     xAODEventFormatCnvTestLib )
 
+atlas_add_xaod_smart_pointer_dicts(
+  INPUT xAODEventFormatCnv/test/selection.xml
+  OUTPUT _selectionFile
+  CONTAINERS "xAODMakerTest::AVec_v1" )
+
 atlas_add_dictionary( xAODEventFormatCnvTestDict
   xAODEventFormatCnv/test/xAODEventFormatCnvTestDict.h
-  xAODEventFormatCnv/test/selection.xml
   ${_selectionFile}
-  INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
   LINK_LIBRARIES xAODCore xAODEventFormatCnvTestLib
   EXTRA_FILES src/test/dict/*.cxx )
 
-atlas_add_xaod_smart_pointer_dicts(
-  INPUT xAODEventFormatCnv/test/selection.xml
-  OUTPUT _selectionFile
-  CONTAINERS "xAODMakerTest::AVec_v1" )
-
 # Install files from the package.
 atlas_install_joboptions( share/*.py )
 
-- 
GitLab