aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/cmake/ShibokenSetup.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken6/cmake/ShibokenSetup.cmake')
-rw-r--r--sources/shiboken6/cmake/ShibokenSetup.cmake33
1 files changed, 15 insertions, 18 deletions
diff --git a/sources/shiboken6/cmake/ShibokenSetup.cmake b/sources/shiboken6/cmake/ShibokenSetup.cmake
index c9b022e1e..32823d9fa 100644
--- a/sources/shiboken6/cmake/ShibokenSetup.cmake
+++ b/sources/shiboken6/cmake/ShibokenSetup.cmake
@@ -1,21 +1,19 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
include(CheckIncludeFileCXX)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
include(ShibokenHelpers)
-option(USE_PYTHON_VERSION "Use specific python version to build shiboken6." "")
option(DISABLE_DOCSTRINGS "Disable documentation extraction." FALSE)
shiboken_internal_disable_pkg_config_if_needed()
shiboken_internal_detect_if_cross_building()
-if(SHIBOKEN_IS_CROSS_BUILD AND CMAKE_VERSION VERSION_LESS "3.17")
- # TODO: We rely on FindPython shipped with CMake 3.17+ to provide the value of Python_SOABI.
- # It might be possible to extract the Python_SOABI manually with CMake 3.16 if we reimplement
- # the logic that FindPython does in 3.17 ourselves.
- message(FATAL_ERROR "You need CMake version 3.17 or greater to cross-build.")
-endif()
+# Note: For cross building, we rely on FindPython shipped with CMake 3.17+ to
+# provide the value of Python_SOABI.
shiboken_internal_decide_parts_to_build()
shiboken_internal_find_host_shiboken_tools()
@@ -23,7 +21,7 @@ shiboken_internal_set_up_extra_dependency_paths()
set(QT_MAJOR_VERSION 6)
message(STATUS "Using Qt ${QT_MAJOR_VERSION}")
-find_package(Qt${QT_MAJOR_VERSION} 6.0 REQUIRED COMPONENTS Core)
+find_package(Qt6 REQUIRED COMPONENTS Core)
if(QUIET_BUILD)
set_quiet_build()
@@ -45,13 +43,12 @@ set(shiboken6_library_so_version "${shiboken_MAJOR_VERSION}.${shiboken_MINOR_VER
compute_config_py_values(shiboken6_VERSION)
## For debugging the PYTHON* variables
-message(STATUS "PYTHONLIBS_FOUND: " ${PYTHONLIBS_FOUND})
-message(STATUS "PYTHON_LIBRARIES: " ${PYTHON_LIBRARIES})
-message(STATUS "PYTHON_INCLUDE_DIRS: " ${PYTHON_INCLUDE_DIRS})
-message(STATUS "PYTHON_DEBUG_LIBRARIES: " ${PYTHON_DEBUG_LIBRARIES})
-message(STATUS "PYTHONINTERP_FOUND: " ${PYTHONINTERP_FOUND})
-message(STATUS "PYTHON_EXECUTABLE: " ${PYTHON_EXECUTABLE})
-message(STATUS "PYTHON_VERSION: " ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.${PYTHON_VERSION_PATCH})
+message(STATUS "Python_Development_FOUND: " ${Python_Development_FOUND})
+message(STATUS "Python_LIBRARIES: " ${Python_LIBRARIES})
+message(STATUS "Python_INCLUDE_DIRS: " ${Python_INCLUDE_DIRS})
+message(STATUS "Python_Interpreter_FOUND: " ${Python_Interpreter_FOUND})
+message(STATUS "Python_EXECUTABLE: " ${Python_EXECUTABLE})
+message(STATUS "Python_VERSION: " ${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}.${Python_VERSION_PATCH})
if(NOT PYTHON_EXTENSION_SUFFIX)
get_python_extension_suffix()
@@ -107,7 +104,7 @@ endif()
if(CMAKE_HOST_APPLE)
set(OSX_USE_LIBCPP "OFF" CACHE BOOL "Explicitly link the libc++ standard library \
- (useful for osx deployment targets lower than 10.9.")
+ (useful for macOS deployment targets lower than 10.9.")
if(OSX_USE_LIBCPP)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()
@@ -122,7 +119,7 @@ endif()
# Detect if the python libs were compiled in debug mode
# On Linux distros there is no standard way to check that.
execute_process(
- COMMAND ${PYTHON_EXECUTABLE} -c "if True:
+ COMMAND ${Python_EXECUTABLE} -c "if True:
import sys
import sysconfig
config_py_debug = sysconfig.get_config_var('Py_DEBUG')
@@ -140,7 +137,7 @@ if(SHIBOKEN_IS_CROSS_BUILD)
set(PYTHON_WITH_COUNT_ALLOCS 0)
else()
execute_process(
- COMMAND ${PYTHON_EXECUTABLE} -c "if True:
+ COMMAND ${Python_EXECUTABLE} -c "if True:
count_allocs = False
import sys
try: