blob: 3b11610d95191d15c65e49a5f1be50755f771747 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
|