From 5473f030ca3959bf0155660b7695ac2e932f7984 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Mon, 13 Jan 2020 13:56:59 +0100
Subject: [PATCH] Migrate to FindPython (part 2)

Use `Python_.*` variables instead of the non-standard `PYTHON_.*`.
---
 Control/AthenaPython/CMakeLists.txt            | 10 +++++-----
 Control/AthenaServices/CMakeLists.txt          |  4 ++--
 Control/Hephaestus/CMakeLists.txt              |  4 ++--
 .../PerfMonComps/CMakeLists.txt                |  4 ++--
 .../PerfMonEvent/CMakeLists.txt                |  8 ++++----
 Control/PyKernel/CMakeLists.txt                |  8 ++++----
 Control/RootUtils/CMakeLists.txt               | 18 +++++++++---------
 Control/StoreGateBindings/CMakeLists.txt       |  8 ++++----
 DataQuality/DQUtils/CMakeLists.txt             |  8 ++++----
 HLT/Trigger/TrigControl/TrigPSC/CMakeLists.txt |  4 ++--
 .../AnalysisTools/CMakeLists.txt               | 12 ++++++------
 .../PyAnalysisExamples/CMakeLists.txt          | 12 ++++++------
 .../McParticleUtils/CMakeLists.txt             |  4 ++--
 .../TrigConfDBConnection/CMakeLists.txt        | 14 +++++++-------
 Trigger/TrigT1/L1Common/CMakeLists.txt         |  2 +-
 15 files changed, 60 insertions(+), 60 deletions(-)

diff --git a/Control/AthenaPython/CMakeLists.txt b/Control/AthenaPython/CMakeLists.txt
index 4146c992634a..7f2e1eff24ad 100644
--- a/Control/AthenaPython/CMakeLists.txt
+++ b/Control/AthenaPython/CMakeLists.txt
@@ -23,20 +23,20 @@ find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread PyROOT )
 atlas_add_library( AthenaPython
                    src/*.cxx
                    PUBLIC_HEADERS AthenaPython
-                   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}
+                   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Python_INCLUDE_DIRS}
                    LINK_LIBRARIES AthenaBaseComps AthenaKernel GaudiKernel
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${PYTHON_LIBRARIES} CxxUtils DataModelRoot )
+                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${Python_LIBRARIES} CxxUtils DataModelRoot )
 
 atlas_add_component( AthenaPythonComps
                      src/components/*.cxx
-                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}
+                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Python_INCLUDE_DIRS}
                      LINK_LIBRARIES AthenaPython )
 
 atlas_add_dictionary( AthenaPythonDict
                       AthenaPython/AthenaPythonDict.h
                       AthenaPython/selection.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${PYTHON_LIBRARIES} AthenaBaseComps AthenaKernel GaudiKernel CxxUtils DataModelRoot AthenaPython )
+                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Python_INCLUDE_DIRS}
+                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${Python_LIBRARIES} AthenaBaseComps AthenaKernel GaudiKernel CxxUtils DataModelRoot AthenaPython )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py python/tests
diff --git a/Control/AthenaServices/CMakeLists.txt b/Control/AthenaServices/CMakeLists.txt
index 4665818c4455..86f3ec34c149 100644
--- a/Control/AthenaServices/CMakeLists.txt
+++ b/Control/AthenaServices/CMakeLists.txt
@@ -37,9 +37,9 @@ find_package( yampl )
 
 # Component(s) in the package:
 atlas_add_component( AthenaServices src/*.cxx src/components/*.cxx
-   INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}
+   INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${Python_INCLUDE_DIRS}
    ${CLHEP_INCLUDE_DIRS} ${YAMPL_INCLUDE_DIRS}
-   LINK_LIBRARIES ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} ${YAMPL_LIBRARIES}
+   LINK_LIBRARIES ${Boost_LIBRARIES} ${Python_LIBRARIES} ${YAMPL_LIBRARIES}
    ${CLHEP_LIBRARIES} z TestTools AsgTools AthenaBaseComps AthenaKernel RootUtils CxxUtils
    AthContainers DataModelRoot Navigation PerfMonEvent PerfMonKernel SGTools
    StoreGateLib SGtests PersistentDataModel EventInfo xAODEventInfo EventInfoUtils GaudiKernel )
diff --git a/Control/Hephaestus/CMakeLists.txt b/Control/Hephaestus/CMakeLists.txt
index 82e542b1139a..b04238d754f5 100644
--- a/Control/Hephaestus/CMakeLists.txt
+++ b/Control/Hephaestus/CMakeLists.txt
@@ -14,8 +14,8 @@ find_package( libunwind )
 atlas_add_library( Hephaestus
    Hephaestus/*.h src/hlib/*.c
    PUBLIC_HEADERS Hephaestus
-   INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS}
-   LINK_LIBRARIES ${PYTHON_LIBRARIES} ${CMAKE_DL_LIBS} )
+   INCLUDE_DIRS ${Python_INCLUDE_DIRS}
+   LINK_LIBRARIES ${Python_LIBRARIES} ${CMAKE_DL_LIBS} )
 
 atlas_add_library( MemoryTracker
    src/*.c
diff --git a/Control/PerformanceMonitoring/PerfMonComps/CMakeLists.txt b/Control/PerformanceMonitoring/PerfMonComps/CMakeLists.txt
index 50c9353666a7..efa4b530d8c5 100644
--- a/Control/PerformanceMonitoring/PerfMonComps/CMakeLists.txt
+++ b/Control/PerformanceMonitoring/PerfMonComps/CMakeLists.txt
@@ -30,8 +30,8 @@ find_package( nlohmann_json )
 atlas_add_component( PerfMonComps
    src/*.cxx src/components/*.cxx
    INCLUDE_DIRS ${AIDA_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-   ${PYTHON_INCLUDE_DIRS}
-   LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} ${PYTHON_LIBRARIES}
+   ${Python_INCLUDE_DIRS}
+   LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} ${Python_LIBRARIES}
    ${CMAKE_DL_LIBS} AthenaBaseComps AthenaKernel RootUtils CxxUtils
    PerfMonEvent PerfMonKernel SGTools StoreGateLib GaudiKernel
    AthDSoCallBacks nlohmann_json::nlohmann_json)
diff --git a/Control/PerformanceMonitoring/PerfMonEvent/CMakeLists.txt b/Control/PerformanceMonitoring/PerfMonEvent/CMakeLists.txt
index 4f034c34c22d..303cad9ae749 100644
--- a/Control/PerformanceMonitoring/PerfMonEvent/CMakeLists.txt
+++ b/Control/PerformanceMonitoring/PerfMonEvent/CMakeLists.txt
@@ -28,14 +28,14 @@ atlas_add_library( PerfMonEvent
                    src/MemStatsHooks.cxx
                    src/MallocStats.cxx
                    PUBLIC_HEADERS PerfMonEvent
-                   INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
+                   INCLUDE_DIRS ${Python_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
                    PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${PYTHON_LIBRARIES} ${Boost_LIBRARIES} GaudiKernel rt
+                   LINK_LIBRARIES ${Python_LIBRARIES} ${Boost_LIBRARIES} GaudiKernel rt
                    PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} )
 
 atlas_add_dictionary( PerfMonEventDict
                       PerfMonEvent/PerfMonEventDict.h
                       PerfMonEvent/selection.xml
-                      INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${PYTHON_LIBRARIES} ${ROOT_LIBRARIES} rt GaudiKernel PerfMonEvent )
+                      INCLUDE_DIRS ${Python_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
+                      LINK_LIBRARIES ${Python_LIBRARIES} ${ROOT_LIBRARIES} rt GaudiKernel PerfMonEvent )
 
diff --git a/Control/PyKernel/CMakeLists.txt b/Control/PyKernel/CMakeLists.txt
index 7bb861fa7c84..ea4f83cdbd8c 100644
--- a/Control/PyKernel/CMakeLists.txt
+++ b/Control/PyKernel/CMakeLists.txt
@@ -13,16 +13,16 @@ find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
 atlas_add_library( PyKernel
                    src/*.cxx
                    PUBLIC_HEADERS PyKernel
-                   INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS}
+                   INCLUDE_DIRS ${Python_INCLUDE_DIRS}
                    PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${PYTHON_LIBRARIES}
+                   LINK_LIBRARIES ${Python_LIBRARIES}
                    PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} )
 
 atlas_add_dictionary( PyKernelDict
                       PyKernel/PyKernelDict.h
                       PyKernel/selection.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${PYTHON_LIBRARIES} PyKernel )
+                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Python_INCLUDE_DIRS}
+                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${Python_LIBRARIES} PyKernel )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
diff --git a/Control/RootUtils/CMakeLists.txt b/Control/RootUtils/CMakeLists.txt
index eb8cd357a546..9df918a35a6d 100644
--- a/Control/RootUtils/CMakeLists.txt
+++ b/Control/RootUtils/CMakeLists.txt
@@ -21,13 +21,13 @@ string( REPLACE PyROOT Core ROOT_LIBRARIES_NOPYROOT "${ROOT_LIBRARIES}" )
 atlas_generate_reflex_dictionary( dict_cpp  RootUtils
                       HEADER  ${CMAKE_CURRENT_SOURCE_DIR}/RootUtils/RootUtilsDict.h
                       SELECTION  ${CMAKE_CURRENT_SOURCE_DIR}/RootUtils/selection.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
+                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Python_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
                       )
 
 atlas_add_library( RootUtils
                    src/*.cxx ${dict_cpp}
                    PUBLIC_HEADERS RootUtils
-                   INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
+                   INCLUDE_DIRS ${Python_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
                    PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
                    LINK_LIBRARIES ${Boost_LIBRARIES}
                    PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES_NOPYROOT} TestTools )
@@ -37,30 +37,30 @@ add_dependencies( RootUtils RootUtilsDictGen )
 atlas_add_library( RootUtilsPyROOT
                    src/pyroot/*.cxx
                    PUBLIC_HEADERS RootUtils
-                   INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
+                   INCLUDE_DIRS ${Python_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
                    PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${PYTHON_LIBRARIES} ${Boost_LIBRARIES} RootUtils
+                   LINK_LIBRARIES ${Python_LIBRARIES} ${Boost_LIBRARIES} RootUtils
                    PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools )
 
 
 atlas_add_dictionary( RootUtilsPyROOTDict
                       RootUtils/RootUtilsPyROOTDict.h
                       RootUtils/selection_PyROOT.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
+                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Python_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
                       LINK_LIBRARIES ${ROOT_LIBRARIES_NOPYROOT} ${Boost_LIBRARIES} TestTools RootUtils RootUtilsPyROOT )
 
 atlas_add_test( Type_test
                 SOURCES
                 test/Type_test.cxx
-                INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${PYTHON_LIBRARIES} ${Boost_LIBRARIES} TestTools RootUtils RootUtilsPyROOT
+                INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Python_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
+                LINK_LIBRARIES ${ROOT_LIBRARIES} ${Python_LIBRARIES} ${Boost_LIBRARIES} TestTools RootUtils RootUtilsPyROOT
                 PROPERTIES TIMEOUT 300 )
 
 atlas_add_test( TSMethodCall_test
                 SOURCES
                 test/TSMethodCall_test.cxx
-                INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${PYTHON_LIBRARIES} ${Boost_LIBRARIES} TestTools RootUtils RootUtilsPyROOT )
+                INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Python_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
+                LINK_LIBRARIES ${ROOT_LIBRARIES} ${Python_LIBRARIES} ${Boost_LIBRARIES} TestTools RootUtils RootUtilsPyROOT )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
diff --git a/Control/StoreGateBindings/CMakeLists.txt b/Control/StoreGateBindings/CMakeLists.txt
index 289794d2f5bd..a201fe65165a 100644
--- a/Control/StoreGateBindings/CMakeLists.txt
+++ b/Control/StoreGateBindings/CMakeLists.txt
@@ -22,15 +22,15 @@ find_package( ROOT COMPONENTS PyROOT Core Tree MathCore Hist RIO pthread )
 atlas_add_library( StoreGateBindings
                    src/*.cxx
                    PUBLIC_HEADERS StoreGateBindings
-                   PRIVATE_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
+                   PRIVATE_INCLUDE_DIRS ${Python_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
                    LINK_LIBRARIES StoreGateLib SGtests RootUtils
-                   PRIVATE_LINK_LIBRARIES ${PYTHON_LIBRARIES} ${ROOT_LIBRARIES} AthenaKernel DataModelRoot SGTools GaudiKernel )
+                   PRIVATE_LINK_LIBRARIES ${Python_LIBRARIES} ${ROOT_LIBRARIES} AthenaKernel DataModelRoot SGTools GaudiKernel )
 
 atlas_add_dictionary( StoreGateBindingsDict
                       src/StoreGateBindingsDict.h
                       StoreGateBindings/selection.xml
-                      INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${PYTHON_LIBRARIES} ${ROOT_LIBRARIES} AthenaKernel DataModelRoot SGTools StoreGateLib SGtests GaudiKernel StoreGateBindings )
+                      INCLUDE_DIRS ${Python_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
+                      LINK_LIBRARIES ${Python_LIBRARIES} ${ROOT_LIBRARIES} AthenaKernel DataModelRoot SGTools StoreGateLib SGtests GaudiKernel StoreGateBindings )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py
diff --git a/DataQuality/DQUtils/CMakeLists.txt b/DataQuality/DQUtils/CMakeLists.txt
index d6acda5bb6ae..611fb0d9a2fa 100644
--- a/DataQuality/DQUtils/CMakeLists.txt
+++ b/DataQuality/DQUtils/CMakeLists.txt
@@ -28,15 +28,15 @@ atlas_add_library( DQUtils
                    src/pythonic_coracool.cxx
                    PUBLIC_HEADERS DQUtils
                    INCLUDE_DIRS ${ORACLE_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-                   PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${COOL_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
+                   PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${COOL_INCLUDE_DIRS} ${Python_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
                    LINK_LIBRARIES ${ORACLE_LIBRARIES} ${ROOT_LIBRARIES}
-                   PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${COOL_LIBRARIES} ${PYTHON_LIBRARIES} ${CORAL_LIBRARIES} CoraCool )
+                   PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${COOL_LIBRARIES} ${Python_LIBRARIES} ${CORAL_LIBRARIES} CoraCool )
 
 atlas_add_dictionary( DQUtilsDict
                       dict/dictionary.h
                       dict/dictionary.xml
-                      INCLUDE_DIRS ${ORACLE_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ORACLE_LIBRARIES} ${Boost_LIBRARIES} ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${PYTHON_LIBRARIES} ${CORAL_LIBRARIES} CoraCool DQUtils )
+                      INCLUDE_DIRS ${ORACLE_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${Python_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
+                      LINK_LIBRARIES ${ORACLE_LIBRARIES} ${Boost_LIBRARIES} ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${Python_LIBRARIES} ${CORAL_LIBRARIES} CoraCool DQUtils )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py python/ext python/sugar )
diff --git a/HLT/Trigger/TrigControl/TrigPSC/CMakeLists.txt b/HLT/Trigger/TrigControl/TrigPSC/CMakeLists.txt
index 5592e15dc911..3fb8b87d74cf 100644
--- a/HLT/Trigger/TrigControl/TrigPSC/CMakeLists.txt
+++ b/HLT/Trigger/TrigControl/TrigPSC/CMakeLists.txt
@@ -24,9 +24,9 @@ atlas_add_library( TrigPSC
                    src/*.cxx
                    PUBLIC_HEADERS TrigPSC
                    INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS}
-                   PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}
+                   PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${Python_INCLUDE_DIRS}
                    LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} GaudiKernel
-                   PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} TrigKernel PathResolver TrigConfBase )
+                   PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${Python_LIBRARIES} TrigKernel PathResolver TrigConfBase )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisTools/CMakeLists.txt b/PhysicsAnalysis/AnalysisCommon/AnalysisTools/CMakeLists.txt
index 343f2910804b..7958eeb85f3a 100644
--- a/PhysicsAnalysis/AnalysisCommon/AnalysisTools/CMakeLists.txt
+++ b/PhysicsAnalysis/AnalysisCommon/AnalysisTools/CMakeLists.txt
@@ -31,21 +31,21 @@ find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
 atlas_add_library( AthAnalysisToolsLib
                    src/*.cxx
                    PUBLIC_HEADERS AnalysisTools
-                   INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS}
+                   INCLUDE_DIRS ${Python_INCLUDE_DIRS}
                    PRIVATE_INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${PYTHON_LIBRARIES} AthenaBaseComps AthContainers NavFourMom GaudiKernel McParticleEvent StoreGateLib SGtests AnalysisUtilsLib RootCollection
+                   LINK_LIBRARIES ${Python_LIBRARIES} AthenaBaseComps AthContainers NavFourMom GaudiKernel McParticleEvent StoreGateLib SGtests AnalysisUtilsLib RootCollection
                    PRIVATE_LINK_LIBRARIES ${CORAL_LIBRARIES} ${ROOT_LIBRARIES} SGTools RootCollection AthenaPoolUtilities PersistentDataModel EventInfo )
 
 atlas_add_component( AthAnalysisTools
                      src/components/*.cxx
-                     INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${CORAL_LIBRARIES} ${PYTHON_LIBRARIES} ${ROOT_LIBRARIES} AthenaBaseComps AthContainers StoreGateLib SGtests NavFourMom GaudiKernel AnalysisUtilsLib McParticleEvent SGTools RootCollection AthenaPoolUtilities PersistentDataModel EventInfo AthAnalysisToolsLib )
+                     INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} ${Python_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
+                     LINK_LIBRARIES ${CORAL_LIBRARIES} ${Python_LIBRARIES} ${ROOT_LIBRARIES} AthenaBaseComps AthContainers StoreGateLib SGtests NavFourMom GaudiKernel AnalysisUtilsLib McParticleEvent SGTools RootCollection AthenaPoolUtilities PersistentDataModel EventInfo AthAnalysisToolsLib )
 
 atlas_add_dictionary( AthAnalysisToolsDict
                       AnalysisTools/AnalysisToolsDict.h
                       AnalysisTools/selection.xml
-                      INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${CORAL_LIBRARIES} ${PYTHON_LIBRARIES} ${ROOT_LIBRARIES} AthenaBaseComps AthContainers StoreGateLib SGtests NavFourMom GaudiKernel AnalysisUtilsLib McParticleEvent SGTools RootCollection RootCollectionComponents AthenaPoolUtilities PersistentDataModel EventInfo AthAnalysisToolsLib )
+                      INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} ${Python_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
+                      LINK_LIBRARIES ${CORAL_LIBRARIES} ${Python_LIBRARIES} ${ROOT_LIBRARIES} AthenaBaseComps AthContainers StoreGateLib SGtests NavFourMom GaudiKernel AnalysisUtilsLib McParticleEvent SGTools RootCollection RootCollectionComponents AthenaPoolUtilities PersistentDataModel EventInfo AthAnalysisToolsLib )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
diff --git a/PhysicsAnalysis/PyAnalysis/PyAnalysisExamples/CMakeLists.txt b/PhysicsAnalysis/PyAnalysis/PyAnalysisExamples/CMakeLists.txt
index 1846255fe055..a82e402d8189 100644
--- a/PhysicsAnalysis/PyAnalysis/PyAnalysisExamples/CMakeLists.txt
+++ b/PhysicsAnalysis/PyAnalysis/PyAnalysisExamples/CMakeLists.txt
@@ -25,22 +25,22 @@ find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
 atlas_add_library( PyAnalysisExamplesLib
                    src/*.cxx
                    PUBLIC_HEADERS PyAnalysisExamples
-                   INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS}
+                   INCLUDE_DIRS ${Python_INCLUDE_DIRS}
                    PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
                    PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS}
-                   LINK_LIBRARIES ${PYTHON_LIBRARIES} AthenaBaseComps AthenaKernel AthenaKernel GaudiKernel egammaEvent StoreGateLib SGtests
+                   LINK_LIBRARIES ${Python_LIBRARIES} AthenaBaseComps AthenaKernel AthenaKernel GaudiKernel egammaEvent StoreGateLib SGtests
                    PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} PyKernel )
 
 atlas_add_component( PyAnalysisExamples
                      src/components/*.cxx
-                     INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${PYTHON_LIBRARIES} ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel AthenaKernel GaudiKernel egammaEvent PyKernel StoreGateLib SGtests PyAnalysisExamplesLib )
+                     INCLUDE_DIRS ${Python_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
+                     LINK_LIBRARIES ${Python_LIBRARIES} ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel AthenaKernel GaudiKernel egammaEvent PyKernel StoreGateLib SGtests PyAnalysisExamplesLib )
 
 atlas_add_dictionary( PyAnalysisExamplesDict
                       PyAnalysisExamples/PyAnalysisExamplesDict.h
                       PyAnalysisExamples/selection.xml
-                      INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${PYTHON_LIBRARIES} ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel AthenaKernel GaudiKernel egammaEvent PyKernel StoreGateLib SGtests PyAnalysisExamplesLib )
+                      INCLUDE_DIRS ${Python_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
+                      LINK_LIBRARIES ${Python_LIBRARIES} ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel AthenaKernel GaudiKernel egammaEvent PyKernel StoreGateLib SGtests PyAnalysisExamplesLib )
 
 # Install files from the package:
 atlas_install_joboptions( share/*.py )
diff --git a/PhysicsAnalysis/TruthParticleID/McParticleUtils/CMakeLists.txt b/PhysicsAnalysis/TruthParticleID/McParticleUtils/CMakeLists.txt
index 94a4b7208d8d..d0d6edeef4fa 100644
--- a/PhysicsAnalysis/TruthParticleID/McParticleUtils/CMakeLists.txt
+++ b/PhysicsAnalysis/TruthParticleID/McParticleUtils/CMakeLists.txt
@@ -30,10 +30,10 @@ atlas_add_library( McParticleUtils
                    src/*.cxx
                    PUBLIC_HEADERS McParticleUtils
                    INCLUDE_DIRS ${HEPMC_INCLUDE_DIRS}
-                   PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${HEPPDT_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${CPPUNIT_INCLUDE_DIRS}
+                   PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${HEPPDT_INCLUDE_DIRS} ${Python_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${CPPUNIT_INCLUDE_DIRS}
                    PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS}
                    LINK_LIBRARIES ${HEPMC_LIBRARIES} AthenaKernel AthContainers EventKernel GaudiKernel AnalysisUtilsLib StoreGateLib SGtests RootUtils
-                   PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${HEPPDT_LIBRARIES} ${PYTHON_LIBRARIES} ${CLHEP_LIBRARIES} ${CPPUNIT_LIBRARIES} )
+                   PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${HEPPDT_LIBRARIES} ${Python_LIBRARIES} ${CLHEP_LIBRARIES} ${CPPUNIT_LIBRARIES} )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
diff --git a/Trigger/TrigConfiguration/TrigConfDBConnection/CMakeLists.txt b/Trigger/TrigConfiguration/TrigConfDBConnection/CMakeLists.txt
index 923695817554..e569e1e2651c 100644
--- a/Trigger/TrigConfiguration/TrigConfDBConnection/CMakeLists.txt
+++ b/Trigger/TrigConfiguration/TrigConfDBConnection/CMakeLists.txt
@@ -9,26 +9,26 @@ atlas_subdir( TrigConfDBConnection )
 find_package( Frontier_Client )
 find_package( Python COMPONENTS Development )
 find_package( Boost COMPONENTS filesystem thread system
-              OPTIONAL_COMPONENTS python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR} )
+              OPTIONAL_COMPONENTS python${Python_VERSION_MAJOR}${Python_VERSION_MINOR} )
 
 # Component(s) in the package:
 atlas_add_library( TrigConfDBConnection
                    src/*.cxx
                    PUBLIC_HEADERS TrigConfDBConnection
-                   PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${FRONTIER_CLIENT_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}
-                   PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${FRONTIER_CLIENT_LIBRARIES} ${PYTHON_LIBRARIES} )
+                   PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${FRONTIER_CLIENT_INCLUDE_DIRS} ${Python_INCLUDE_DIRS}
+                   PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${FRONTIER_CLIENT_LIBRARIES} ${Python_LIBRARIES} )
 
 atlas_add_library( TrigConfDBFrontier
                    src/*.cxx
                    PUBLIC_HEADERS TrigConfDBConnection
-                   PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${FRONTIER_CLIENT_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}
-                   PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${FRONTIER_CLIENT_LIBRARIES} ${PYTHON_LIBRARIES} )
+                   PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${FRONTIER_CLIENT_INCLUDE_DIRS} ${Python_INCLUDE_DIRS}
+                   PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${FRONTIER_CLIENT_LIBRARIES} ${Python_LIBRARIES} )
 
 
 atlas_add_executable( TriggerFrontierClientTest
                       src/exe/TriggerFrontierClientTest.cxx
-                      INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${FRONTIER_CLIENT_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${Boost_LIBRARIES} ${FRONTIER_CLIENT_LIBRARIES} ${PYTHON_LIBRARIES} TrigConfDBConnection )
+                      INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${FRONTIER_CLIENT_INCLUDE_DIRS} ${Python_INCLUDE_DIRS}
+                      LINK_LIBRARIES ${Boost_LIBRARIES} ${FRONTIER_CLIENT_LIBRARIES} ${Python_LIBRARIES} TrigConfDBConnection )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py
diff --git a/Trigger/TrigT1/L1Common/CMakeLists.txt b/Trigger/TrigT1/L1Common/CMakeLists.txt
index 2fce26ec0dca..7bda754a59ee 100644
--- a/Trigger/TrigT1/L1Common/CMakeLists.txt
+++ b/Trigger/TrigT1/L1Common/CMakeLists.txt
@@ -25,7 +25,7 @@ atlas_install_scripts( ${_generator} )
 add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/L1Common
    COMMAND ${CMAKE_COMMAND} -E make_directory
    ${CMAKE_CURRENT_BINARY_DIR}/L1Common
-   COMMAND ${PYTHON_EXECUTABLE} ${_generator}
+   COMMAND ${Python_EXECUTABLE} ${_generator}
    -o ${CMAKE_CURRENT_BINARY_DIR}/L1Common/L1Common
    -i ${CMAKE_CURRENT_SOURCE_DIR}/schema/L1Specifications.xml
    COMMAND ${CMAKE_COMMAND} -E make_directory
-- 
GitLab