From c81ee9072065db05647a91a078de407c1aafd22f Mon Sep 17 00:00:00 2001
From: Amin Bandali <amin.bandali@savoirfairelinux.com>
Date: Wed, 6 Oct 2021 13:28:05 -0400
Subject: [PATCH] cmake: use FindPython3 on cmake >= 3.12.0 to require Python 3

Change-Id: Ic67188880997ee447bb12b53ee4c9455c1182200
---
 CMakeLists.txt | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7f22cf518..2577747bb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,7 +29,12 @@ file(GLOB_RECURSE
     RES_FILES CONFIGURE_DEPENDS
     ${PROJECT_SOURCE_DIR}/resources/*
 )
-include(FindPythonInterp)
+if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12.0")
+    include(FindPython3)
+    find_package (Python3 COMPONENTS Interpreter)
+else()
+    include(FindPythonInterp)
+endif()
 execute_process(
     COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/gen-resources.py
     WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
-- 
GitLab