This commit is contained in:
Fire Cube 2025-06-21 21:00:21 +02:00
parent 4d48276737
commit 8a35cc9920
3 changed files with 68 additions and 0 deletions

12
cmake/FindQt.cmake Normal file
View file

@ -0,0 +1,12 @@
if(WIN32 AND NOT CMAKE_PREFIX_PATH)
file(GLOB QT_KITS LIST_DIRECTORIES true "C:/Qt/*/msvc*")
list(SORT QT_KITS COMPARE NATURAL)
list(REVERSE QT_KITS)
list(GET QT_KITS 0 QT_PREFIX)
if(QT_PREFIX)
set(CMAKE_PREFIX_PATH "${QT_PREFIX}" CACHE PATH "Qt prefix autodetected" FORCE)
message(STATUS "Auto-detected Qt prefix: ${QT_PREFIX}")
else()
message(WARNING "findQt.cmake: no QtDirectory found in C:/Qt please set CMAKE_PREFIX_PATH manually")
endif()
endif()