Skip to content

Commit

Permalink
Merge pull request #1011 from tuxmaster5000/qt6
Browse files Browse the repository at this point in the history
Enable Qt6 when present
  • Loading branch information
joergsteffens committed Jan 29, 2023
2 parents 7e85698 + 9110d1a commit 47d9cdb
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and since Bareos version 20 this project adheres to [Semantic Versioning](https:
- storage daemon: fix crash on volume swap [PR #1356]
- core: make resource/configuration locking safer [PR #1325]
- json generation: Fix some leaks and an integer overflow [PR #1130]
- tray-monitor: build against Qt6 when present [PR #1011]

### Removed
- remove no longer used pkglists [PR #1335]
Expand All @@ -27,6 +28,7 @@ and since Bareos version 20 this project adheres to [Semantic Versioning](https:
- add explanation about binary version numbers [PR #1354]

[PR #935]: https://github.com/bareos/bareos/pull/935
[PR #1011]: https://github.com/bareos/bareos/pull/1011
[PR #1130]: https://github.com/bareos/bareos/pull/1130
[PR #1325]: https://github.com/bareos/bareos/pull/1325
[PR #1335]: https://github.com/bareos/bareos/pull/1335
Expand Down
24 changes: 17 additions & 7 deletions core/src/qt-tray-monitor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,20 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)

find_package(Qt5 COMPONENTS Core Widgets)
if(Qt5Widgets_FOUND)
message(STATUS "Found QT5Widgets")
find_package(Qt6 COMPONENTS Core Widgets)
if(Qt6Widgets_FOUND)
message(STATUS "Found QT6Widgets")
else()
message(STATUS "QT5Widgets NOT found, checking for Qt4 ...")
find_package(Qt4)
if(NOT Qt4_FOUND)
message(FATAL_ERROR "Both Qt5 and Qt4 not found, cannot build tray-monitor")
message(STATUS "QT6Widgets NOT found, checking for Qt5 ...")
find_package(Qt5 COMPONENTS Core Widgets)
if(Qt5Widgets_FOUND)
message(STATUS "Found QT5Widgets")
else()
message(STATUS "QT5Widgets NOT found, checking for Qt4 ...")
find_package(Qt4)
if(NOT Qt4_FOUND)
message(FATAL_ERROR "Both Qt5 and Qt4 not found, cannot build tray-monitor")
endif()
endif()
endif()

Expand Down Expand Up @@ -76,6 +82,10 @@ if(TARGET Qt5::Widgets)
target_link_libraries(bareos-tray-monitor PRIVATE Qt5::Widgets)
endif()

if(TARGET Qt6::Widgets)
target_link_libraries(bareos-tray-monitor PRIVATE Qt6::Widgets)
endif()

install(TARGETS bareos-tray-monitor DESTINATION "${bindir}")

install(CODE "set(configtemplatedir \"${configtemplatedir}\")")
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Build-Depends: acl-dev,
libacl1-dev,
libcap-dev [linux-any],
liblzo2-dev,
qtbase5-dev,
qt6-base-dev | qtbase5-dev,
libreadline-dev,
libssl-dev,
libx11-dev,
Expand Down
2 changes: 1 addition & 1 deletion debian/control.src
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Build-Depends: acl-dev,
libacl1-dev,
libcap-dev [linux-any],
liblzo2-dev,
qtbase5-dev,
qt6-base-dev | qtbase5-dev,
libreadline-dev,
libssl-dev,
libx11-dev,
Expand Down

0 comments on commit 47d9cdb

Please sign in to comment.