diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1a753548..ad69522e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -429,33 +429,7 @@ if(CUTTER_ENABLE_PYTHON_BINDINGS) include_directories("${BINDINGS_BUILD_DIR}/CutterBindings") - set(SHIBOKEN_INCLUDE_DIRS "") - if(APPLE AND _qt6Core_install_prefix) - list(APPEND BINDINGS_INCLUDE_DIRS "${_qt6Core_install_prefix}/include") - list(APPEND BINDINGS_INCLUDE_DIRS "${_qt6Core_install_prefix}/include/QtCore") - list(APPEND BINDINGS_INCLUDE_DIRS "${_qt6Core_install_prefix}/include/QtGui") - list(APPEND BINDINGS_INCLUDE_DIRS "${_qt6Core_install_prefix}/include/QtWidgets") - endif() - - if (CUTTER_QT6) - list(APPEND SHIBOKEN_INCLUDE_DIRS ${Qt6Core_INCLUDE_DIRS} ${Qt6Widgets_INCLUDE_DIRS} ${Qt6Gui_INCLUDE_DIRS}) - else() - list(APPEND SHIBOKEN_INCLUDE_DIRS ${Qt5Core_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS}) - endif() - - foreach(_dir ${CUTTER_INCLUDE_DIRECTORIES}) - list(APPEND SHIBOKEN_INCLUDE_DIRS - $ - $ - ) - endforeach() - list(APPEND SHIBOKEN_INCLUDE_DIRS ${Rizin_INCLUDE_DIRS}) - if (NOT WIN32) - string(REPLACE ";" ":" SHIBOKEN_INCLUDE_DIRS "${SHIBOKEN_INCLUDE_DIRS}") - endif() - set(SHIBOKEN_OPTIONS) - list(APPEND SHIBOKEN_OPTIONS --include-paths="${SHIBOKEN_INCLUDE_DIRS}") if (WIN32) list(APPEND SHIBOKEN_OPTIONS --avoid-protected-hack) endif() @@ -558,11 +532,16 @@ if(CUTTER_ENABLE_PYTHON) endif() endforeach() - if(APPLE AND _qt5Core_install_prefix) - list(APPEND BINDINGS_INCLUDE_DIRS "${_qt5Core_install_prefix}/include") - list(APPEND BINDINGS_INCLUDE_DIRS "${_qt5Core_install_prefix}/include/QtCore") - list(APPEND BINDINGS_INCLUDE_DIRS "${_qt5Core_install_prefix}/include/QtGui") - list(APPEND BINDINGS_INCLUDE_DIRS "${_qt5Core_install_prefix}/include/QtWidgets") + set(BINDINGS_INCLUDE_DIR_LINES "") + if(APPLE) + if (_qt5Core_install_prefix) + list(APPEND BINDINGS_INCLUDE_DIRS "${_qt5Core_install_prefix}/include") + list(APPEND BINDINGS_INCLUDE_DIRS "${_qt5Core_install_prefix}/include/QtCore") + list(APPEND BINDINGS_INCLUDE_DIRS "${_qt5Core_install_prefix}/include/QtGui") + list(APPEND BINDINGS_INCLUDE_DIRS "${_qt5Core_install_prefix}/include/QtWidgets") + elseif(CUTTER_QT6) + string(APPEND BINDINGS_INCLUDE_DIR_LINES "framework-include-path=${QT6_INSTALL_PREFIX}/${QT6_INSTALL_LIBS}\n") + endif() endif() if (CUTTER_QT6) list(APPEND BINDINGS_INCLUDE_DIRS ${Qt6Core_INCLUDE_DIRS} ${Qt6Widgets_INCLUDE_DIRS} ${Qt6Gui_INCLUDE_DIRS}) @@ -571,9 +550,12 @@ if(CUTTER_ENABLE_PYTHON) endif() list(APPEND BINDINGS_INCLUDE_DIRS ${Rizin_INCLUDE_DIRS}) list(APPEND BINDINGS_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}") - if (NOT WIN32) - string(REPLACE ";" ":" BINDINGS_INCLUDE_DIRS "${BINDINGS_INCLUDE_DIRS}") - endif() + + foreach(_dir ${BINDINGS_INCLUDE_DIRS}) + if (NOT "${_dir}" STREQUAL "") + string(APPEND BINDINGS_INCLUDE_DIR_LINES "include-path = ${_dir}\n") + endif() + endforeach() configure_file("${BINDINGS_SRC_DIR}/bindings.txt.in" "${BINDINGS_BUILD_DIR}/bindings.txt") add_definitions(-DWIN32_LEAN_AND_MEAN) diff --git a/src/bindings/bindings.txt.in b/src/bindings/bindings.txt.in index 5eb103ee..57ee1c4a 100644 --- a/src/bindings/bindings.txt.in +++ b/src/bindings/bindings.txt.in @@ -7,7 +7,7 @@ typesystem-file = ${BINDINGS_BUILD_DIR}/bindings.xml output-directory = ${BINDINGS_BUILD_DIR} -include-path = ${BINDINGS_INCLUDE_DIRS} +${BINDINGS_INCLUDE_DIR_LINES} typesystem-paths = ${PYSIDE_TYPESYSTEMS}