From bf7e50d803eb0f49f56125e5be31ea815e88b251 Mon Sep 17 00:00:00 2001 From: looooo Date: Fri, 18 Oct 2019 23:17:31 +0200 Subject: [PATCH] cmake: pyside2: use imported targets if available --- src/Gui/CMakeLists.txt | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/Gui/CMakeLists.txt b/src/Gui/CMakeLists.txt index 6c918b5e2a..f4dd140bc4 100644 --- a/src/Gui/CMakeLists.txt +++ b/src/Gui/CMakeLists.txt @@ -180,9 +180,15 @@ if(SHIBOKEN_INCLUDE_DIR) include_directories( ${SHIBOKEN_INCLUDE_DIR} ) - list(APPEND FreeCADGui_LIBS - ${SHIBOKEN_LIBRARY} - ) + if (TARGET Shiboken2::libshiboken) + list(APPEND FreeCADGui_LIBS + Shiboken2::libshiboken + ) + else(TARGET Shiboken2::libshiboken) + list(APPEND FreeCADGui_LIBS + ${SHIBOKEN_LIBRARY} + ) + endif(TARGET Shiboken2::libshiboken) endif(SHIBOKEN_INCLUDE_DIR) if(PYSIDE_INCLUDE_DIR) @@ -191,9 +197,15 @@ if(PYSIDE_INCLUDE_DIR) ${PYSIDE_INCLUDE_DIR}/QtCore ${PYSIDE_INCLUDE_DIR}/QtGui ) - list(APPEND FreeCADGui_LIBS - ${PYSIDE_LIBRARY} - ) + if (TARGET PySide2::pyside2) + list(APPEND FreeCADGui_LIBS + PySide2::pyside2 + ) + else(TARGET PySide2::pyside2) + list(APPEND FreeCADGui_LIBS + ${PYSIDE_LIBRARY} + ) + endif(TARGET PySide2::pyside2) if (BUILD_QT5) include_directories( ${PYSIDE_INCLUDE_DIR}/QtWidgets