workaround for cmake < 3.12

This commit is contained in:
Stanislav Ershov 2018-10-28 07:51:13 +03:00
parent 7f2cb4e155
commit 5d01f48192
1 changed files with 12 additions and 1 deletions

View File

@ -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")