DEB uncrustify: Fix Python detection on CMake < 3.12.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/4/head
Slávek Banko 3 years ago
parent 86176cf371
commit 766688b517
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -1,3 +1,9 @@
uncrustify-trinity (0.73.0-0debian11.0.0+2) unstable; urgency=medium
* Fix Python detection on CMake < 3.12.
-- Slávek Banko <slavek.banko@axis.cz> Wed, 20 May 2021 00:00:40 +0200
uncrustify-trinity (0.73.0-0debian11.0.0+1) unstable; urgency=medium
* Backported commits cb1a42dd from upstream.

@ -0,0 +1,22 @@
Fix Python detection on CMake < 3.12.
===================================================================
--- uncrustify-trinity-0.73.0.orig/CMakeLists.txt
+++ uncrustify-trinity-0.73.0/CMakeLists.txt
@@ -17,8 +17,15 @@ include(CheckCXXSymbolExists)
include(CheckTypeSize)
include(CTest)
-find_package(Python3 REQUIRED)
-set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
+if( ${CMAKE_VERSION} VERSION_LESS "3.12" )
+ find_package( PythonInterp )
+ if( NOT PYTHON_EXECUTABLE )
+ message( FATAL_ERROR "Python is required, but was not found on your system" )
+ endif()
+ else( )
+ find_package(Python3 REQUIRED)
+ set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
+endif()
#
# Check compiler flags

@ -3,3 +3,4 @@
003_allow_older_distributions.diff
004_fixed_usage.diff
005_upstream_cb1a42dd.diff
006_fix_python_detection_on_older_cmake.diff

Loading…
Cancel
Save