From 76fef90d17de0130af701e69b58d220900711b21 Mon Sep 17 00:00:00 2001 From: Julien Date: Thu, 22 Feb 2024 17:22:40 +0100 Subject: [PATCH] add python_install_package as ccmake option, adapt example test --- .github/workflows/test_examples.yml | 2 +- CMakeLists.txt | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_examples.yml b/.github/workflows/test_examples.yml index 96e7e0eb8..ac5621e72 100644 --- a/.github/workflows/test_examples.yml +++ b/.github/workflows/test_examples.yml @@ -33,7 +33,7 @@ jobs: run: | mkdir build cd build - cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/.local -DENABLE_PYTHON=True -DPython_EXECUTABLE=${{ matrix.config.py }} -DENABLE_TESTING=Off -DENABLE_SWIG_BUILTIN=${{ matrix.config.swig_builtin }} -DSIMD_EXTENSIONS=native + cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/.local -DENABLE_PYTHON=True -DPython_EXECUTABLE=${{ matrix.config.py }} -DENABLE_TESTING=Off -DENABLE_SWIG_BUILTIN=${{ matrix.config.swig_builtin }} -DSIMD_EXTENSIONS=native -DPython_INSTALL_PACKAGE_DIR=/home/runner/.local/ - name: Build CRPropa run: | cd build diff --git a/CMakeLists.txt b/CMakeLists.txt index 06f1a1aac..0b0082f32 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -466,9 +466,7 @@ if(ENABLE_PYTHON AND Python_FOUND) # use Python_INSTALL_PACKAGE_DIR if provided; otherwise, install in Python_SITELIB - if(NOT DEFINED Python_INSTALL_PACKAGE_DIR) - set(Python_INSTALL_PACKAGE_DIR "${Python_SITELIB}") - endif(NOT DEFINED Python_INSTALL_PACKAGE_DIR) + set(Python_INSTALL_PACKAGE_DIR "${Python_SITELIB}" CACHE PATH "folder in which the python package is installed") message(STATUS " package install directory: ${Python_INSTALL_PACKAGE_DIR}")