[nostalgia] Make portable between Qt5 and Qt6
This commit is contained in:
parent
8d62aca8a7
commit
2b469da8c3
@ -3,8 +3,8 @@
|
||||
|
||||
if(NOSTALGIA_BUILD_TYPE STREQUAL "Native")
|
||||
if(NOSTALGIA_BUILD_STUDIO)
|
||||
find_package(Qt6Widgets REQUIRED)
|
||||
find_package(Qt6QuickWidgets REQUIRED)
|
||||
find_package(QT NAMES Qt6 Qt5 COMPONENTS QuickWidgets Widgets REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS QuickWidgets Widgets REQUIRED)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
@ -21,8 +21,8 @@ endif()
|
||||
|
||||
target_link_libraries(
|
||||
NostalgiaCore-Studio
|
||||
Qt6::Core
|
||||
Qt6::QuickWidgets
|
||||
Qt${QT_VERSION_MAJOR}::Core
|
||||
Qt${QT_VERSION_MAJOR}::QuickWidgets
|
||||
NostalgiaStudio
|
||||
NostalgiaCore-Qt
|
||||
NostalgiaCore
|
||||
|
@ -53,7 +53,7 @@ add_executable(
|
||||
target_link_libraries(
|
||||
NostalgiaStudioJsonTest
|
||||
OxStd
|
||||
Qt6::Widgets
|
||||
Qt${QT_VERSION_MAJOR}::Widgets
|
||||
)
|
||||
|
||||
add_test("[nostalgia/studio] NostalgiaStudioJson" NostalgiaStudioJsonTest)
|
||||
|
@ -17,7 +17,7 @@ target_include_directories(NostalgiaStudio PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
target_link_libraries(
|
||||
NostalgiaStudio PUBLIC
|
||||
Qt6::Widgets
|
||||
Qt${QT_VERSION_MAJOR}::Widgets
|
||||
OxFS
|
||||
OxClaw
|
||||
)
|
||||
|
@ -27,7 +27,9 @@ int main(int argc, char **args) {
|
||||
qdark::load(&app);
|
||||
}
|
||||
// force QtQuick to use OpenGL (https://doc.qt.io/qt-6/quick-changes-qt6.html#changes-to-qquickwidget)
|
||||
#if QT_VERSION >= 0x060000
|
||||
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi);
|
||||
#endif
|
||||
// open window
|
||||
try {
|
||||
MainWindow w(argProfilePath);
|
||||
|
@ -9,8 +9,8 @@ add_library(
|
||||
|
||||
target_link_libraries(
|
||||
NostalgiaWorld-Studio
|
||||
Qt6::Core
|
||||
Qt6::Widgets
|
||||
Qt${QT_VERSION_MAJOR}::Core
|
||||
Qt${QT_VERSION_MAJOR}::Widgets
|
||||
NostalgiaStudio
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user