Skip to content

Commit

Permalink
Configure CMake to use virtual environment Python on macOS and use 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 53c7fcd
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 }}" \
-DPython3_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 @@ -3,7 +3,8 @@

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

include(FindPython3)
find_package(Python3 REQUIRED COMPONENTS Interpreter)
message(STATUS "Using Python interpreter at ${Python3_EXECUTABLE}")

if(Python3_FOUND)
execute_process(
Expand Down

0 comments on commit 53c7fcd

Please sign in to comment.