Skip to content

Commit 78687fb

Browse files
committed
ENH: Set old QT_VERSION_* variables.
1 parent e487347 commit 78687fb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,16 @@ option(FORCE_BUILD_QT5 "Force Qt5 build instead of Qt6" OFF)
2222

2323
if(FORCE_BUILD_QT5)
2424
find_package(Qt5 NAMES Qt5 REQUIRED COMPONENTS Core)
25+
string(REPLACE "." ";" qt_version_list ${Qt5_VERSION})
2526
else()
2627
find_package(Qt6 NAMES Qt6 REQUIRED COMPONENTS Core)
28+
string(REPLACE "." ";" qt_version_list ${Qt6_VERSION})
2729
endif()
30+
list(GET qt_version_list 0 QT_VERSION_MAJOR)
31+
list(GET qt_version_list 1 QT_VERSION_MINOR)
32+
list(GET qt_version_list 1 QT_VERSION_PATCH)
33+
message(STATUS "QT_VERSION_MAJOR = ${QT_VERSION_MAJOR}")
34+
2835
find_package(Python3 COMPONENTS Development)
2936

3037
set(PYTHONQT_SUFFIX Qt${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}-Python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR})

0 commit comments

Comments
 (0)