From bdc8e2fe05556914300a0bac665438d47cc67631 Mon Sep 17 00:00:00 2001 From: mliszcz Date: Mon, 28 Jan 2019 19:52:18 +0100 Subject: [PATCH] Use python2 (if available) to run cxxtestgen --- cpp_test_suite/cxxtest/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cpp_test_suite/cxxtest/CMakeLists.txt b/cpp_test_suite/cxxtest/CMakeLists.txt index c7f7c9f76..1d9a1b93e 100644 --- a/cpp_test_suite/cxxtest/CMakeLists.txt +++ b/cpp_test_suite/cxxtest/CMakeLists.txt @@ -1,8 +1,10 @@ find_package (Threads REQUIRED) +find_program(PYTHON_INTERPRETER NAMES python2 python) macro(CXX_GENERATE_TEST name) message("Generate ${name}.cpp") - execute_process(COMMAND python cxxtestgen.py --template=${CMAKE_CURRENT_SOURCE_DIR}/template/tango_template.tpl + execute_process(COMMAND "${PYTHON_INTERPRETER}" cxxtestgen.py + --template=${CMAKE_CURRENT_SOURCE_DIR}/template/tango_template.tpl -o ${CMAKE_CURRENT_SOURCE_DIR}/${name}.cpp ../../new_tests/${name}.cpp WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)