From 5d01f48192b6f8d4738f015dcf205b0ee9e3f702 Mon Sep 17 00:00:00 2001 From: Stanislav Ershov Date: Sun, 28 Oct 2018 07:51:13 +0300 Subject: [PATCH] workaround for cmake < 3.12 --- CMakeLists.txt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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")