From 7e3fe8181bb20ebd091cb06c185c734c9cbf5c3a Mon Sep 17 00:00:00 2001
From: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
Date: Fri, 25 Jan 2019 11:26:18 +0100
Subject: [PATCH] Cleaned up some of the VP1 packages a bit.

Some of the VP1 packages were using the ${QT5_ROOT} variable. Since that
variable no longer exists, it seemed reasonable to clean up the configuration
of these packages. While at it, I made all other cleanup that seemed reasonable.
---
 graphics/VP1/VP1AlgsBatch/CMakeLists.txt      | 30 ++++++--------
 graphics/VP1/VP1AlgsEventProd/CMakeLists.txt  | 33 ++++++----------
 .../VP1Plugins/VP1AODPlugin/CMakeLists.txt    | 39 ++++++-------------
 .../VP1GeometryPlugin/CMakeLists.txt          | 35 ++++++-----------
 .../VP1Systems/VP1AODSystems/CMakeLists.txt   |  6 +--
 graphics/VP1/VP1Utils/CMakeLists.txt          |  8 +---
 graphics/VP1/VP1UtilsBase/CMakeLists.txt      |  5 ++-
 7 files changed, 56 insertions(+), 100 deletions(-)

diff --git a/graphics/VP1/VP1AlgsBatch/CMakeLists.txt b/graphics/VP1/VP1AlgsBatch/CMakeLists.txt
index 737502d6a09..9eafa4947fe 100644
--- a/graphics/VP1/VP1AlgsBatch/CMakeLists.txt
+++ b/graphics/VP1/VP1AlgsBatch/CMakeLists.txt
@@ -6,27 +6,21 @@
 atlas_subdir( VP1AlgsBatch )
 
 # Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaBaseComps
-                          GaudiKernel
-                          PRIVATE
-                          Database/APR/StorageSvc
-                          Event/EventInfo
-                          Tools/PathResolver
-                          graphics/VP1/VP1UtilsBase )
-
-# External dependencies:
-find_package( Qt5 COMPONENTS Core OpenGL Gui HINTS ${QT5_ROOT} )
-
-
+atlas_depends_on_subdirs(
+   PUBLIC
+   Control/AthenaBaseComps
+   GaudiKernel
+   PRIVATE
+   Database/APR/StorageSvc
+   Event/EventInfo
+   Tools/PathResolver
+   graphics/VP1/VP1UtilsBase )
 
 # Component(s) in the package:
 atlas_add_component( VP1AlgsBatch
-                     src/*.cxx
-                     src/components/*.cxx
-                   LINK_LIBRARIES ${QT5_LIBRARIES} GL AthenaBaseComps GaudiKernel StorageSvc EventInfo PathResolver VP1UtilsBase )
+   VP1AlgsBatch/*.h src/*.cxx src/components/*.cxx
+   LINK_LIBRARIES AthenaBaseComps GaudiKernel StorageSvc EventInfo PathResolver
+   VP1UtilsBase )
 
 # Install files from the package:
-atlas_install_headers( VP1AlgsBatch )
 atlas_install_runtime( share/*.vp1 )
-
diff --git a/graphics/VP1/VP1AlgsEventProd/CMakeLists.txt b/graphics/VP1/VP1AlgsEventProd/CMakeLists.txt
index 5916cd2861c..7ee316846f7 100644
--- a/graphics/VP1/VP1AlgsEventProd/CMakeLists.txt
+++ b/graphics/VP1/VP1AlgsEventProd/CMakeLists.txt
@@ -6,27 +6,18 @@
 atlas_subdir( VP1AlgsEventProd )
 
 # Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaBaseComps
-                          GaudiKernel
-                          PRIVATE
-                          Database/APR/StorageSvc
-                          Event/EventInfo
-                          Tools/PathResolver
-                          graphics/VP1/VP1UtilsBase )
-
-# External dependencies:
-find_package( Qt5 COMPONENTS Core OpenGL Gui HINTS ${QT5_ROOT} )
-
-
+atlas_depends_on_subdirs(
+   PUBLIC
+   Control/AthenaBaseComps
+   GaudiKernel
+   PRIVATE
+   Database/APR/StorageSvc
+   Event/EventInfo
+   Tools/PathResolver
+   graphics/VP1/VP1UtilsBase )
 
 # Component(s) in the package:
 atlas_add_component( VP1AlgsEventProd
-                     src/*.cxx
-                     src/components/*.cxx
-                   LINK_LIBRARIES GL AthenaBaseComps GaudiKernel StorageSvc EventInfo PathResolver VP1UtilsBase )
-
-# Install files from the package:
-atlas_install_headers( VP1AlgsEventProd )
-
-
+   VP1AlgsEventProd/*.h src/*.cxx src/components/*.cxx
+   LINK_LIBRARIES AthenaBaseComps GaudiKernel StorageSvc EventInfo PathResolver
+   VP1UtilsBase )
diff --git a/graphics/VP1/VP1Plugins/VP1AODPlugin/CMakeLists.txt b/graphics/VP1/VP1Plugins/VP1AODPlugin/CMakeLists.txt
index 8afd7e74a2c..597f287e5f7 100644
--- a/graphics/VP1/VP1Plugins/VP1AODPlugin/CMakeLists.txt
+++ b/graphics/VP1/VP1Plugins/VP1AODPlugin/CMakeLists.txt
@@ -6,37 +6,22 @@
 atlas_subdir( VP1AODPlugin )
 
 # Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          graphics/VP1/VP1Base
-                          PRIVATE
-                          graphics/VP1/VP1Systems/VP1AODSystems
-                          graphics/VP1/VP1Systems/VP1GuideLineSystems )
-
-# Install files from the package:
-atlas_install_headers( VP1AODPlugin )
+atlas_depends_on_subdirs(
+   PUBLIC
+   graphics/VP1/VP1Base
+   PRIVATE
+   graphics/VP1/VP1Systems/VP1AODSystems
+   graphics/VP1/VP1Systems/VP1GuideLineSystems )
 
 # External dependencies:
-find_package( Qt5 COMPONENTS Core OpenGL Gui Widgets HINTS ${QT5_ROOT} )
-find_package( SoQt )
-find_package( Coin3D )
-
-
+find_package( Qt5 COMPONENTS Core )
 
-# Generate UI files automatically:
-set( CMAKE_AUTOUIC TRUE )
 # Generate MOC files automatically:
 set( CMAKE_AUTOMOC TRUE )
 
-# get the package name into the variable 'pkgName', to be used below
-atlas_get_package_name( pkgName )
-
-
 # Build the library.
-atlas_add_library( ${pkgName} ${pkgName}/*.h src/*.cxx src/*.qrc 
-   PUBLIC_HEADERS ${pkgName}
-   INCLUDE_DIRS ${SOQT_INCLUDE_DIRS} ${COIN3D_INCLUDE_DIRS} ${QT5_INCLUDE_DIRS} 
-   PRIVATE_INCLUDE_DIRS tmpqt_extraheaders/  ${ROOT_INCLUDE_DIRS}
-   LINK_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets ${SOQT_LIBRARIES} ${COIN3D_LIBRARIES} GeoPrimitives
-   PRIVATE_LINK_LIBRARIES VP1GuideLineSystems VP1GeometrySystems VP1AODSystems
-)
-
+atlas_add_library( VP1AODPlugin
+   VP1AODPlugin/*.h src/*.cxx
+   PUBLIC_HEADERS VP1AODPlugin
+   LINK_LIBRARIES Qt5::Core VP1Base
+   PRIVATE_LINK_LIBRARIES VP1GuideLineSystems VP1AODSystems )
diff --git a/graphics/VP1/VP1Plugins/VP1GeometryPlugin/CMakeLists.txt b/graphics/VP1/VP1Plugins/VP1GeometryPlugin/CMakeLists.txt
index f6f3e9d71e6..0de3845a215 100644
--- a/graphics/VP1/VP1Plugins/VP1GeometryPlugin/CMakeLists.txt
+++ b/graphics/VP1/VP1Plugins/VP1GeometryPlugin/CMakeLists.txt
@@ -6,33 +6,22 @@
 atlas_subdir( VP1GeometryPlugin )
 
 # Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          graphics/VP1/VP1Systems/VP1GeometrySystems
-                          graphics/VP1/VP1Systems/VP1GuideLineSystems )
-
-# Install files from the package:
-atlas_install_headers( VP1GeometryPlugin )
+atlas_depends_on_subdirs(
+   PUBLIC
+   graphics/VP1/VP1Base
+   PRIVATE
+   graphics/VP1/VP1Systems/VP1GeometrySystems
+   graphics/VP1/VP1Systems/VP1GuideLineSystems )
 
 # External dependencies:
-find_package( Qt5 COMPONENTS Core OpenGL Gui Widgets HINTS ${QT5_ROOT} )
-find_package( SoQt )
-find_package( Coin3D )
+find_package( Qt5 COMPONENTS Core )
 
-# Generate UI files automatically:
-set( CMAKE_AUTOUIC TRUE )
 # Generate MOC files automatically:
 set( CMAKE_AUTOMOC TRUE )
 
-# get the package name into the variable 'pkgName', to be used below
-atlas_get_package_name( pkgName )
-
-
 # Build the library.
-atlas_add_library( ${pkgName} ${pkgName}/*.h src/*.cxx src/*.qrc 
-   PUBLIC_HEADERS ${pkgName}
-   INCLUDE_DIRS ${SOQT_INCLUDE_DIRS} ${COIN3D_INCLUDE_DIRS} ${QT5_INCLUDE_DIRS} 
-   PRIVATE_INCLUDE_DIRS tmpqt_extraheaders/ ${CMAKE_CURRENT_BINARY_DIR} ${ROOT_INCLUDE_DIRS}
-   LINK_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets ${SOQT_LIBRARIES} ${COIN3D_LIBRARIES} GeoPrimitives
-   PRIVATE_LINK_LIBRARIES VP1GuideLineSystems VP1GeometrySystems
-)
-
+atlas_add_library( VP1GeometryPlugin
+   VP1GeometryPlugin/*.h src/*.cxx 
+   PUBLIC_HEADERS VP1GeometryPlugin
+   LINK_LIBRARIES Qt5::Core VP1Base
+   PRIVATE_LINK_LIBRARIES VP1GuideLineSystems VP1GeometrySystems )
diff --git a/graphics/VP1/VP1Systems/VP1AODSystems/CMakeLists.txt b/graphics/VP1/VP1Systems/VP1AODSystems/CMakeLists.txt
index 99cac9e432b..17783933393 100644
--- a/graphics/VP1/VP1Systems/VP1AODSystems/CMakeLists.txt
+++ b/graphics/VP1/VP1Systems/VP1AODSystems/CMakeLists.txt
@@ -1,4 +1,3 @@
-# $Id: CMakeLists.txt 732142 2016-03-24 11:36:39Z krasznaa $
 ################################################################################
 # Package: VP1AODSystems
 ################################################################################
@@ -28,10 +27,11 @@ atlas_depends_on_subdirs(
 
 # External dependencies:
 find_package( Coin3D )
-find_package( Qt5 COMPONENTS Core Gui Widgets HINTS ${QT5_ROOT} )
+find_package( Qt5 COMPONENTS Core Gui Widgets )
 
 # Generate UI files automatically:
-# Note: add the "Widgets" component to "find_package( Qt5 ...)" if you have UI files, otherwise UIC, even if CMAKE_AUTOUIC is set to ON, is not run
+# Note: add the "Widgets" component to "find_package( Qt5 ...)" if you have UI
+# files, otherwise UIC, even if CMAKE_AUTOUIC is set to ON, is not run
 set( CMAKE_AUTOUIC TRUE )
 # Generate MOC files automatically:
 set( CMAKE_AUTOMOC TRUE )
diff --git a/graphics/VP1/VP1Utils/CMakeLists.txt b/graphics/VP1/VP1Utils/CMakeLists.txt
index 09ebbed35da..7af012dbc4b 100644
--- a/graphics/VP1/VP1Utils/CMakeLists.txt
+++ b/graphics/VP1/VP1Utils/CMakeLists.txt
@@ -42,14 +42,9 @@ find_package( CLHEP )
 find_package( Coin3D )
 find_package( Eigen )
 find_package( HepPDT )
-find_package( Qt5 COMPONENTS Core HINTS ${QT5_ROOT} )
+find_package( Qt5 COMPONENTS Core )
 find_package( GeoModel )
 
-# CLHEP definitions:
-add_definitions( -DCLHEP_MAX_MIN_DEFINED
-                 -DCLHEP_ABS_DEFINED
-                 -DCLHEP_SQR_DEFINED )
-
 # Generate MOC files automatically:
 set( CMAKE_AUTOMOC TRUE )
 
@@ -59,6 +54,7 @@ atlas_add_library( VP1Utils VP1Utils/*.h src/*.cxx src/*.cpp
    INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
    PRIVATE_INCLUDE_DIRS ${HEPPDT_INCLUDE_DIRS} ${COIN3D_INCLUDE_DIRS}
    ${EIGEN_INCLUDE_DIRS}
+   DEFINITIONS ${CLHEP_DEFINITIONS}
    LINK_LIBRARIES ${CLHEP_LIBRARIES} ${GEOMODEL_LIBRARIES} EventPrimitives
    GaudiKernel VP1Base StoreGateLib SGtests AthDSoCallBacks MuonIdHelpersLib
    GeoPrimitives Qt5::Core
diff --git a/graphics/VP1/VP1UtilsBase/CMakeLists.txt b/graphics/VP1/VP1UtilsBase/CMakeLists.txt
index 93b7084bc01..160aa3359f6 100644
--- a/graphics/VP1/VP1UtilsBase/CMakeLists.txt
+++ b/graphics/VP1/VP1UtilsBase/CMakeLists.txt
@@ -8,9 +8,10 @@
 atlas_subdir( VP1UtilsBase )
 
 # External dependencies:
-find_package( Qt5 COMPONENTS Core HINTS ${QT5_ROOT} )
+find_package( Qt5 COMPONENTS Core )
 
 # Component(s) in the package:
-atlas_add_library( VP1UtilsBase src/*.cxx
+atlas_add_library( VP1UtilsBase
+   VP1UtilsBase/*.h src/*.cxx
    PUBLIC_HEADERS VP1UtilsBase
    PRIVATE_LINK_LIBRARIES Qt5::Core )
-- 
GitLab