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.
This commit is contained in:
Adriaan de Groot 2020-06-16 14:06:26 +02:00
parent 62e7128ff6
commit 0dbc44d388

View File

@ -42,6 +42,7 @@
# One special target is "show-version", which can be built # One special target is "show-version", which can be built
# to obtain the version number from here. # to obtain the version number from here.
# TODO:3.3: Require CMake 3.12
cmake_minimum_required( VERSION 3.3 FATAL_ERROR ) cmake_minimum_required( VERSION 3.3 FATAL_ERROR )
project( CALAMARES project( CALAMARES
VERSION 3.2.26 VERSION 3.2.26
@ -326,15 +327,27 @@ if( NOT KF5DBusAddons_FOUND )
set( WITH_KF5DBus OFF ) set( WITH_KF5DBus OFF )
endif() 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} ) find_package( PythonLibs ${PYTHONLIBS_VERSION} )
set_package_properties( set_package_properties(
PythonLibs PROPERTIES PythonLibs PROPERTIES
DESCRIPTION "C interface libraries for the Python 3 interpreter." 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." PURPOSE "Python 3 is used for Python job modules."
) )
if ( PYTHONLIBS_FOUND ) if ( PYTHONLIBS_FOUND )
# TODO:3.3: Require Boost + CMake; sort out Boost::Python
# Since Boost provides CMake config files (starting with Boost 1.70. # Since Boost provides CMake config files (starting with Boost 1.70.
# or so) the mess that is the Calamares find code picks the wrong # or so) the mess that is the Calamares find code picks the wrong
# bits. Suppress those CMake config files, as suggested by @jmrcpn # bits. Suppress those CMake config files, as suggested by @jmrcpn
@ -345,7 +358,7 @@ if ( PYTHONLIBS_FOUND )
Boost PROPERTIES Boost PROPERTIES
PURPOSE "Boost.Python is used for Python job modules." PURPOSE "Boost.Python is used for Python job modules."
) )
# TODO:3.3: Remove PythonQt support
find_package( PythonQt ) find_package( PythonQt )
set_package_properties( PythonQt PROPERTIES set_package_properties( PythonQt PROPERTIES
DESCRIPTION "A Python embedding solution for Qt applications." DESCRIPTION "A Python embedding solution for Qt applications."