From a92dcb8ca757822927dd47138a8ba7cc849bde11 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Mon, 4 Nov 2024 10:42:38 +0100
Subject: [PATCH] PerfMon: cleanup link dependencies

---
 .../PerfMonComps/CMakeLists.txt                | 16 +++-------------
 .../PerfMonEvent/CMakeLists.txt                | 18 ++++--------------
 .../PerfMonKernel/CMakeLists.txt               |  8 ++------
 .../PerfMonTests/CMakeLists.txt                |  4 ++--
 4 files changed, 11 insertions(+), 35 deletions(-)

diff --git a/Control/PerformanceMonitoring/PerfMonComps/CMakeLists.txt b/Control/PerformanceMonitoring/PerfMonComps/CMakeLists.txt
index 1c2711012feb..89547bdddd11 100644
--- a/Control/PerformanceMonitoring/PerfMonComps/CMakeLists.txt
+++ b/Control/PerformanceMonitoring/PerfMonComps/CMakeLists.txt
@@ -1,27 +1,17 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( PerfMonComps )
 
 # External dependencies:
-find_package( AIDA )
-find_package( Boost )
-find_package( Python COMPONENTS Development )
-find_package( ROOT COMPONENTS Core ROOTTPython
-   cppyy${Python_VERSION_MAJOR}_${Python_VERSION_MINOR} )
 find_package( TBB )
 find_package( nlohmann_json )
-find_package( psutil )
 
 # Component(s) in the package:
 atlas_add_component( PerfMonComps
    src/*.cxx src/components/*.cxx
-   INCLUDE_DIRS ${AIDA_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-   ${Python_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS}
-   LINK_LIBRARIES ${ROOT_LIBRARIES} ${Python_LIBRARIES}
-   ${CMAKE_DL_LIBS} ${TBB_LIBRARIES} AthenaBaseComps AthenaKernel RootUtilsPyROOT CxxUtils
-   PerfMonEvent PerfMonKernel SGTools StoreGateLib GaudiKernel
-   AthDSoCallBacks nlohmann_json::nlohmann_json)
+   INCLUDE_DIRS ${TBB_INCLUDE_DIRS}
+   LINK_LIBRARIES ${TBB_LIBRARIES} AthenaBaseComps CxxUtils GaudiKernel PerfMonEvent PerfMonKernel nlohmann_json::nlohmann_json )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
diff --git a/Control/PerformanceMonitoring/PerfMonEvent/CMakeLists.txt b/Control/PerformanceMonitoring/PerfMonEvent/CMakeLists.txt
index e93d4f5845b9..30caee2ceb44 100644
--- a/Control/PerformanceMonitoring/PerfMonEvent/CMakeLists.txt
+++ b/Control/PerformanceMonitoring/PerfMonEvent/CMakeLists.txt
@@ -1,25 +1,15 @@
-# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( PerfMonEvent )
 
-# External dependencies:
-find_package( Python COMPONENTS Development )
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
-find_package( nlohmann_json )
-
 # Component(s) in the package:
 atlas_add_library( PerfMonEvent
                    src/DataModel.cxx
                    PUBLIC_HEADERS PerfMonEvent
-                   INCLUDE_DIRS ${Python_INCLUDE_DIRS}
-                   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${Python_LIBRARIES} CxxUtils GaudiKernel rt nlohmann_json::nlohmann_json CxxUtils
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} )
+                   LINK_LIBRARIES CxxUtils )
 
 atlas_add_dictionary( PerfMonEventDict
-	              PerfMonEvent/PerfMonEventDict.h
+                      PerfMonEvent/PerfMonEventDict.h
                       PerfMonEvent/selection.xml
-                      INCLUDE_DIRS ${Python_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${Python_LIBRARIES} ${ROOT_LIBRARIES} rt GaudiKernel PerfMonEvent )
-
+                      LINK_LIBRARIES PerfMonEvent )
diff --git a/Control/PerformanceMonitoring/PerfMonKernel/CMakeLists.txt b/Control/PerformanceMonitoring/PerfMonKernel/CMakeLists.txt
index 03828ce8f4b8..996f0a123b8d 100644
--- a/Control/PerformanceMonitoring/PerfMonKernel/CMakeLists.txt
+++ b/Control/PerformanceMonitoring/PerfMonKernel/CMakeLists.txt
@@ -1,14 +1,10 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( PerfMonKernel )
 
-# External dependencies:
-find_package( nlohmann_json )
-
 # Component(s) in the package:
 atlas_add_library( PerfMonKernel
                    src/*.cxx
                    PUBLIC_HEADERS PerfMonKernel
-                   LINK_LIBRARIES  GaudiKernel nlohmann_json::nlohmann_json )
-
+                   LINK_LIBRARIES GaudiKernel )
diff --git a/Control/PerformanceMonitoring/PerfMonTests/CMakeLists.txt b/Control/PerformanceMonitoring/PerfMonTests/CMakeLists.txt
index d19c67105f9a..afc71deda7d7 100644
--- a/Control/PerformanceMonitoring/PerfMonTests/CMakeLists.txt
+++ b/Control/PerformanceMonitoring/PerfMonTests/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( PerfMonTests )
@@ -11,7 +11,7 @@ atlas_add_component( PerfMonTests
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel AthAllocators AthContainers CxxUtils PerfMonKernel GaudiKernel )
+                     LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel AthAllocators AthContainers CxxUtils GaudiKernel )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
-- 
GitLab