diff options
Diffstat (limited to 'sources/pyside6/cmake/PySideSetup.cmake')
-rw-r--r-- | sources/pyside6/cmake/PySideSetup.cmake | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/sources/pyside6/cmake/PySideSetup.cmake b/sources/pyside6/cmake/PySideSetup.cmake index a167f4ddd..038dc1642 100644 --- a/sources/pyside6/cmake/PySideSetup.cmake +++ b/sources/pyside6/cmake/PySideSetup.cmake @@ -1,3 +1,6 @@ +# Copyright (C) 2023 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + # Don't ignore targets that do not exist, inside add_dependencies calls. cmake_policy(SET CMP0046 NEW) @@ -40,6 +43,10 @@ pyside_internal_set_up_extra_dependency_paths() pyside_internal_find_host_shiboken_tools() find_package(Shiboken6 6 CONFIG REQUIRED) +if(is_pyside6_superproject_build) + shiboken_find_required_python() +endif() + set(BINDING_API_MAJOR_VERSION "${pyside_MAJOR_VERSION}") set(BINDING_API_MINOR_VERSION "${pyside_MINOR_VERSION}") set(BINDING_API_MICRO_VERSION "${pyside_MICRO_VERSION}") @@ -48,7 +55,7 @@ set(BINDING_API_PRE_RELEASE_VERSION "${pyside_PRE_RELEASE_VERSION}") # Detect if the Python interpreter is actually PyPy execute_process( - COMMAND ${PYTHON_EXECUTABLE} -c "if True: + COMMAND ${Python_EXECUTABLE} -c "if True: pypy_version = '' import sys if hasattr(sys, 'pypy_version_info'): @@ -90,7 +97,7 @@ if(QFP_QT_HOST_PATH) endif() endif() endif() -find_package(Qt${QT_MAJOR_VERSION} 6.0 REQUIRED COMPONENTS Core) +find_package(Qt6 REQUIRED COMPONENTS Core) add_definitions(${Qt${QT_MAJOR_VERSION}Core_DEFINITIONS}) @@ -100,7 +107,7 @@ set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" ) set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is /lib${LIB_SUFFIX})" FORCE) if(CMAKE_HOST_APPLE) set(ALTERNATIVE_QT_INCLUDE_DIR "" CACHE PATH "Deprecated. CMake now finds the proper include dir itself.") - set(OSX_USE_LIBCPP "OFF" CACHE BOOL "Explicitly link the libc++ standard library (useful for osx deployment targets lower than 10.9.") + set(OSX_USE_LIBCPP "OFF" CACHE BOOL "Explicitly link the libc++ standard library (useful for macOS deployment targets lower than 10.9.") if(OSX_USE_LIBCPP) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") endif() @@ -177,7 +184,7 @@ foreach(m ${DISABLED_MODULES}) endforeach() # Whether to add libpysideqml -find_package(Qt${QT_MAJOR_VERSION}Qml) +find_package(Qt6 COMPONENTS Qml) string(REGEX MATCHALL "[0-9]+" qt_version_helper "${Qt${QT_MAJOR_VERSION}Core_VERSION}") @@ -211,13 +218,20 @@ if(NOT TARGET uninstall) -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") endif() -shiboken_internal_set_python_site_packages() +if(NOT PYTHON_SITE_PACKAGES) + shiboken_internal_set_python_site_packages() +endif() + +shiboken_get_debug_level(debug_level) -set(GENERATOR_EXTRA_FLAGS --generator-set=shiboken - --enable-parent-ctor-heuristic - --enable-pyside-extensions - --enable-return-value-heuristic - --use-isnull-as-nb_nonzero) +set(GENERATOR_EXTRA_FLAGS + ${SHIBOKEN_GENERATOR_EXTRA_FLAGS} + ${debug_level} + --generator-set=shiboken + --enable-parent-ctor-heuristic + --enable-pyside-extensions + --enable-return-value-heuristic + --use-isnull-as-nb-bool) use_protected_as_public_hack() # Build with Address sanitizer enabled if requested. This may break things, so use at your own risk. @@ -225,5 +239,5 @@ if(SANITIZE_ADDRESS AND NOT MSVC) setup_sanitize_address() endif() -find_package(Qt${QT_MAJOR_VERSION}Designer) +find_package(Qt6 COMPONENTS Designer) |