From 84fe44cb32e56a596a35a5f2ff5fee4647f752fd Mon Sep 17 00:00:00 2001 From: looooo Date: Fri, 27 Sep 2019 11:44:16 +0200 Subject: [PATCH] cmake: pyside2 config fix --- cMake/FreeCAD_Helpers/SetupShibokenAndPyside.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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)