File tree Expand file tree Collapse file tree 3 files changed +16
-8
lines changed Expand file tree Collapse file tree 3 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,15 @@ set(CMAKE_AUTORCC ON)
13
13
option (BUILD_TESTS "Build Unit Tests" OFF )
14
14
option (BUILD_EXAMPLE "Build Example Application" ON )
15
15
16
- find_package (Qt5 ${QT_MIN_VERSION} REQUIRED Widgets )
16
+ option (BUILD_WITH_QT6 "Build with Qt6" OFF )
17
+ if (BUILD_WITH_QT6 )
18
+ set (QT_MAJOR_VERSION 6 )
19
+ set (CMAKE_CXX_STANDARD 17 )
20
+ else ()
21
+ set (QT_MAJOR_VERSION 5 )
22
+ endif ()
23
+
24
+ find_package (Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED Widgets )
17
25
18
26
include (GNUInstallDirs )
19
27
include (FeatureSummary )
@@ -27,7 +35,7 @@ if (BUILD_EXAMPLE)
27
35
endif (BUILD_EXAMPLE )
28
36
29
37
if (BUILD_TESTS )
30
- find_package (Qt5 ${QT_MIN_VERSION} REQUIRED Test )
38
+ find_package (Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED Test )
31
39
enable_testing ()
32
40
add_subdirectory (tests )
33
41
endif (BUILD_TESTS )
@@ -49,7 +57,7 @@ target_include_directories(kColorPicker
49
57
$< INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR} >
50
58
)
51
59
52
- target_link_libraries (kColorPicker PUBLIC Qt5 ::Widgets )
60
+ target_link_libraries (kColorPicker PUBLIC Qt${QT_MAJOR_VERSION} ::Widgets )
53
61
54
62
target_compile_definitions (kColorPicker PRIVATE KIMAGEANNOTATOR_LIB )
55
63
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ include(CMakeFindDependencyMacro)
2
2
3
3
@PACKAGE_INIT@
4
4
5
- find_dependency (Qt5 @QT_MIN_VERSION@ COMPONENTS Widgets )
5
+ find_dependency (Qt@QT_MAJOR_VERSION@ @QT_MIN_VERSION@ COMPONENTS Widgets )
6
6
7
7
if (NOT TARGET kColorPicker::kColorPicker )
8
8
include ("${CMAKE_CURRENT_LIST_DIR} /kColorPicker-targets.cmake" )
9
- endif ()
9
+ endif ()
Original file line number Diff line number Diff line change @@ -4,11 +4,11 @@ set(UNITTEST_SRC
4
4
5
5
add_library (KCOLORPICKER_STATIC STATIC ${KCOLORPICKER_SRCS} )
6
6
7
- target_link_libraries (KCOLORPICKER_STATIC Qt5 ::Widgets kColorPicker )
7
+ target_link_libraries (KCOLORPICKER_STATIC Qt${QT_MAJOR_VERSION} ::Widgets kColorPicker )
8
8
9
9
foreach (UnitTest ${UNITTEST_SRC} )
10
10
get_filename_component (UnitTestName ${UnitTest} NAME_WE )
11
11
add_executable (${UnitTestName} ${UnitTest} )
12
- target_link_libraries (${UnitTestName} KCOLORPICKER_STATIC Qt5 ::Test )
12
+ target_link_libraries (${UnitTestName} KCOLORPICKER_STATIC Qt${QT_MAJOR_VERSION} ::Test )
13
13
add_test (${UnitTestName} ${UnitTestName} )
14
- endforeach (UnitTest )
14
+ endforeach (UnitTest )
You can’t perform that action at this time.
0 commit comments