From c77da169605de220cf748cceabfe67aa2f1284a0 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Tue, 22 Sep 2020 11:01:28 +0200
Subject: [PATCH] DataQuality: cmake configuration cleanup

Remove `atlas_depends_on_subdirs` and fix link dependencies where needed.
---
 DataQuality/DCSCalculator2/CMakeLists.txt     | 11 +-----
 DataQuality/DQDefects/CMakeLists.txt          |  8 +----
 DataQuality/DQUtils/CMakeLists.txt            |  9 +----
 .../DataQualityConfigurations/CMakeLists.txt  |  8 +----
 .../DataQualityInterfaces/CMakeLists.txt      | 15 +++-----
 DataQuality/DataQualityUtils/CMakeLists.txt   | 12 ++-----
 DataQuality/GoodRunsLists/CMakeLists.txt      | 35 ++-----------------
 DataQuality/GoodRunsListsUser/CMakeLists.txt  | 16 ++-------
 DataQuality/ZLumiScripts/CMakeLists.txt       |  7 +---
 9 files changed, 17 insertions(+), 104 deletions(-)

diff --git a/DataQuality/DCSCalculator2/CMakeLists.txt b/DataQuality/DCSCalculator2/CMakeLists.txt
index 828e03df1d3..5428b74761a 100644
--- a/DataQuality/DCSCalculator2/CMakeLists.txt
+++ b/DataQuality/DCSCalculator2/CMakeLists.txt
@@ -1,17 +1,8 @@
-################################################################################
-# Package: DCSCalculator2
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( DCSCalculator2 )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          Database/CoolRunQuery
-                          TileCalorimeter/TileCalib/TileCalibBlobObjs
-                          DataQuality/DQDefects
-                          DataQuality/DQUtils )
-
 # External dependencies:
 find_package( sqlalchemy )
 find_package( ipython )
diff --git a/DataQuality/DQDefects/CMakeLists.txt b/DataQuality/DQDefects/CMakeLists.txt
index 78af5128d1f..c852b89d64f 100644
--- a/DataQuality/DQDefects/CMakeLists.txt
+++ b/DataQuality/DQDefects/CMakeLists.txt
@@ -1,14 +1,8 @@
-################################################################################
-# Package: DQDefects
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( DQDefects )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          DataQuality/DQUtils )
-
 # External dependencies:
 find_package( Oracle )
 find_package( pyyaml )
diff --git a/DataQuality/DQUtils/CMakeLists.txt b/DataQuality/DQUtils/CMakeLists.txt
index 5ffbd7d58b0..70e8fd0e45d 100644
--- a/DataQuality/DQUtils/CMakeLists.txt
+++ b/DataQuality/DQUtils/CMakeLists.txt
@@ -1,14 +1,8 @@
-################################################################################
-# Package: DQUtils
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( DQUtils )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          Database/CoraCool )
-
 # External dependencies:
 find_package( Boost COMPONENTS filesystem thread system )
 find_package( COOL COMPONENTS CoolKernel CoolApplication )
@@ -21,7 +15,6 @@ find_package( sqlalchemy )
 
 string(REPLACE "-Wl,--as-needed" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
 
-
 # Component(s) in the package:
 atlas_add_library( DQUtils
                    src/quick_retrieve.cxx
diff --git a/DataQuality/DataQualityConfigurations/CMakeLists.txt b/DataQuality/DataQualityConfigurations/CMakeLists.txt
index 4e11aa4cc5d..2a673e40cd4 100644
--- a/DataQuality/DataQualityConfigurations/CMakeLists.txt
+++ b/DataQuality/DataQualityConfigurations/CMakeLists.txt
@@ -1,14 +1,8 @@
-################################################################################
-# Package: DataQualityConfigurations
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( DataQualityConfigurations )
 
-# Requires DQI for binary build - this turns out not to do much, but keep for indication
-# Actual heavy lifting done by DEPENDS in add_custom_command
-atlas_depends_on_subdirs(PRIVATE DataQuality/DataQualityInterfaces)
-
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
 atlas_install_scripts( scripts/MergeConfigs.py scripts/UploadDQAMITag.py
diff --git a/DataQuality/DataQualityInterfaces/CMakeLists.txt b/DataQuality/DataQualityInterfaces/CMakeLists.txt
index 380a68b28a7..5082eaa1373 100644
--- a/DataQuality/DataQualityInterfaces/CMakeLists.txt
+++ b/DataQuality/DataQualityInterfaces/CMakeLists.txt
@@ -1,6 +1,4 @@
-################################################################################
-# Package: DataQualityInterfaces
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( DataQualityInterfaces )
@@ -17,7 +15,7 @@ find_package( nlohmann_json )
 atlas_add_root_dictionary( DataQualityInterfaces
                            DataQualityInterfacesDictSource
                            ROOT_HEADERS DataQualityInterfaces/DatabaseConfig.h DataQualityInterfaces/MiniConfig.h DataQualityInterfaces/MiniConfigTreeNode.h DataQualityInterfaces/HanApp.h DataQualityInterfaces/HanConfig.h DataQualityInterfaces/HanConfigAlgLimit.h DataQualityInterfaces/HanConfigAlgPar.h DataQualityInterfaces/HanConfigParMap.h DataQualityInterfaces/HanConfigAssessor.h DataQualityInterfaces/HanConfigCompAlg.h DataQualityInterfaces/HanConfigGroup.h DataQualityInterfaces/HanConfigMetadata.h DataQualityInterfaces/ConditionsSingleton.h DataQualityInterfaces/LinkDef.h
-                           EXTERNAL_PACKAGES ROOT  Boost tdaq-common COOL CORAL nlohmann_json)
+                           EXTERNAL_PACKAGES ROOT Boost tdaq-common COOL CORAL nlohmann_json)
 
 atlas_add_library( DataQualityInterfaces
                    src/HanAlgorithmConfig.cxx
@@ -45,15 +43,12 @@ atlas_add_library( DataQualityInterfaces
 
 atlas_add_executable( han
                       src/han.cxx
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${TDAQ-COMMON_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} DataQualityInterfaces )
+                      LINK_LIBRARIES DataQualityInterfaces )
 
 atlas_add_executable( han-config-gen
                       src/han_config_gen.cxx
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${TDAQ-COMMON_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}  nlohmann_json::nlohmann_json ${COOL_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} DataQualityInterfaces nlohmann_json::nlohmann_json ${CORAL_LIBRARIES} ${COOL_LIBRARIES} )
+                      LINK_LIBRARIES DataQualityInterfaces )
 
 atlas_add_executable( han-config-print
                       src/han_config_print.cxx
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${TDAQ-COMMON_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} DataQualityInterfaces )
+                      LINK_LIBRARIES DataQualityInterfaces )
diff --git a/DataQuality/DataQualityUtils/CMakeLists.txt b/DataQuality/DataQualityUtils/CMakeLists.txt
index 56571376467..efb1dc25eb0 100644
--- a/DataQuality/DataQualityUtils/CMakeLists.txt
+++ b/DataQuality/DataQualityUtils/CMakeLists.txt
@@ -1,15 +1,8 @@
-################################################################################
-# Package: DataQualityUtils
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( DataQualityUtils )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          DataQuality/DataQualityInterfaces
-                          DataQuality/ZLumiScripts )
-
 # External dependencies:
 find_package( Boost COMPONENTS regex filesystem thread system )
 find_package( COOL COMPONENTS CoolKernel CoolApplication )
@@ -76,8 +69,7 @@ atlas_add_library( DataQualityUtils
 
 atlas_add_executable( han-results-print
                       src/han_results_print.cxx
-                      INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${Boost_LIBRARIES} ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} DataQualityInterfaces DataQualityUtils )
+                      LINK_LIBRARIES DataQualityUtils )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py
diff --git a/DataQuality/GoodRunsLists/CMakeLists.txt b/DataQuality/GoodRunsLists/CMakeLists.txt
index 8abe281e81d..9683d2affca 100644
--- a/DataQuality/GoodRunsLists/CMakeLists.txt
+++ b/DataQuality/GoodRunsLists/CMakeLists.txt
@@ -1,36 +1,8 @@
-# $Id: CMakeLists.txt 777875 2016-10-11 17:17:13Z krasznaa $
-################################################################################
-# Package: GoodRunsLists
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( GoodRunsLists )
 
-# Declare the package's dependencies:
-if( XAOD_STANDALONE )
-   atlas_depends_on_subdirs(
-      PUBLIC
-      Control/AthToolSupport/AsgTools
-      Event/xAOD/xAODEventInfo
-      PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces
-      PRIVATE
-      Tools/PathResolver )
-else()
-   atlas_depends_on_subdirs(
-      PUBLIC
-      Control/AthToolSupport/AsgTools
-      Control/AthenaBaseComps
-      Control/AthenaKernel
-      Event/xAOD/xAODEventInfo
-      PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces
-      GaudiKernel
-      PRIVATE
-      Control/StoreGate
-      Event/EventInfo
-      Tools/PathResolver
-      AtlasTest/TestTools )
-endif()
-
 # External dependencies:
 find_package( ROOT COMPONENTS Core Tree TreePlayer XMLIO XMLParser )
 find_package( LibXml2 )
@@ -48,14 +20,13 @@ atlas_add_library( GoodRunsListsLib
    PUBLIC_HEADERS GoodRunsLists
    INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
    PRIVATE_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIR}
-   LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODEventInfo AsgAnalysisInterfaces
+   LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools AsgAnalysisInterfaces
    PRIVATE_LINK_LIBRARIES ${LIBXML2_LIBRARIES} PathResolver )
 
 if( NOT XAOD_STANDALONE )
    atlas_add_component( GoodRunsLists
       src/*.cxx src/components/*.cxx
-      LINK_LIBRARIES AthenaBaseComps AthenaKernel xAODEventInfo GaudiKernel
-      StoreGateLib EventInfo PathResolver GoodRunsListsLib )
+      LINK_LIBRARIES AthenaBaseComps AthenaKernel EventInfo GaudiKernel GoodRunsListsLib PathResolver StoreGateLib xAODEventInfo )
 endif()
 
 atlas_add_dictionary( GoodRunsListsDict
diff --git a/DataQuality/GoodRunsListsUser/CMakeLists.txt b/DataQuality/GoodRunsListsUser/CMakeLists.txt
index 092b549ae13..4aa54cc5000 100644
--- a/DataQuality/GoodRunsListsUser/CMakeLists.txt
+++ b/DataQuality/GoodRunsListsUser/CMakeLists.txt
@@ -1,20 +1,8 @@
-################################################################################
-# Package: GoodRunsListsUser
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( GoodRunsListsUser )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaBaseComps
-                          Control/StoreGate
-                          DataQuality/GoodRunsLists
-                          Event/EventInfo
-                          GaudiKernel
-                          Trigger/TrigAnalysis/TrigDecisionTool
-                          Trigger/TrigEvent/TrigDecisionEvent )
-
 # External dependencies:
 find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread MathMore Minuit Minuit2 Matrix Physics HistPainter Rint )
 
@@ -25,7 +13,7 @@ atlas_add_component( GoodRunsListsUser
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps StoreGateLib SGtests GoodRunsListsLib EventInfo GaudiKernel TrigDecisionToolLib TrigDecisionEvent )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps GoodRunsListsLib EventInfo GaudiKernel TrigDecisionToolLib TrigDecisionEvent )
 
 # Install files from the package:
 atlas_install_headers( GoodRunsListsUser )
diff --git a/DataQuality/ZLumiScripts/CMakeLists.txt b/DataQuality/ZLumiScripts/CMakeLists.txt
index b658acb5bba..5378b300298 100644
--- a/DataQuality/ZLumiScripts/CMakeLists.txt
+++ b/DataQuality/ZLumiScripts/CMakeLists.txt
@@ -1,13 +1,8 @@
-################################################################################
-# Package: ZLumiScripts
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( ZLumiScripts )
 
-# Declare the package's dependencies:
-#atlas_depends_on_subdirs( )
-
 # External dependencies:
 find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
 
-- 
GitLab