From d0b7ec0fbe2936158bb744027892664dd3336828 Mon Sep 17 00:00:00 2001
From: Marko Petric <marko.petric@cern.ch>
Date: Tue, 24 Sep 2019 17:01:41 +0200
Subject: [PATCH] Install python files into usr/pythonX.Y//site-packages

---
 DDCore/CMakeLists.txt | 2 +-
 DDDigi/CMakeLists.txt | 2 +-
 DDG4/CMakeLists.txt   | 4 ++--
 DDRec/CMakeLists.txt  | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/DDCore/CMakeLists.txt b/DDCore/CMakeLists.txt
index 8c08055ae..b7ad600aa 100644
--- a/DDCore/CMakeLists.txt
+++ b/DDCore/CMakeLists.txt
@@ -116,7 +116,7 @@ ENDIF()
 
 # install python files
 file(GLOB DDCore_Python python/*.py)
-install(FILES ${DDCore_Python} DESTINATION python)
+install(FILES ${DDCore_Python} DESTINATION lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages)
 
 # install header files
 install(DIRECTORY
diff --git a/DDDigi/CMakeLists.txt b/DDDigi/CMakeLists.txt
index 1816c2c3f..fd92ab9d8 100644
--- a/DDDigi/CMakeLists.txt
+++ b/DDDigi/CMakeLists.txt
@@ -52,7 +52,7 @@ dd4hep_add_plugin(DDDigiPlugins
 set_target_properties(DDDigi DDDigiPlugins PROPERTIES VERSION ${DD4hep_VERSION} SOVERSION ${DD4hep_SOVERSION})
 
 file(GLOB DDigi_python python/*.py python/*.C)
-install(FILES ${DDigi_python} DESTINATION python)
+install(FILES ${DDigi_python} DESTINATION lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages)
 install(TARGETS DDDigi DDDigiPlugins EXPORT DD4hep LIBRARY DESTINATION lib)
 install(DIRECTORY include/DDDigi DESTINATION include)
 
diff --git a/DDG4/CMakeLists.txt b/DDG4/CMakeLists.txt
index 68b710442..bc42b6408 100644
--- a/DDG4/CMakeLists.txt
+++ b/DDG4/CMakeLists.txt
@@ -120,10 +120,10 @@ target_link_libraries(g4FromXML DDG4)
 
 #---Package installation procedure(s) ----------------------------------------------
 file(GLOB DDG4_python python/*.py python/*.C)
-install(FILES ${DDG4_python} DESTINATION python)
+install(FILES ${DDG4_python} DESTINATION lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages)
 
 install(PROGRAMS python/DDSim/bin/ddsim DESTINATION bin)
-install(DIRECTORY python/DDSim DESTINATION python)
+install(DIRECTORY python/DDSim DESTINATION lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages)
 
 install(DIRECTORY examples DESTINATION examples/DDG4)
 
diff --git a/DDRec/CMakeLists.txt b/DDRec/CMakeLists.txt
index fe0f4fb4c..b7c4533a0 100644
--- a/DDRec/CMakeLists.txt
+++ b/DDRec/CMakeLists.txt
@@ -73,6 +73,6 @@ endif()
 set_target_properties(DDRec DDRecPlugins PROPERTIES VERSION ${DD4hep_VERSION} SOVERSION ${DD4hep_SOVERSION})
 
 file(GLOB DDRec_python python/*.py)
-install(FILES ${DDRec_python} DESTINATION python)
+install(FILES ${DDRec_python} DESTINATION lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages)
 install(DIRECTORY include/DDRec DESTINATION include)
 install(TARGETS DDRec DDRecPlugins EXPORT DD4hep LIBRARY DESTINATION lib)
-- 
GitLab