diff --git a/CMakeLists.txt b/CMakeLists.txt index e170ea596..aa9413ae0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,7 +68,18 @@ find_package(ZLIB REQUIRED) find_package(FFmpeg REQUIRED) find_package(Opus REQUIRED) find_package(Qt5 COMPONENTS Core Gui Widgets Network REQUIRED) -find_package(Python3 REQUIRED) + +if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.12.0") + find_package(Python3 REQUIRED) +else() + # TODO: remove when we will update cmake required version + find_package(PythonInterp) + if((PYTHONINTERP_FOUND) AND (PYTHON_VERSION_MAJOR GREATER 2)) + set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE}) + else() + message(FATAL_ERROR "Python 3 is required") + endif() +endif() if (NOT SWSCALE_FOUND) message(FATAL_ERROR "FFmpeg swscale is required")