From 1b1214a320d79d7e0fa438cb9d1422b68ebbd45d Mon Sep 17 00:00:00 2001 From: maxfx Date: Fri, 15 Nov 2024 19:51:59 +0100 Subject: [PATCH 1/2] natron: support for qt6 --- CMakeLists.txt | 24 ++++++++++++------------ Engine/CMakeLists.txt | 20 ++++++++++++-------- Gui/CMakeLists.txt | 16 ++++++++-------- Renderer/CMakeLists.txt | 6 +++--- Tests/CMakeLists.txt | 2 +- libs/qhttpserver/CMakeLists.txt | 2 +- 6 files changed, 37 insertions(+), 33 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 13c18c12a..1e6dc2966 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ project(Natron LANGUAGES CXX C ) -set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD 14) option(NATRON_SYSTEM_LIBS "use system versions of dependencies instead of bundled ones" OFF) option(NATRON_BUILD_TESTS "build the Natron test suite" ON) @@ -55,29 +55,29 @@ if(WIN32) set(Python3_FIND_REGISTRY NEVER) endif() find_package(Python3 COMPONENTS Interpreter Development) -find_package(Qt5 5.15 CONFIG REQUIRED COMPONENTS Core Gui Network Widgets Concurrent) +find_package(Qt6 6.7.3 CONFIG REQUIRED COMPONENTS Core Gui Network Widgets Concurrent) if(IS_DEBUG_BUILD AND WIN32) # Explicitly setting SHIBOKEN_PYTHON_LIBRARIES variable to avoid PYTHON_DEBUG_LIBRARY-NOTFOUND # link errors on Windows debug builds. set(SHIBOKEN_PYTHON_LIBRARIES ${Python3_LIBRARIES}) endif() -find_package(Shiboken2 5.15 CONFIG REQUIRED COMPONENTS libshiboken2 shiboken2) +find_package(Shiboken6 6.7.3 CONFIG REQUIRED COMPONENTS libshiboken6 shiboken6) if(IS_DEBUG_BUILD AND WIN32) # Remove NDEBUG from Shiboken2 INTERFACE_COMPILE_DEFINITIONS so it is not inherited in debug builds. - get_property(ShibokenInterfaceDefs TARGET Shiboken2::libshiboken PROPERTY INTERFACE_COMPILE_DEFINITIONS) + get_property(ShibokenInterfaceDefs TARGET Shiboken6::libshiboken PROPERTY INTERFACE_COMPILE_DEFINITIONS) list(REMOVE_ITEM ShibokenInterfaceDefs NDEBUG) - set_property(TARGET Shiboken2::libshiboken PROPERTY INTERFACE_COMPILE_DEFINITIONS ShibokenInterfaceDefs) + set_property(TARGET Shiboken6::libshiboken PROPERTY INTERFACE_COMPILE_DEFINITIONS ShibokenInterfaceDefs) endif() -find_package(PySide2 5.15 CONFIG REQUIRED COMPONENTS pyside2) -set(QT_VERSION_MAJOR 5) -get_target_property(PYSIDE_INCLUDE_DIRS PySide2::pyside2 INTERFACE_INCLUDE_DIRECTORIES) -string(REGEX REPLACE "(.*)QtCore$" "\\1" Qt5_INCLUDE_DIR ${Qt5Core_INCLUDE_DIRS}) -set(QTCORE_INCLUDE_DIRS ${Qt5_INCLUDE_DIR} ${Qt5Core_INCLUDE_DIRS}) -set(QTGUI_INCLUDE_DIRS ${Qt5Gui_INCLUDE_DIRS}) -set(QTWIDGETS_INCLUDE_DIRS ${Qt5Widgets_INCLUDE_DIRS}) +find_package(PySide6 6.7.3 CONFIG REQUIRED COMPONENTS pyside6) +set(QT_VERSION_MAJOR 6) +get_target_property(PYSIDE_INCLUDE_DIRS PySide6::pyside6 INTERFACE_INCLUDE_DIRECTORIES) +string(REGEX REPLACE "(.*)QtCore$" "\\1" Qt6_INCLUDE_DIR ${Qt6Core_INCLUDE_DIRS}) +set(QTCORE_INCLUDE_DIRS ${Qt6_INCLUDE_DIR} ${Qt6Core_INCLUDE_DIRS}) +set(QTGUI_INCLUDE_DIRS ${Qt6Gui_INCLUDE_DIRS}) +set(QTWIDGETS_INCLUDE_DIRS ${Qt6Widgets_INCLUDE_DIRS}) #Since in Natron and OpenFX all strings are supposed UTF-8 and that the constructor #for QString(const char*) assumes ASCII strings, we may run into troubles diff --git a/Engine/CMakeLists.txt b/Engine/CMakeLists.txt index bd9eebda1..b28d4a3f0 100644 --- a/Engine/CMakeLists.txt +++ b/Engine/CMakeLists.txt @@ -46,7 +46,7 @@ execute_process(COMMAND ${Python3_EXECUTABLE} ../tools/utils/sourceList.py types OUTPUT_VARIABLE PyEngine_SOURCES) set_property(SOURCE ${PyEngine_SOURCES} PROPERTY SKIP_AUTOGEN ON) add_custom_command(OUTPUT ${PyEngine_SOURCES} - COMMAND Shiboken2::shiboken2 ${shiboken_args} + COMMAND Shiboken6::shiboken6 ${shiboken_args} COMMAND bash ${POST_SHIBOKEN} ${PYENGINE_OUT}/NatronEngine natronengine DEPENDS ${PYENGINE_HEADER} ${NatronEngine_HEADERS} ${POST_SHIBOKEN} typesystem_engine.xml WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) @@ -59,6 +59,11 @@ if(UNIX AND NOT APPLE) endif() endif() +find_package(Boost REQUIRED serialization) + +if(Boost_FOUND) + include_directories(${Boost_INCLUDE_DIRS}) +endif() list(APPEND NatronEngine_SOURCES ${NatronEngine_SOURCES} @@ -74,15 +79,14 @@ add_library(NatronEngine STATIC ${NatronEngine_HEADERS} ${NatronEngine_SOURCES}) target_link_libraries(NatronEngine PUBLIC HostSupport - Boost::headers - Boost::serialization + ${Boost_LIBRARIES} PkgConfig::Cairo PRIVATE - Shiboken2::libshiboken - PySide2::pyside2 - Qt5::Core - Qt5::Concurrent - Qt5::Network + Shiboken6::libshiboken + PySide6::pyside6 + Qt6::Core + Qt6::Concurrent + Qt6::Network Python3::Module ${XDG_LIBS} ceres diff --git a/Gui/CMakeLists.txt b/Gui/CMakeLists.txt index d20159d93..e9f75d5b6 100644 --- a/Gui/CMakeLists.txt +++ b/Gui/CMakeLists.txt @@ -46,7 +46,7 @@ execute_process(COMMAND ${Python3_EXECUTABLE} ../tools/utils/sourceList.py types OUTPUT_VARIABLE PyGui_SOURCES) set_property(SOURCE ${PyGui_SOURCES} PROPERTY SKIP_AUTOGEN ON) add_custom_command(OUTPUT ${PyGui_SOURCES} - COMMAND Shiboken2::shiboken2 ${shiboken_args} + COMMAND Shiboken6::shiboken6 ${shiboken_args} COMMAND bash ${POST_SHIBOKEN} ${PYGUI_OUT}/NatronGui natrongui DEPENDS ${PYGUI_HEADER} ${NatronEngine_HEADERS} ${NatronGui_HEADERS} ${POST_SHIBOKEN} typesystem_natronGui.xml WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) @@ -63,13 +63,13 @@ list(APPEND NatronGui_SOURCES add_library(NatronGui STATIC ${NatronGui_HEADERS} ${NatronGui_SOURCES}) target_link_libraries(NatronGui PUBLIC - Shiboken2::libshiboken - PySide2::pyside2 - Qt5::Core - Qt5::Concurrent - Qt5::Network - Qt5::Gui - Qt5::Widgets + Shiboken6::libshiboken + PySide6::pyside6 + Qt6::Core + Qt6::Concurrent + Qt6::Network + Qt6::Gui + Qt6::Widgets Python3::Module NatronEngine PRIVATE diff --git a/Renderer/CMakeLists.txt b/Renderer/CMakeLists.txt index 740db68b3..1e189ed28 100644 --- a/Renderer/CMakeLists.txt +++ b/Renderer/CMakeLists.txt @@ -25,9 +25,9 @@ add_executable(NatronRenderer ${NatronRenderer_SOURCES}) target_link_libraries(NatronRenderer PRIVATE NatronEngine - Qt5::Core - Qt5::Concurrent - Qt5::Network + Qt6::Core + Qt6::Concurrent + Qt6::Network Python3::Python ) target_include_directories(NatronRenderer diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 333e6038d..2a874c04e 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -36,7 +36,7 @@ add_executable(Tests ${Tests_HEADERS} ${Tests_SOURCES}) target_link_libraries(Tests PRIVATE NatronEngine - Qt5::Core + Qt6::Core Python3::Python openMVG ) diff --git a/libs/qhttpserver/CMakeLists.txt b/libs/qhttpserver/CMakeLists.txt index 7a3b3a2e9..028b72e42 100644 --- a/libs/qhttpserver/CMakeLists.txt +++ b/libs/qhttpserver/CMakeLists.txt @@ -29,6 +29,6 @@ set(qhttpserver_HEADERS file(GLOB qhttpserver_SOURCES src/*.cpp) set(qhttpserver_SOURCES ${qhttpserver_SOURCES} http-parser/http_parser.c) add_library(qhttpserver STATIC ${qhttpserver_HEADERS} ${qhttpserver_SOURCES}) -target_link_libraries(qhttpserver PRIVATE Qt5::Core Qt5::Network) +target_link_libraries(qhttpserver PRIVATE Qt6::Core Qt6::Network) target_include_directories(qhttpserver PRIVATE http-parser) set_target_properties(qhttpserver PROPERTIES POSITION_INDEPENDENT_CODE ON) From 90ab12ee81cdcba435cb6ebdc24476e1640e6a2a Mon Sep 17 00:00:00 2001 From: maxfx Date: Fri, 22 Nov 2024 12:46:49 +0100 Subject: [PATCH 2/2] natron: support for qt6 --- CMakeLists.txt | 2 +- Engine/CMakeLists.txt | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e6dc2966..95e0ab549 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ project(Natron LANGUAGES CXX C ) -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) option(NATRON_SYSTEM_LIBS "use system versions of dependencies instead of bundled ones" OFF) option(NATRON_BUILD_TESTS "build the Natron test suite" ON) diff --git a/Engine/CMakeLists.txt b/Engine/CMakeLists.txt index b28d4a3f0..63b2addc0 100644 --- a/Engine/CMakeLists.txt +++ b/Engine/CMakeLists.txt @@ -59,11 +59,9 @@ if(UNIX AND NOT APPLE) endif() endif() -find_package(Boost REQUIRED serialization) - -if(Boost_FOUND) - include_directories(${Boost_INCLUDE_DIRS}) -endif() +find_package( + Boost 1.85 REQUIRED + COMPONENTS serialization system) list(APPEND NatronEngine_SOURCES ${NatronEngine_SOURCES}