From 2dccaf5f43df6f46673b7747ae2c957dcc5b32f3 Mon Sep 17 00:00:00 2001 From: tmadlener Date: Tue, 11 Jun 2024 16:53:53 +0200 Subject: [PATCH] Make the python install prefix conform to python conventions --- python/CMakeLists.txt | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 975151925..cd048d253 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -1,4 +1,20 @@ -install(DIRECTORY edm4hep DESTINATION python +find_package(Python3 REQUIRED) + +# Setup the python install dir. See the discussion in +# https://github.com/AIDASoft/podio/pull/599 for more details on why this is +# done the way it is +set(edm4hep_python_lib_dir lib) +if("${Python3_SITEARCH}" MATCHES "/lib64/") + set(edm4hep_python_lib_dir lib64) +endif() + +set(EDM4HEP_PYTHON_INSTALLDIR + "${CMAKE_INSTALL_PREFIX}/${edm4hep_python_lib_dir}/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages" + CACHE STRING + "The install prefix for the python bindings" +) + +install(DIRECTORY edm4hep DESTINATION ${EDM4HEP_PYTHON_INSTALLDIR} REGEX .*\\.in EXCLUDE PATTERN __pycache__ EXCLUDE )