From 46ddf322fbbaf992bd65a7fa0c38d51c3b457688 Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Thu, 22 Aug 2019 13:15:41 +0200
Subject: [PATCH] Cmake: set minimum to 3.12, drop setting of policy which is
 now default

---
 CMakeLists.txt                          | 3 ---
 cmake/DD4hep.cmake                      | 4 ----
 examples/AlignDet/CMakeLists.txt        | 2 +-
 examples/CLICSiD/CMakeLists.txt         | 2 +-
 examples/CMakeLists.txt                 | 5 +----
 examples/ClientTests/CMakeLists.txt     | 2 +-
 examples/Conditions/CMakeLists.txt      | 2 +-
 examples/DDCMS/CMakeLists.txt           | 2 +-
 examples/DDCodex/CMakeLists.txt         | 2 +-
 examples/DDDB/CMakeLists.txt            | 2 +-
 examples/DDDigi/CMakeLists.txt          | 2 +-
 examples/DDG4/CMakeLists.txt            | 2 +-
 examples/DDG4_MySensDet/CMakeLists.txt  | 2 +-
 examples/LHeD/CMakeLists.txt            | 2 +-
 examples/OpticalSurfaces/CMakeLists.txt | 2 +-
 examples/Persistency/CMakeLists.txt     | 2 +-
 examples/Segmentation/CMakeLists.txt    | 2 +-
 examples/SimpleDetector/CMakeLists.txt  | 2 +-
 18 files changed, 16 insertions(+), 26 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c2bdb2ca6..258161b09 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,4 @@
 cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
-if (POLICY CMP0074)
-  cmake_policy(SET CMP0074 NEW) # CMake 3.12
-endif ()
 PROJECT( DD4hep LANGUAGES NONE)
 SET_PROPERTY(DIRECTORY . PROPERTY PACKAGE_NAME DD4hep)
 
diff --git a/cmake/DD4hep.cmake b/cmake/DD4hep.cmake
index d0d70e205..4c45218ed 100644
--- a/cmake/DD4hep.cmake
+++ b/cmake/DD4hep.cmake
@@ -10,10 +10,6 @@
 #
 #=================================================================================
 
-if (POLICY CMP0074)
-  cmake_policy(SET CMP0074 NEW) # CMake 3.12
-endif ()
-
 #---------------------------------------------------------------------------------------------------
 if ( DD4hep_DIR )
   set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${DD4hep_DIR}/cmake ) 
diff --git a/examples/AlignDet/CMakeLists.txt b/examples/AlignDet/CMakeLists.txt
index 98f7286d5..dea7ae9a3 100644
--- a/examples/AlignDet/CMakeLists.txt
+++ b/examples/AlignDet/CMakeLists.txt
@@ -8,7 +8,7 @@
 # For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
 #
 #==========================================================================
-cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
 include ( ${DD4hep_DIR}/cmake/DD4hep.cmake )
 
 #--------------------------------------------------------------------------
diff --git a/examples/CLICSiD/CMakeLists.txt b/examples/CLICSiD/CMakeLists.txt
index 602e038ed..fa0453716 100644
--- a/examples/CLICSiD/CMakeLists.txt
+++ b/examples/CLICSiD/CMakeLists.txt
@@ -8,7 +8,7 @@
 # For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
 #
 #==========================================================================
-cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
 include ( ${DD4hep_DIR}/cmake/DD4hep.cmake )
 
 #-----------------------------------------------------------------------------------
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 9e6da72e5..7d66b0f2b 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -21,10 +21,7 @@
 # 
 # M.Frank, CERN, 2015:  Adapt to new cmake scripts
 #==========================================================================
-cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
-if (POLICY CMP0074)
-  cmake_policy(SET CMP0074 NEW) # CMake 3.12
-endif ()
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
 
 project( DD4hep_Examples )
 
diff --git a/examples/ClientTests/CMakeLists.txt b/examples/ClientTests/CMakeLists.txt
index 882e64fbf..f0f9ee901 100644
--- a/examples/ClientTests/CMakeLists.txt
+++ b/examples/ClientTests/CMakeLists.txt
@@ -8,7 +8,7 @@
 # For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
 #
 #==========================================================================
-cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
 include ( ${DD4hep_DIR}/cmake/DD4hep.cmake )
 
 #--------------------------------------------------------------------------
diff --git a/examples/Conditions/CMakeLists.txt b/examples/Conditions/CMakeLists.txt
index 1ac8290fa..9eaedd0af 100644
--- a/examples/Conditions/CMakeLists.txt
+++ b/examples/Conditions/CMakeLists.txt
@@ -8,7 +8,7 @@
 # For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
 #
 #==========================================================================
-cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
 include ( ${DD4hep_DIR}/cmake/DD4hep.cmake )
 
 #--------------------------------------------------------------------------
diff --git a/examples/DDCMS/CMakeLists.txt b/examples/DDCMS/CMakeLists.txt
index 453209939..8aad0fee2 100644
--- a/examples/DDCMS/CMakeLists.txt
+++ b/examples/DDCMS/CMakeLists.txt
@@ -12,7 +12,7 @@
 # DDCMS is a detector description convention developed by the CMS experiment.
 #
 #=================================================================================
-cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
 
 include ( ${DD4hep_DIR}/cmake/DD4hep.cmake )
 #------------------------------------------------------------------------------
diff --git a/examples/DDCodex/CMakeLists.txt b/examples/DDCodex/CMakeLists.txt
index 2fd8ab8ff..a3e13c4f3 100755
--- a/examples/DDCodex/CMakeLists.txt
+++ b/examples/DDCodex/CMakeLists.txt
@@ -8,7 +8,7 @@
 # For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
 #
 #==========================================================================
-cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
 include ( ${DD4hep_DIR}/cmake/DD4hep.cmake )
 
 #---DDCodex plugin library -------------------------------------------------------
diff --git a/examples/DDDB/CMakeLists.txt b/examples/DDDB/CMakeLists.txt
index 68fd85e7b..0d22ebc40 100644
--- a/examples/DDDB/CMakeLists.txt
+++ b/examples/DDDB/CMakeLists.txt
@@ -17,7 +17,7 @@
 #
 
 #==========================================================================
-cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
 
 # XercesC dependent stuff
 if(DD4HEP_USE_XERCESC)
diff --git a/examples/DDDigi/CMakeLists.txt b/examples/DDDigi/CMakeLists.txt
index a313599cc..e1e6b3256 100644
--- a/examples/DDDigi/CMakeLists.txt
+++ b/examples/DDDigi/CMakeLists.txt
@@ -8,7 +8,7 @@
 # For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
 #
 #==========================================================================
-cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
 include ( ${DD4hep_DIR}/cmake/DD4hep.cmake )
 
 #-----------------------------------------------------------------------------------
diff --git a/examples/DDG4/CMakeLists.txt b/examples/DDG4/CMakeLists.txt
index a9297b1f4..29d0cb307 100644
--- a/examples/DDG4/CMakeLists.txt
+++ b/examples/DDG4/CMakeLists.txt
@@ -8,7 +8,7 @@
 # For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
 #
 #==========================================================================
-cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
 include ( ${DD4hep_DIR}/cmake/DD4hep.cmake )
 
 #-----------------------------------------------------------------------------------
diff --git a/examples/DDG4_MySensDet/CMakeLists.txt b/examples/DDG4_MySensDet/CMakeLists.txt
index 51888b8aa..2cdfe886d 100644
--- a/examples/DDG4_MySensDet/CMakeLists.txt
+++ b/examples/DDG4_MySensDet/CMakeLists.txt
@@ -8,7 +8,7 @@
 # For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
 #
 #==========================================================================
-cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
 include ( ${DD4hep_DIR}/cmake/DD4hep.cmake )
 
 if(NOT TARGET Geant4::Interface)
diff --git a/examples/LHeD/CMakeLists.txt b/examples/LHeD/CMakeLists.txt
index 4fb8552a8..38635703d 100644
--- a/examples/LHeD/CMakeLists.txt
+++ b/examples/LHeD/CMakeLists.txt
@@ -8,7 +8,7 @@
 # For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
 # CLICSiD used as template!
 #==========================================================================
-cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
 include ( ${DD4hep_DIR}/cmake/DD4hep.cmake )
 
 #-----------------------------------------------------------------------------------
diff --git a/examples/OpticalSurfaces/CMakeLists.txt b/examples/OpticalSurfaces/CMakeLists.txt
index e92ae0a07..fb0b73988 100644
--- a/examples/OpticalSurfaces/CMakeLists.txt
+++ b/examples/OpticalSurfaces/CMakeLists.txt
@@ -8,7 +8,7 @@
 # For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
 #
 #==========================================================================
-cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
 include ( ${DD4hep_DIR}/cmake/DD4hep.cmake )
 
 dd4hep_print("|++> OpticalSurfaces: ROOT version: ${ROOT_VERSION}")
diff --git a/examples/Persistency/CMakeLists.txt b/examples/Persistency/CMakeLists.txt
index 5eda33742..1e6642dcc 100644
--- a/examples/Persistency/CMakeLists.txt
+++ b/examples/Persistency/CMakeLists.txt
@@ -8,7 +8,7 @@
 # For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
 #
 #==========================================================================
-cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
 include ( ${DD4hep_DIR}/cmake/DD4hep.cmake )
 
 if(TARGET XercesC::XercesC)
diff --git a/examples/Segmentation/CMakeLists.txt b/examples/Segmentation/CMakeLists.txt
index f42e789ea..a08977a66 100644
--- a/examples/Segmentation/CMakeLists.txt
+++ b/examples/Segmentation/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
 
 #---------------------------
 set( PackageName Segmentation )
diff --git a/examples/SimpleDetector/CMakeLists.txt b/examples/SimpleDetector/CMakeLists.txt
index 8214d2ecb..3b9ee7dee 100644
--- a/examples/SimpleDetector/CMakeLists.txt
+++ b/examples/SimpleDetector/CMakeLists.txt
@@ -8,7 +8,7 @@
 # For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
 #
 #==========================================================================
-cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
 include ( ${DD4hep_DIR}/cmake/DD4hep.cmake )
 
 #-----------------------------------------------------------------------------------
-- 
GitLab