From da7fc439db8b76ec10a3af460d94fb422b014ddb Mon Sep 17 00:00:00 2001 From: Anton Kochkov Date: Fri, 17 Feb 2023 21:50:37 +0800 Subject: [PATCH] Rename PYSIDE_INCLUDE_DIR to PYSIDE_INCLUDE_DIRS --- CMakeLists.txt | 17 +++++++++-------- cmake/FindPySide2.cmake | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fa5bbbe7..38f18f17 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,10 +111,10 @@ if(CUTTER_ENABLE_PYTHON) find_package(Shiboken6Tools "${Shiboken6_VERSION_REQUIRED}" REQUIRED) find_package(PySide6 "${Shiboken6_VERSION_REQUIRED}" REQUIRED) get_target_property(LIBSHIBOKEN_INCLUDE_DIRS Shiboken6::libshiboken INTERFACE_INCLUDE_DIRECTORIES) - get_target_property(PYSIDE_INCLUDE_DIR PySide6::pyside6 INTERFACE_INCLUDE_DIRECTORIES) + get_target_property(PYSIDE_INCLUDE_DIRS PySide6::pyside6 INTERFACE_INCLUDE_DIRECTORIES) # Check the presence of "pysidecleanup.h" include(CheckIncludeFileCXX) - set(CMAKE_REQUIRED_INCLUDES "${PYSIDE_INCLUDE_DIR};${LIBSHIBOKEN_INCLUDE_DIRS}") + set(CMAKE_REQUIRED_INCLUDES "${PYSIDE_INCLUDE_DIRS};${LIBSHIBOKEN_INCLUDE_DIRS}") CHECK_INCLUDE_FILE_CXX("pysidecleanup.h" HAVE_PYSIDECLEANUP) add_compile_definitions("HAVE_PYSIDECLEANUP=${HAVE_PYSIDECLEANUP}") else() @@ -126,14 +126,15 @@ if(CUTTER_ENABLE_PYTHON) endif() find_package(Shiboken2 "${Shiboken2_VERSION_REQUIRED}" REQUIRED) find_package(PySide2 "${Shiboken2_VERSION_REQUIRED}" REQUIRED) - get_target_property(PYSIDE_INCLUDE_DIR PySide2::pyside2 INTERFACE_INCLUDE_DIRECTORIES) + get_target_property(PYSIDE_INCLUDE_DIRS PySide2::pyside2 INTERFACE_INCLUDE_DIRECTORIES) endif() - list(GET PYSIDE_INCLUDE_DIR 0 PYSIDE_INCLUDE_DIR) - include_directories(${PYSIDE_INCLUDE_DIR} - ${PYSIDE_INCLUDE_DIR}/QtCore - ${PYSIDE_INCLUDE_DIR}/QtGui - ${PYSIDE_INCLUDE_DIR}/QtWidgets) + foreach(_dir IN LISTS PYSIDE_INCLUDE_DIRS) + include_directories(${_dir} + ${_dir}/QtCore + ${_dir}/QtGui + ${_dir}/QtWidgets) + endforeach() add_definitions(-DCUTTER_ENABLE_PYTHON_BINDINGS) endif() diff --git a/cmake/FindPySide2.cmake b/cmake/FindPySide2.cmake index 1b6faf40..d4843f97 100644 --- a/cmake/FindPySide2.cmake +++ b/cmake/FindPySide2.cmake @@ -65,4 +65,4 @@ else() INTERFACE_LINK_LIBRARIES "${PYSIDE_LIBRARY}") endif() -mark_as_advanced(PYSIDE_INCLUDE_DIR PYSIDE_LIBRARY PYSIDE_BINARY) \ No newline at end of file +mark_as_advanced(PYSIDE_INCLUDE_DIR PYSIDE_LIBRARY PYSIDE_BINARY)