Missed actually using the new variables from the new calls to get Python
diff --git a/compiler/cpp/test/CMakeLists.txt b/compiler/cpp/test/CMakeLists.txt
index e042257..beed6ea 100644
--- a/compiler/cpp/test/CMakeLists.txt
+++ b/compiler/cpp/test/CMakeLists.txt
@@ -32,7 +32,7 @@
find_package(Python3 COMPONENTS Interpreter QUIET)
if(Python3_Interpreter_FOUND)
- add_test(NAME StalenessCheckTest COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/compiler/staleness_check.py ${THRIFT_COMPILER})
+ add_test(NAME StalenessCheckTest COMMAND Python3::Interpreter ${CMAKE_CURRENT_SOURCE_DIR}/compiler/staleness_check.py ${THRIFT_COMPILER})
else()
message(WARNING "Skipping StalenessCheckTest as there is no python interpreter available.")
endif()
diff --git a/lib/py/CMakeLists.txt b/lib/py/CMakeLists.txt
index 9c4368b..7c0e381 100644
--- a/lib/py/CMakeLists.txt
+++ b/lib/py/CMakeLists.txt
@@ -17,21 +17,21 @@
# under the License.
#
-include_directories(${PYTHON_INCLUDE_DIRS})
+include_directories(${Python3_INCLUDE_DIRS})
add_custom_target(python_build ALL
COMMAND ${THRIFT_COMPILER} --gen py test/test_thrift_file/TestServer.thrift
- COMMAND ${PYTHON_EXECUTABLE} setup.py build
+ COMMAND Python3::Interpreter setup.py build
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Building Python library"
)
if(BUILD_TESTING)
- add_test(PythonTestSSLSocket ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/test_sslsocket.py)
- add_test(PythonThriftJson ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/thrift_json.py)
- add_test(PythonThriftTransport ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/thrift_transport.py)
- add_test(PythonThriftTBinaryProtocol ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/thrift_TBinaryProtocol.py)
- add_test(PythonThriftTZlibTransport ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/thrift_TZlibTransport.py)
- add_test(PythonThriftProtocol ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/thrift_TCompactProtocol.py)
- add_test(PythonThriftTNonblockingServer ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/thrift_TNonblockingServer.py)
+ add_test(NAME PythonTestSSLSocket COMMAND Python3::Interpreter ${CMAKE_CURRENT_SOURCE_DIR}/test/test_sslsocket.py)
+ add_test(NAME PythonThriftJson COMMAND Python3::Interpreter ${CMAKE_CURRENT_SOURCE_DIR}/test/thrift_json.py)
+ add_test(NAME PythonThriftTransport COMMAND Python3::Interpreter ${CMAKE_CURRENT_SOURCE_DIR}/test/thrift_transport.py)
+ add_test(NAME PythonThriftTBinaryProtocol COMMAND Python3::Interpreter ${CMAKE_CURRENT_SOURCE_DIR}/test/thrift_TBinaryProtocol.py)
+ add_test(NAME PythonThriftTZlibTransport COMMAND Python3::Interpreter ${CMAKE_CURRENT_SOURCE_DIR}/test/thrift_TZlibTransport.py)
+ add_test(NAME PythonThriftProtocol COMMAND Python3::Interpreter ${CMAKE_CURRENT_SOURCE_DIR}/test/thrift_TCompactProtocol.py)
+ add_test(NAME PythonThriftTNonblockingServer COMMAND Python3::Interpreter ${CMAKE_CURRENT_SOURCE_DIR}/test/thrift_TNonblockingServer.py)
endif()
diff --git a/test/py/CMakeLists.txt b/test/py/CMakeLists.txt
index fbc2217..e9462e7 100644
--- a/test/py/CMakeLists.txt
+++ b/test/py/CMakeLists.txt
@@ -27,7 +27,7 @@
)
add_test(NAME python_test
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/RunClientServer.py --gen-base=${CMAKE_CURRENT_BINARY_DIR}
+ COMMAND Python3::Interpreter ${CMAKE_CURRENT_SOURCE_DIR}/RunClientServer.py --gen-base=${CMAKE_CURRENT_BINARY_DIR}
DEPENDS python_test_generate
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)