Skip to content

Commit

Permalink
CentOS_6 and RHEL 6 and 7 do not have Qt5
Browse files Browse the repository at this point in the history
So for these we switch back to Qt4
  • Loading branch information
pstorz committed Oct 3, 2018
1 parent 2e209e8 commit c00a6ed
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
6 changes: 6 additions & 0 deletions core/platforms/packaging/bareos.spec
Expand Up @@ -198,7 +198,13 @@ BuildRequires: mtx
%if 0%{?suse_version}
BuildRequires: libqt5-qtbase-devel
%else

%if 0%{?centos_version} == 600 || 0%{?rhel_version} <= 700
BuildRequires: libqt4-devel
%else
BuildRequires: qt5-qtbase-devel
%endif

%endif
%endif

Expand Down
16 changes: 11 additions & 5 deletions core/src/qt-tray-monitor/CMakeLists.txt
Expand Up @@ -29,7 +29,9 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)

find_package(Qt5 COMPONENTS Core Widgets REQUIRED)
find_package(Qt4)

find_package(Qt5 COMPONENTS Core Widgets)

IF(HAVE_WIN32)
include_directories(
Expand All @@ -49,17 +51,21 @@ IF(HAVE_WIN32)
LIST(APPEND SOURCES ../win32/qt-tray-monitor/traymon.rc)
ENDIF()


set(TRAYMON_LIBRARIES bareos-tray-monitor bareos)

IF(Qt4_FOUND)
set(TRAYMON_LIBRARIES bareos-tray-monitor Qt4::QtGui bareos)
ELSE()
set(TRAYMON_LIBRARIES bareos-tray-monitor bareos)
ENDIF()

IF(HAVE_WIN32)
add_executable(bareos-tray-monitor WIN32 ${SOURCES} main.qrc)
ELSE()
add_executable(bareos-tray-monitor ${SOURCES} main.qrc)
ENDIF()

qt5_use_modules(bareos-tray-monitor Widgets)
IF(Qt5Widgets_FOUND)
qt5_use_modules(bareos-tray-monitor Widgets)
ENDIF()

target_link_libraries(${TRAYMON_LIBRARIES})

Expand Down

0 comments on commit c00a6ed

Please sign in to comment.