Skip to content
This repository was archived by the owner on Aug 18, 2021. It is now read-only.

Commit c3d24de

Browse files
QxQQxQ
authored andcommitted
Qt6: Support Qt6
1 parent 9ff7e63 commit c3d24de

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

CMakeLists.txt

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@ set(CMAKE_AUTOMOC ON)
1111
set(CMAKE_AUTOUIC ON)
1212
set(CMAKE_AUTORCC ON)
1313

14-
find_package(Qt5 COMPONENTS Core Widgets Network Gui REQUIRED)
14+
option(QVPLUGIN_USE_QT6 "Use Qt6")
15+
if(QVPLUGIN_USE_QT6)
16+
set(QV_QT_LIBNAME Qt6)
17+
else()
18+
set(QV_QT_LIBNAME Qt5)
19+
endif()
20+
find_package(${QV_QT_LIBNAME} COMPONENTS Core Widgets Gui Network REQUIRED)
21+
1522
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
1623

1724
set(QVPLUGIN_INTERFACE_INCLUDE_DIR "interface/")
@@ -47,9 +54,9 @@ if(APPLE)
4754
endif()
4855

4956
target_link_libraries(${PROJECT_NAME}
50-
Qt5::Core
51-
Qt5::Gui
52-
Qt5::Network
53-
Qt5::Widgets)
57+
${QV_QT_LIBNAME}::Core
58+
${QV_QT_LIBNAME}::Gui
59+
${QV_QT_LIBNAME}::Network
60+
${QV_QT_LIBNAME}::Widgets)
5461

5562
install(TARGETS ${PROJECT_NAME} DESTINATION share/qv2ray/plugins)

0 commit comments

Comments
 (0)