From 1717949b5fde168a96867d7e412268272a775465 Mon Sep 17 00:00:00 2001
From: Marco Clemencic <marco.clemencic@cern.ch>
Date: Thu, 16 Apr 2020 18:12:44 +0200
Subject: [PATCH] Preset CMAKE_INSTALL_PREFIX from the toolchain

---
 LCG_97/haswell-centos7-gcc9-opt.cmake         |  2 ++
 LCG_97/x86_64+avx2+fma-centos7-gcc9-opt.cmake |  2 ++
 LCG_97/x86_64-centos7-clang8-dbg.cmake        |  1 +
 LCG_97/x86_64-centos7-clang8-opt.cmake        |  1 +
 LCG_97/x86_64-centos7-gcc9-dbg.cmake          |  1 +
 LCG_97/x86_64-centos7-gcc9-opt.cmake          |  1 +
 LCG_97_LHCB_1/haswell-centos7-gcc9-opt.cmake  | 21 +++++++++++++++++++
 .../x86_64+avx2+fma-centos7-gcc9-opt.cmake    | 21 +++++++++++++++++++
 LCG_97_LHCB_1/x86_64-centos7-gcc9-dbg.cmake   |  1 +
 LCG_97_LHCB_1/x86_64-centos7-gcc9-opt.cmake   |  1 +
 utils/new_lcg_version.py                      |  5 ++++-
 11 files changed, 56 insertions(+), 1 deletion(-)
 create mode 100644 LCG_97_LHCB_1/haswell-centos7-gcc9-opt.cmake
 create mode 100644 LCG_97_LHCB_1/x86_64+avx2+fma-centos7-gcc9-opt.cmake

diff --git a/LCG_97/haswell-centos7-gcc9-opt.cmake b/LCG_97/haswell-centos7-gcc9-opt.cmake
index 639c89c..8815786 100644
--- a/LCG_97/haswell-centos7-gcc9-opt.cmake
+++ b/LCG_97/haswell-centos7-gcc9-opt.cmake
@@ -17,3 +17,5 @@ include_guard(GLOBAL)
 
 set(LCG_ARCHITECTURE haswell)
 include(${CMAKE_CURRENT_LIST_DIR}/x86_64-centos7-gcc9-opt.cmake)
+
+set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/InstallArea/haswell-centos7-gcc9-opt")
diff --git a/LCG_97/x86_64+avx2+fma-centos7-gcc9-opt.cmake b/LCG_97/x86_64+avx2+fma-centos7-gcc9-opt.cmake
index 63692c8..a5c7591 100644
--- a/LCG_97/x86_64+avx2+fma-centos7-gcc9-opt.cmake
+++ b/LCG_97/x86_64+avx2+fma-centos7-gcc9-opt.cmake
@@ -17,3 +17,5 @@ include_guard(GLOBAL)
 
 set(LCG_ARCHITECTURE x86_64+avx2+fma)
 include(${CMAKE_CURRENT_LIST_DIR}/x86_64-centos7-gcc9-opt.cmake)
+
+set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/InstallArea/x86_64+avx2+fma-centos7-gcc9-opt")
diff --git a/LCG_97/x86_64-centos7-clang8-dbg.cmake b/LCG_97/x86_64-centos7-clang8-dbg.cmake
index 542bf1f..e3ae9dd 100644
--- a/LCG_97/x86_64-centos7-clang8-dbg.cmake
+++ b/LCG_97/x86_64-centos7-clang8-dbg.cmake
@@ -94,4 +94,5 @@ foreach(_action IN ITEMS COMPILE LINK CUSTOM)
   endif()
 endforeach()
 
+set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/InstallArea/x86_64-centos7-clang8-dbg")
 cmake_policy(POP)
diff --git a/LCG_97/x86_64-centos7-clang8-opt.cmake b/LCG_97/x86_64-centos7-clang8-opt.cmake
index 542bf1f..869f956 100644
--- a/LCG_97/x86_64-centos7-clang8-opt.cmake
+++ b/LCG_97/x86_64-centos7-clang8-opt.cmake
@@ -94,4 +94,5 @@ foreach(_action IN ITEMS COMPILE LINK CUSTOM)
   endif()
 endforeach()
 
+set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/InstallArea/x86_64-centos7-clang8-opt")
 cmake_policy(POP)
diff --git a/LCG_97/x86_64-centos7-gcc9-dbg.cmake b/LCG_97/x86_64-centos7-gcc9-dbg.cmake
index 542bf1f..2937492 100644
--- a/LCG_97/x86_64-centos7-gcc9-dbg.cmake
+++ b/LCG_97/x86_64-centos7-gcc9-dbg.cmake
@@ -94,4 +94,5 @@ foreach(_action IN ITEMS COMPILE LINK CUSTOM)
   endif()
 endforeach()
 
+set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/InstallArea/x86_64-centos7-gcc9-dbg")
 cmake_policy(POP)
diff --git a/LCG_97/x86_64-centos7-gcc9-opt.cmake b/LCG_97/x86_64-centos7-gcc9-opt.cmake
index 542bf1f..b990c09 100644
--- a/LCG_97/x86_64-centos7-gcc9-opt.cmake
+++ b/LCG_97/x86_64-centos7-gcc9-opt.cmake
@@ -94,4 +94,5 @@ foreach(_action IN ITEMS COMPILE LINK CUSTOM)
   endif()
 endforeach()
 
+set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/InstallArea/x86_64-centos7-gcc9-opt")
 cmake_policy(POP)
diff --git a/LCG_97_LHCB_1/haswell-centos7-gcc9-opt.cmake b/LCG_97_LHCB_1/haswell-centos7-gcc9-opt.cmake
new file mode 100644
index 0000000..8815786
--- /dev/null
+++ b/LCG_97_LHCB_1/haswell-centos7-gcc9-opt.cmake
@@ -0,0 +1,21 @@
+###############################################################################
+# (c) Copyright 2020 CERN for the benefit of the LHCb Collaboration           #
+#                                                                             #
+# This software is distributed under the terms of the GNU General Public      #
+# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING".   #
+#                                                                             #
+# In applying this licence, CERN does not waive the privileges and immunities #
+# granted to it by virtue of its status as an Intergovernmental Organization  #
+# or submit itself to any jurisdiction.                                       #
+###############################################################################
+
+# DO NOT EDIT: File generated by new_lcg_version.py
+
+# Make sure the toolchain is included only once
+# (to avoid double changes to the environment)
+include_guard(GLOBAL)
+
+set(LCG_ARCHITECTURE haswell)
+include(${CMAKE_CURRENT_LIST_DIR}/x86_64-centos7-gcc9-opt.cmake)
+
+set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/InstallArea/haswell-centos7-gcc9-opt")
diff --git a/LCG_97_LHCB_1/x86_64+avx2+fma-centos7-gcc9-opt.cmake b/LCG_97_LHCB_1/x86_64+avx2+fma-centos7-gcc9-opt.cmake
new file mode 100644
index 0000000..a5c7591
--- /dev/null
+++ b/LCG_97_LHCB_1/x86_64+avx2+fma-centos7-gcc9-opt.cmake
@@ -0,0 +1,21 @@
+###############################################################################
+# (c) Copyright 2020 CERN for the benefit of the LHCb Collaboration           #
+#                                                                             #
+# This software is distributed under the terms of the GNU General Public      #
+# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING".   #
+#                                                                             #
+# In applying this licence, CERN does not waive the privileges and immunities #
+# granted to it by virtue of its status as an Intergovernmental Organization  #
+# or submit itself to any jurisdiction.                                       #
+###############################################################################
+
+# DO NOT EDIT: File generated by new_lcg_version.py
+
+# Make sure the toolchain is included only once
+# (to avoid double changes to the environment)
+include_guard(GLOBAL)
+
+set(LCG_ARCHITECTURE x86_64+avx2+fma)
+include(${CMAKE_CURRENT_LIST_DIR}/x86_64-centos7-gcc9-opt.cmake)
+
+set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/InstallArea/x86_64+avx2+fma-centos7-gcc9-opt")
diff --git a/LCG_97_LHCB_1/x86_64-centos7-gcc9-dbg.cmake b/LCG_97_LHCB_1/x86_64-centos7-gcc9-dbg.cmake
index 542bf1f..2937492 100644
--- a/LCG_97_LHCB_1/x86_64-centos7-gcc9-dbg.cmake
+++ b/LCG_97_LHCB_1/x86_64-centos7-gcc9-dbg.cmake
@@ -94,4 +94,5 @@ foreach(_action IN ITEMS COMPILE LINK CUSTOM)
   endif()
 endforeach()
 
+set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/InstallArea/x86_64-centos7-gcc9-dbg")
 cmake_policy(POP)
diff --git a/LCG_97_LHCB_1/x86_64-centos7-gcc9-opt.cmake b/LCG_97_LHCB_1/x86_64-centos7-gcc9-opt.cmake
index 542bf1f..b990c09 100644
--- a/LCG_97_LHCB_1/x86_64-centos7-gcc9-opt.cmake
+++ b/LCG_97_LHCB_1/x86_64-centos7-gcc9-opt.cmake
@@ -94,4 +94,5 @@ foreach(_action IN ITEMS COMPILE LINK CUSTOM)
   endif()
 endforeach()
 
+set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/InstallArea/x86_64-centos7-gcc9-opt")
 cmake_policy(POP)
diff --git a/utils/new_lcg_version.py b/utils/new_lcg_version.py
index acd1318..0fd575d 100755
--- a/utils/new_lcg_version.py
+++ b/utils/new_lcg_version.py
@@ -122,7 +122,7 @@ def _entry_point(version, platform):
         platform, lcg_platform = platform.split("=", 1)
         architecture = platform.split("-")[0]
         return TOOLCHAIN_ALIAS.format(
-            architecture=architecture, lcg_platform=lcg_platform
+            platform=platform, architecture=architecture, lcg_platform=lcg_platform
         )
     else:
         return TOOLCHAIN_ENTRY_POINT.format(version=version, platform=platform)
@@ -340,6 +340,7 @@ foreach(_action IN ITEMS COMPILE LINK CUSTOM)
   endif()
 endforeach()
 
+set(CMAKE_INSTALL_PREFIX "${{CMAKE_SOURCE_DIR}}/InstallArea/{platform}")
 cmake_policy(POP)
 """
 
@@ -349,6 +350,8 @@ include_guard(GLOBAL)
 
 set(LCG_ARCHITECTURE {architecture})
 include(${{CMAKE_CURRENT_LIST_DIR}}/{lcg_platform}.cmake)
+
+set(CMAKE_INSTALL_PREFIX "${{CMAKE_SOURCE_DIR}}/InstallArea/{platform}")
 """
 
 LCG_PACKAGE_PATH = "${{LCG_releases_base}}/{directory}/{version}-{hash}/{platform}"
-- 
GitLab