Skip to content

Commit e7cf14f

Browse files
committed
fix: don't autodetect .venv if inside a VIRTUALENV already
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 03170bb commit e7cf14f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ if(PYBIND11_MASTER_PROJECT)
126126
if(NOT DEFINED Python3_EXECUTABLE
127127
AND NOT DEFINED Python_EXECUTABLE
128128
AND NOT DEFINED Python_ROOT_SIR
129+
AND NOT DEFINED ENV{VIRTUALENV}
129130
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.venv")
130131
message(STATUS "Autodetecting Python in virtual environment")
131132
set(Python_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/.venv")

0 commit comments

Comments
 (0)