File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -86,8 +86,21 @@ if (NOT FIREBASE_ANDROID_STL STREQUAL "")
8686 set (ANDROID_STL ${FIREBASE_ANDROID_STL} )
8787endif ()
8888
89- set (FIREBASE_PYTHON_EXECUTABLE "python" CACHE FILEPATH
90- "The Python interpreter to use, such as one from a venv" )
89+ # Find a Python interpreter using the best available mechanism.
90+ if (${CMAKE_VERSION} VERSION_LESS "3.12" )
91+ include (FindPythonInterp)
92+ set (DEFAULT_FIREBASE_PYTHON_EXECUTABLE "${PYTHON_EXECUTABLE} " )
93+ else ()
94+ find_package (Python3 COMPONENTS Interpreter)
95+ set (DEFAULT_FIREBASE_PYTHON_EXECUTABLE "${Python3_EXECUTABLE} " )
96+ endif ()
97+
98+ set (
99+ FIREBASE_PYTHON_EXECUTABLE
100+ "${DEFAULT_FIREBASE_PYTHON_EXECUTABLE} "
101+ CACHE FILEPATH
102+ "The Python interpreter to use"
103+ )
91104
92105set (FIREBASE_XCODE_TARGET_FORMAT "frameworks" CACHE STRING
93106 "Format to output, 'frameworks' or 'libraries'" )
Original file line number Diff line number Diff line change 1313# limitations under the License.
1414
1515include (ExternalProject)
16- include (FindPythonInterp)
1716
1817if (TARGET firestore)
1918 return ()
@@ -33,6 +32,6 @@ ExternalProject_Add(
3332 BUILD_COMMAND ""
3433 INSTALL_COMMAND ""
3534 TEST_COMMAND ""
36- PATCH_COMMAND ${PYTHON_EXECUTABLE } ${CMAKE_CURRENT_LIST_DIR} /firestore_patch.py --leveldb-version -from ${CMAKE_CURRENT_LIST_DIR} /leveldb.cmake
35+ PATCH_COMMAND ${FIREBASE_PYTHON_EXECUTABLE } ${CMAKE_CURRENT_LIST_DIR} /firestore_patch.py --leveldb-version -from ${CMAKE_CURRENT_LIST_DIR} /leveldb.cmake
3736 HTTP_HEADER "${EXTERNAL_PROJECT_HTTP_HEADER} "
3837)
You can’t perform that action at this time.
0 commit comments