chore(general): move cpp files of monitoring tool from DOtherSide to ui dir

Additionally bumps DOtherSide cmake min version to 3.19

Closes: #9472
This commit is contained in:
Michał Cieślak 2023-02-07 12:54:31 +01:00 committed by Michał
parent 51afe05d3c
commit 1481790183
8 changed files with 22 additions and 11 deletions

View File

@ -0,0 +1,11 @@
set(MONITORING_INCLUDE_PATH ${CMAKE_CURRENT_LIST_DIR}/include)
set(MONITORING_HEADERS
${MONITORING_INCLUDE_PATH}/StatusDesktop/Monitoring/Monitor.h
${MONITORING_INCLUDE_PATH}/StatusDesktop/Monitoring/ContextPropertiesModel.h
)
set(MONITORING_SOURCES
${CMAKE_CURRENT_LIST_DIR}/src/StatusDesktop/Monitoring/Monitor.cpp
${CMAKE_CURRENT_LIST_DIR}/src/StatusDesktop/Monitoring/ContextPropertiesModel.cpp
)

View File

@ -1,4 +1,4 @@
#include "DOtherSide/Status/Monitoring/ContextPropertiesModel.h" #include "StatusDesktop/Monitoring/ContextPropertiesModel.h"
ContextPropertiesModel::ContextPropertiesModel(QObject* parent) ContextPropertiesModel::ContextPropertiesModel(QObject* parent)
: QAbstractListModel(parent) : QAbstractListModel(parent)

View File

@ -1,4 +1,4 @@
#include "DOtherSide/Status/Monitoring/Monitor.h" #include "StatusDesktop/Monitoring/Monitor.h"
#include <QCoreApplication> #include <QCoreApplication>
#include <QDebug> #include <QDebug>

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.2) cmake_minimum_required(VERSION 3.19)
project(DOtherSide) project(DOtherSide)

View File

@ -7,23 +7,21 @@ set(MONITORING_QML_ENTRY_POINT "" CACHE STRING "QML file intended to start the m
include(../../../ui/StatusQ/StatusQSources.cmake) include(../../../ui/StatusQ/StatusQSources.cmake)
if(MONITORING)
include(../../../ui/MonitoringSources.cmake)
endif()
# Macro for merging common code between static and shared # Macro for merging common code between static and shared
macro(add_target name type) macro(add_target name type)
find_package(Qt5 COMPONENTS Core Qml Gui Quick QuickControls2 Widgets Network Multimedia REQUIRED) find_package(Qt5 COMPONENTS Core Qml Gui Quick QuickControls2 Widgets Network Multimedia REQUIRED)
file(GLOB HEADERS include/DOtherSide/*.h include/DOtherSide/Status/*.h) file(GLOB HEADERS include/DOtherSide/*.h include/DOtherSide/Status/*.h)
file(GLOB SOURCES src/*.cpp src/Status/*.cpp) file(GLOB SOURCES src/*.cpp src/Status/*.cpp)
if(MONITORING)
file(GLOB MONITORING_HEADERS include/DOtherSide/Status/Monitoring/*.h)
file(GLOB MONITORING_SOURCES src/Status/Monitoring/*.cpp)
endif()
if(APPLE) if(APPLE)
file(GLOB MM_FILES src/*.mm src/Status/*.mm) file(GLOB MM_FILES src/*.mm src/Status/*.mm)
#prepend items because .mm files need build priority to override cpp impl #prepend items because .mm files need build priority to override cpp impl
list(INSERT SOURCES 0 ${MM_FILES}) list(PREPEND SOURCES ${MM_FILES})
endif() endif()
add_library(${name} ${type} add_library(${name} ${type}
@ -48,6 +46,8 @@ macro(add_target name type)
endif() endif()
if(MONITORING) if(MONITORING)
target_include_directories(${name} PUBLIC ${MONITORING_INCLUDE_PATH})
target_compile_definitions(${name} PRIVATE MONITORING) target_compile_definitions(${name} PRIVATE MONITORING)
target_compile_definitions(${name} PRIVATE MONITORING_QML_ENTRY_POINT="${MONITORING_QML_ENTRY_POINT}") target_compile_definitions(${name} PRIVATE MONITORING_QML_ENTRY_POINT="${MONITORING_QML_ENTRY_POINT}")
endif() endif()

View File

@ -79,7 +79,7 @@
#ifdef MONITORING #ifdef MONITORING
#include <QProcessEnvironment> #include <QProcessEnvironment>
#include "DOtherSide/Status/Monitoring/Monitor.h" #include "StatusDesktop/Monitoring/Monitor.h"
#endif #endif
#include <qqmlsortfilterproxymodeltypes.h> #include <qqmlsortfilterproxymodeltypes.h>