Skip to content

Commit

Permalink
works with venv
Browse files Browse the repository at this point in the history
  • Loading branch information
saosebastiao committed May 22, 2024
1 parent e98c054 commit fbf0fe9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,20 @@ include(px4_add_module)
set(config_module_list)
set(config_kernel_list)

## update the environment with VIRTUAL_ENV variable (mimic the activate script)
set (ENV{VIRTUAL_ENV} venv)
## change the context of the search
set (Python3_FIND_VIRTUALENV ONLY)
# Find Python3
set (Python3_FIND_VIRTUALENV "ONLY")
find_package(Python3 COMPONENTS Interpreter Development)
find_package(Python3 COMPONENTS Interpreter)
# We have a custom error message to tell users how to install python3.
if(NOT Python3_FOUND)
message(FATAL_ERROR "Python 3 not found. Please install Python 3:\n"
" Ubuntu: sudo apt install python3 python3-dev python3-pip\n"
" macOS: brew install python")
endif()

## Launch a new search
option(PYTHON_COVERAGE "Python code coverage" OFF)
if(PYTHON_COVERAGE)
message(STATUS "python coverage enabled")
Expand Down

0 comments on commit fbf0fe9

Please sign in to comment.