Skip to content

Commit

Permalink
Configure CMake to use virtual environment Python on macOS and add Py…
Browse files Browse the repository at this point in the history
…thon3 executable path in CMakeTest
  • Loading branch information
olszomal committed Nov 4, 2024
1 parent 5ae7a47 commit 9689064
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
17 changes: 16 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,22 @@ jobs:
python.exe -m pip install --upgrade pip
python.exe -m pip install cryptography
- name: Configure CMake
- name: Configure CMake (macOS)
if: runner.os == 'macOS'
run: |
source venv/bin/activate
cmake \
-G "${{ matrix.generator }}" \
-S "${{ github.workspace }}" \
-B "${{ github.workspace }}/build" \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DCMAKE_BUILD_TYPE="${{ env.BUILD_TYPE }}" \
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/dist" \
-DVCPKG_TARGET_TRIPLET="${{ matrix.triplet }}" \
-DPYTHON_EXECUTABLE="${{ github.workspace }}/venv/bin/python"
- name: Configure CMake (non-macOS)
if: runner.os != 'macOS'
run: cmake
-G "${{matrix.generator}}"
-S ${{github.workspace}}
Expand Down
3 changes: 2 additions & 1 deletion cmake/CMakeTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
# ctest -C Release

########## Configure ##########

set(PYTHON_EXECUTABLE "${CMAKE_SOURCE_DIR}/venv/bin/python")
include(FindPython3)
message(STATUS "Using Python interpreter at ${Python3_EXECUTABLE}")

if(Python3_FOUND)
execute_process(
Expand Down

0 comments on commit 9689064

Please sign in to comment.