Skip to content

Commit 8514929

Browse files
authored
improved Qt6 information in CMake (#6418)
1 parent f502d2a commit 8514929

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ include(cmake/findDependencies.cmake)
2020
include(cmake/compileroptions.cmake)
2121
include(cmake/compilerDefinitions.cmake)
2222
include(cmake/buildFiles.cmake)
23-
include(cmake/printInfo.cmake)
2423
if(BUILD_GUI)
2524
include(cmake/qtCompat.cmake)
2625
endif()
26+
include(cmake/printInfo.cmake)
2727

2828

2929
file(GLOB addons "addons/*.py")

cmake/findDependencies.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ if(BUILD_GUI)
88
endif()
99
if(USE_QT6)
1010
find_package(Qt6 COMPONENTS ${qt_components} REQUIRED)
11-
set(QT_VERSION "${Qt6Core_VERSION_STRING}")
11+
set(QT_VERSION "${Qt6Core_VERSION}")
1212
if(NOT QT_VERSION)
13-
# TODO: how to get the actual version?
14-
message(WARNING "'Qt6Core_VERSION_STRING' is not set - using 6.0.0 as fallback")
13+
# TODO: remove fallback
14+
message(WARNING "'Qt6Core_VERSION' is not set - using 6.0.0 as fallback")
1515
set(QT_VERSION "6.0.0")
1616
endif()
1717
if(MSVC)

cmake/printInfo.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ if(BUILD_GUI)
6464
message(STATUS "WITH_QCHART = ${WITH_QCHART}")
6565
message(STATUS "USE_QT6 = ${USE_QT6}")
6666
message(STATUS "QT_VERSION = ${QT_VERSION}")
67+
if(USE_QT6)
68+
message(STATUS "Qt6Core_LIBRARIES = ${Qt6Core_LIBRARIES}")
69+
message(STATUS "Qt6Core_INCLUDE_DIRS = ${Qt6Core_INCLUDE_DIRS}")
70+
else()
71+
message(STATUS "Qt5Core_LIBRARIES = ${Qt5Core_LIBRARIES}")
72+
message(STATUS "Qt5Core_INCLUDE_DIRS = ${Qt5Core_INCLUDE_DIRS}")
73+
endif()
6774
endif()
6875
message(STATUS)
6976
message(STATUS "HAVE_RULES = ${HAVE_RULES}")

0 commit comments

Comments
 (0)