Use environment variables.
@@ -118,11 +118,14 @@ jobs:
shell: bash
working-directory: ${{runner.workspace}}/build
run: |
+ INCLUDE_DIR=$(python -c "from sysconfig import get_paths; print(get_paths()['include'])")
if [ "$RUNNER_OS" == "Windows" ]; then
- cmake $GITHUB_WORKSPACE -A x64 -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DTINYSPLINE_ENABLE_PYTHON=True -DPYTHON_INCLUDE_DIR="$(python -c "from sysconfig import get_paths; print(get_paths()['include'])")" -DPYTHON_LIBRARY="$(python -c "from sysconfig import get_paths; print(get_paths()['include'])")/../libs/python$(echo ${{ matrix.python }} | cut -d'.' -f1-2 | tr -d '.').lib"
+ LIBRARY=$INCLUDE_DIR/../libs/python$(echo ${{ matrix.python }} | cut -d'.' -f1-2 | tr -d '.').lib
+ cmake $GITHUB_WORKSPACE -A x64 -DCMAKE_BUILD_TYPE=$BUILD_TYPE
else
- cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DTINYSPLINE_ENABLE_PYTHON=True -DPYTHON_INCLUDE_DIR="$(python -c "from sysconfig import get_paths; print(get_paths()['include'])")" -DPYTHON_LIBRARY=($(python -c "from sysconfig import get_paths; print(get_paths()['include'])")/../../lib/*.dylib)
+ LIBRARY=($INCLUDE_DIR/../../lib/*.dylib)
fi
+ cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DTINYSPLINE_ENABLE_PYTHON=True -DPYTHON_INCLUDE_DIR="$INCLUDE_DIR" -DPYTHON_LIBRARY="$LIBRARY"
- name: Build
working-directory: ${{runner.workspace}}/build
