diff options
author | John Fultz <jfultz@wolfram.com> | 2023-07-16 09:27:48 -0500 |
---|---|---|
committer | John Fultz <jfultz@wolfram.com> | 2023-07-16 09:34:44 -0500 |
commit | 00c2af7db5c330139f4482dc1d99b45c235d82ec (patch) | |
tree | 1910aee565b933b7dc3fd86f14a1c3d632556690 /quackleio/CMakeLists.txt | |
parent | edbeff498efbcda2fe2e841137f6e038ec94329f (diff) |
Add Qt6 to cmake, build action matrix.
The cmake file now takes a QT_VERSION string setting. The first
character of the string is “6”, then cmake calls find_package
on Qt6…otherwise, it calls find_package on Qt5.
Qt 6.5.2 builds added to the GitHub Actions build matrix.
Diffstat (limited to 'quackleio/CMakeLists.txt')
-rw-r--r-- | quackleio/CMakeLists.txt | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/quackleio/CMakeLists.txt b/quackleio/CMakeLists.txt index 460839d..d3f1e0a 100644 --- a/quackleio/CMakeLists.txt +++ b/quackleio/CMakeLists.txt @@ -6,7 +6,13 @@ message("-- Configuring libquackleio") include("${CMAKE_CURRENT_SOURCE_DIR}/../Settings.cmake") -find_package(Qt5 REQUIRED COMPONENTS Core) +set(QT_VERSION "5" CACHE STRING "Version of Qt (anything past the first digit is ignored)") + +if("${QT_VERSION}" MATCHES "^6") + find_package(Qt6 REQUIRED COMPONENTS Core Widgets) +else() + find_package(Qt5 REQUIRED COMPONENTS Core Widgets) +endif() set(QUACKLEIO_SOURCES dawgfactory.cpp @@ -41,4 +47,8 @@ add_library(quackleio ${QUACKLEIO_SOURCES} ${QUACKLEIO_HEADERS} ) target_include_directories(quackleio PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..") -target_link_libraries(quackleio Qt5::Core) +if("${QT_VERSION}" MATCHES "^6") + target_link_libraries(quackleio Qt6::Core) +else() + target_link_libraries(quackleio Qt5::Core) +endif() |