tests/CMakeLists.txt: Fix trying to run tests even if no python interpreter is available
@@ -15,10 +15,9 @@ if (BUILDSWIGPYTHON)
elseif (PYTHON3INTERP_FOUND AND EXISTS "${CMAKE_BINARY_DIR}/src/python/python3/mraa.py")
set (PYTHON_DEFAULT_PYTHONPATH "${CMAKE_BINARY_DIR}/src/python/python3")
set (PYTHON_DEFAULT_INTERP "${PYTHON3_EXECUTABLE}")
- else ()
- message (STATUS "Could not run tests since python interpreter or python bindings not built")
endif ()
+ if (DEFINED PYTHON_DEFAULT_INTERP)
if (MOCKPLAT)
add_subdirectory (mock)
else ()
@@ -31,4 +30,7 @@ if (BUILDSWIGPYTHON)
add_test (NAME py_gpio COMMAND ${PYTHON_DEFAULT_INTERP} ${CMAKE_CURRENT_SOURCE_DIR}/gpio_checks.py)
set_tests_properties(py_gpio PROPERTIES ENVIRONMENT "PYTHONPATH=${PYTHON_DEFAULT_PYTHONPATH}")
endif ()
+ else ()
+ message (STATUS "Could not run tests since python interpreter or python bindings not built")
+ endif ()
endif ()
