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 "")
86
86
set (ANDROID_STL ${FIREBASE_ANDROID_STL} )
87
87
endif ()
88
88
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
+ )
91
104
92
105
set (FIREBASE_XCODE_TARGET_FORMAT "frameworks" CACHE STRING
93
106
"Format to output, 'frameworks' or 'libraries'" )
Original file line number Diff line number Diff line change 13
13
# limitations under the License.
14
14
15
15
include (ExternalProject )
16
- include (FindPythonInterp )
17
16
18
17
if (TARGET firestore )
19
18
return ()
@@ -33,6 +32,6 @@ ExternalProject_Add(
33
32
BUILD_COMMAND ""
34
33
INSTALL_COMMAND ""
35
34
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
37
36
HTTP_HEADER "${EXTERNAL_PROJECT_HTTP_HEADER} "
38
37
)
You can’t perform that action at this time.
0 commit comments