From 0dbc44d3887c237c800e9e274ff9870fe1989566 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 16 Jun 2020 14:06:26 +0200 Subject: [PATCH] CMake: update Python3-finding - mark for updates in 3.3: update to CMake 3.12 and use the more-modern Python modules for it then. --- CMakeLists.txt | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b643dbd51..4506e9f6c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,7 @@ # One special target is "show-version", which can be built # to obtain the version number from here. +# TODO:3.3: Require CMake 3.12 cmake_minimum_required( VERSION 3.3 FATAL_ERROR ) project( CALAMARES VERSION 3.2.26 @@ -326,15 +327,27 @@ if( NOT KF5DBusAddons_FOUND ) set( WITH_KF5DBus OFF ) endif() +# TODO:3.3: Use FindPython3 instead +find_package( PythonInterp ${PYTHONLIBS_VERSION} ) +set_package_properties( + PythonInterp PROPERTIES + DESCRIPTION "Python 3 interpreter." + URL "https://python.org" + PURPOSE "Python 3 interpreter for certain tests." +) +if ( PYTHONINTERP_FOUND ) + message(STATUS "Found Python 3 interpreter ${PYTHON_EXECUTABLE}") +endif() find_package( PythonLibs ${PYTHONLIBS_VERSION} ) set_package_properties( PythonLibs PROPERTIES DESCRIPTION "C interface libraries for the Python 3 interpreter." - URL "http://python.org" + URL "https://python.org" PURPOSE "Python 3 is used for Python job modules." ) if ( PYTHONLIBS_FOUND ) + # TODO:3.3: Require Boost + CMake; sort out Boost::Python # Since Boost provides CMake config files (starting with Boost 1.70. # or so) the mess that is the Calamares find code picks the wrong # bits. Suppress those CMake config files, as suggested by @jmrcpn @@ -345,7 +358,7 @@ if ( PYTHONLIBS_FOUND ) Boost PROPERTIES PURPOSE "Boost.Python is used for Python job modules." ) - + # TODO:3.3: Remove PythonQt support find_package( PythonQt ) set_package_properties( PythonQt PROPERTIES DESCRIPTION "A Python embedding solution for Qt applications."