diff --git a/cmake/FindSIP.cmake b/cmake/FindSIP.cmake index b3374c7c9beb..934df58e9b5a 100644 --- a/cmake/FindSIP.cmake +++ b/cmake/FindSIP.cmake @@ -38,6 +38,8 @@ ELSE(SIP_VERSION) STRING(REGEX REPLACE "^sip_version:([^\n]+).*$" "\\1" SIP_VERSION ${sip_config}) STRING(REGEX REPLACE ".*\nsip_version_num:([^\n]+).*$" "\\1" SIP_VERSION_NUM ${sip_config}) STRING(REGEX REPLACE ".*\nsip_version_str:([^\n]+).*$" "\\1" SIP_VERSION_STR ${sip_config}) + STRING(REGEX REPLACE ".*\nsip_abi12_version_str:([^\n]+).*$" "\\1" SIP_ABI12_VERSION_STR ${sip_config}) + STRING(REGEX REPLACE ".*\nsip_abi13_version_str:([^\n]+).*$" "\\1" SIP_ABI13_VERSION_STR ${sip_config}) STRING(REGEX REPLACE ".*\ndefault_sip_dir:([^\n]+).*$" "\\1" SIP_DEFAULT_SIP_DIR ${sip_config}) IF(NOT SIP_FIND_QUIETLY) MESSAGE(STATUS "Found SIP version: ${SIP_VERSION_STR}") diff --git a/cmake/FindSIP.py b/cmake/FindSIP.py index 01ff1469528e..99ab743ec21c 100644 --- a/cmake/FindSIP.py +++ b/cmake/FindSIP.py @@ -35,6 +35,8 @@ print("sip_version:%06.0x" % sipbuild.version.SIP_VERSION) print("sip_version_num:%d" % sipbuild.version.SIP_VERSION) print("sip_version_str:%s" % sipbuild.version.SIP_VERSION_STR) + print("sip_abi13_version_str:%s" % sipbuild.module.abi_version.get_sip_module_version('13')) + print("sip_abi12_version_str:%s" % sipbuild.module.abi_version.get_sip_module_version('12')) import sysconfig diff --git a/cmake/SIPMacros.cmake b/cmake/SIPMacros.cmake index 674dcf4a1958..a18aa999176f 100644 --- a/cmake/SIPMacros.cmake +++ b/cmake/SIPMacros.cmake @@ -65,9 +65,7 @@ MACRO(GENERATE_SIP_PYTHON_MODULE_CODE MODULE_NAME MODULE_SIP SIP_FILES CPP_FILES CONFIGURE_FILE(${_sip_file} ${_out_sip_file}) # Deprecated annotation supports message only since ABI >= 12.16 or ABI >= 13.9 - # TODO: evaluate ABI version once it's available from upstream - # i.e. `if(${SIP_ABI_VERSION_STR} VERSION_LESS 13.9)` - if(TRUE) + if((BUILD_WITH_QT6 AND (${SIP_ABI13_VERSION_STR} VERSION_LESS 13.9)) OR (NOT BUILD_WITH_QT6 AND (${SIP_ABI12_VERSION_STR} VERSION_LESS 12.16))) file(READ ${_out_sip_file} _content) string(REGEX REPLACE "([/,])Deprecated=\"[^\"]*\"([/,])" "\\1Deprecated\\2" _content "${_content}") file(GENERATE OUTPUT ${_out_sip_file} CONTENT "${_content}")