diff --git a/cMake/FreeCAD_Helpers/SetupShibokenAndPyside.cmake b/cMake/FreeCAD_Helpers/SetupShibokenAndPyside.cmake index ee0a6142f5..0cd35615ca 100644 --- a/cMake/FreeCAD_Helpers/SetupShibokenAndPyside.cmake +++ b/cMake/FreeCAD_Helpers/SetupShibokenAndPyside.cmake @@ -43,11 +43,17 @@ macro(SetupShibokenAndPyside) endif() endif() - if(NOT SHIBOKEN_INCLUDE_DIR) + # pyside2 changed it's cmake files, this is the dance we have + # to dance to be compatible with the old (<5.12) and the new versions (>=5.12) + if(NOT SHIBOKEN_LIBRARY AND TARGET Shiboken2::libshiboken) + get_property(SHIBOKEN_LIBRARY TARGET Shiboken2::libshiboken PROPERTY IMPORTED_LOCATION_RELEASE) + endif(NOT SHIBOKEN_LIBRARY AND TARGET Shiboken2::libshiboken) + + if(NOT SHIBOKEN_LIBRARY) message("====================\n" "shiboken2 not found.\n" "====================\n") - endif(NOT SHIBOKEN_INCLUDE_DIR) + endif(NOT SHIBOKEN_LIBRARY) find_package(PySide2 QUIET)# REQUIRED if(NOT PYSIDE_INCLUDE_DIR)