Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion cmake/python_setup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,24 @@ function(FirebaseSetupPythonInterpreter)
"The Python interpreter on the host system to use"
)

# Use a custom directory for the pyvenv directories, if specified.
set(
FIREBASE_PYTHON_PYVENV_DEST_DIR
""
CACHE FILEPATH
"The directory into which to create the Python virtualenv in FirebaseSetupPythonInterpreter"
)

# Check if the virtualenv is already up-to-date by examining the contents of
# its stamp files. The stamp files store the path of the host Python
# interpreter and the dependencies that were installed by pip. If both of
# these files exist and contain the same Python interpreter and dependencies
# then just re-use the virtualenv; otherwise, re-create it.
set(PYVENV_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/pyvenv/${ARG_KEY}")
if("${FIREBASE_PYTHON_PYVENV_DEST_DIR}" STREQUAL "")
set(PYVENV_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/pyvenv/${ARG_KEY}")
else()
set(PYVENV_DIRECTORY "${FIREBASE_PYTHON_PYVENV_DEST_DIR}/${ARG_KEY}")
endif()
set(STAMP_FILE1 "${PYVENV_DIRECTORY}/cmake_firebase_python_stamp1.txt")
set(STAMP_FILE2 "${PYVENV_DIRECTORY}/cmake_firebase_python_stamp2.txt")

Expand Down