Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[help] natron: support for qt6 #1012

Open
wants to merge 2 commits into
base: RB-2.6
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 10 additions & 8 deletions Engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand All @@ -59,6 +59,9 @@ if(UNIX AND NOT APPLE)
endif()
endif()

find_package(
Boost 1.85 REQUIRED
COMPONENTS serialization system)

list(APPEND NatronEngine_SOURCES
${NatronEngine_SOURCES}
Expand All @@ -74,15 +77,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
Expand Down
16 changes: 8 additions & 8 deletions Gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions Renderer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ add_executable(Tests ${Tests_HEADERS} ${Tests_SOURCES})
target_link_libraries(Tests
PRIVATE
NatronEngine
Qt5::Core
Qt6::Core
Python3::Python
openMVG
)
Expand Down
2 changes: 1 addition & 1 deletion libs/qhttpserver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)