@@ -72,12 +72,9 @@ endif()
7272add_subdirectory ("libuncso2" )
7373
7474find_package (
75- Qt5
75+ Qt6
7676 COMPONENTS Widgets
7777 REQUIRED )
78- if (WIN32 )
79- find_package (Qt5 COMPONENTS WinExtras REQUIRED )
80- endif ()
8178
8279# Auto generate Qt files
8380set (CMAKE_AUTOMOC ON )
@@ -175,7 +172,7 @@ source_group("Resources Files" FILES ${UNCSO2_RESOURCES})
175172source_group ("Resources Files\\ Breeze" FILES ${UNCSO2_RESOURCES_BREEZE} )
176173source_group ("Resources Files\\ Layouts" FILES ${UNCSO2_RESOURCES_LAYOUTS} )
177174
178- qt5_add_binary_resources (icons-breeze ${UNCSO2_RESOURCES_BREEZE} )
175+ qt_add_binary_resources (icons-breeze ${UNCSO2_RESOURCES_BREEZE} )
179176
180177file (
181178 GLOB
@@ -189,10 +186,10 @@ file(
189186 ${UNCSO2_RESOURCES_LAYOUTS}
190187 ${UNCSO2_RESOURCES_WIN32} )
191188
192- qt5_add_resources (UNCSO2_ALL_SOURCES ${UNCSO2_RESOURCES} )
189+ qt_add_resources (UNCSO2_ALL_SOURCES ${UNCSO2_RESOURCES} )
193190
194- # force c++17 standard
195- set (CMAKE_CXX_STANDARD 17 )
191+ # force c++20 standard
192+ set (CMAKE_CXX_STANDARD 20 )
196193set (CMAKE_CXX_STANDARD_REQUIRED ON )
197194
198195#
@@ -211,7 +208,7 @@ add_dependencies(uc2 icons-breeze)
211208# Enable all warnings
212209#
213210if (MSVC )
214- target_compile_options (uc2 PRIVATE /W4 /WX )
211+ target_compile_options (uc2 PRIVATE /DWIN32 /D_WINDOWS / W4 /WX /EHsc )
215212else ()
216213 target_compile_options (uc2 PRIVATE -Wall -Wextra -Wconversion -pedantic )
217214 # target_compile_options(uc2 PRIVATE -g)
@@ -256,9 +253,5 @@ endif()
256253target_include_directories (uc2 PRIVATE ${PKG_INCLUDE_DIR} )
257254target_link_libraries (uc2 uncso2 )
258255
259- # link Qt5
260- target_include_directories (uc2 PRIVATE ${Qt5Widgets_INCLUDE_DIRS} )
261- target_link_libraries (uc2 Qt5::Widgets )
262- if (WIN32 )
263- target_link_libraries (uc2 Qt5::WinExtras )
264- endif ()
256+ # link Qt6
257+ target_link_libraries (uc2 Qt::Widgets )
0 commit comments