chore(general): cmake include file defined for StatusQ sources

Closes: #9426
This commit is contained in:
Michał Cieślak 2023-02-06 17:45:18 +01:00 committed by Michał
parent 36dc3e4c53
commit 51afe05d3c
4 changed files with 33 additions and 81 deletions

View File

@ -20,6 +20,8 @@ find_package(
COMPONENTS Core Quick QuickControls2 Test QuickTest Qml
REQUIRED)
include (../ui/StatusQ/StatusQSources.cmake)
file(GLOB_RECURSE CORE_QML_FILES "../ui/StatusQ/*.qml" "../ui/app/*.qml" "../ui/imports/*.qml")
file(GLOB_RECURSE CORE_JS_FILES "../ui/StatusQ/*.js" "../ui/app/*.js")
@ -30,33 +32,6 @@ file(GLOB_RECURSE TEST_QML_FILES "qmlTests/*.qml")
set(PROJECT_LIB "${PROJECT_NAME}Lib")
set(STATUSQ_DIR ../ui/StatusQ)
set(STATUSQ_HEADERS
${STATUSQ_DIR}/include/StatusQ/statuswindow.h
${STATUSQ_DIR}/include/StatusQ/typesregistration.h
${STATUSQ_DIR}/include/StatusQ/QClipboardProxy.h
${STATUSQ_DIR}/include/StatusQ/statussyntaxhighlighter.h
${STATUSQ_DIR}/include/StatusQ/rxvalidator.h
)
set(STATUSQ_SOURCES
${STATUSQ_DIR}/src/statuswindow.cpp
${STATUSQ_DIR}/src/typesregistration.cpp
${STATUSQ_DIR}/src/QClipboardProxy.cpp
${STATUSQ_DIR}/src/statussyntaxhighlighter.cpp
${STATUSQ_DIR}/src/rxvalidator.cpp
)
if(APPLE)
list(APPEND STATUSQ_SOURCES
${STATUSQ_DIR}/src/statuswindow_osx.mm
)
else()
list(APPEND STATUSQ_SOURCES
${STATUSQ_DIR}/src/statuswindow_other.cpp
)
endif()
add_library(${PROJECT_LIB}
cachecleaner.cpp cachecleaner.h
directorieswatcher.cpp directorieswatcher.h

View File

@ -0,0 +1,27 @@
set(STATUSQ_DIR ${CMAKE_CURRENT_LIST_DIR})
set(STATUSQ_HEADERS
${STATUSQ_DIR}/include/StatusQ/statuswindow.h
${STATUSQ_DIR}/include/StatusQ/typesregistration.h
${STATUSQ_DIR}/include/StatusQ/QClipboardProxy.h
${STATUSQ_DIR}/include/StatusQ/statussyntaxhighlighter.h
${STATUSQ_DIR}/include/StatusQ/rxvalidator.h
)
set(STATUSQ_SOURCES
${STATUSQ_DIR}/src/statuswindow.cpp
${STATUSQ_DIR}/src/typesregistration.cpp
${STATUSQ_DIR}/src/QClipboardProxy.cpp
${STATUSQ_DIR}/src/statussyntaxhighlighter.cpp
${STATUSQ_DIR}/src/rxvalidator.cpp
)
if(APPLE)
list(APPEND STATUSQ_SOURCES
${STATUSQ_DIR}/src/statuswindow_osx.mm
)
else()
list(APPEND STATUSQ_SOURCES
${STATUSQ_DIR}/src/statuswindow_other.cpp
)
endif()

View File

@ -5,39 +5,14 @@ find_package(
COMPONENTS Core Quick QuickControls2
REQUIRED)
include (../StatusQSources.cmake)
file(GLOB_RECURSE QML_FILES "../*.qml" "../qmldir")
file(GLOB_RECURSE JS_FILES "../*.js")
set(HEADERS sandboxapp.h)
set(SOURCES main.cpp sandboxapp.cpp)
set(STATUSQ_DIR ..)
set(STATUSQ_HEADERS
${STATUSQ_DIR}/include/StatusQ/statuswindow.h
${STATUSQ_DIR}/include/StatusQ/typesregistration.h
${STATUSQ_DIR}/include/StatusQ/QClipboardProxy.h
${STATUSQ_DIR}/include/StatusQ/statussyntaxhighlighter.h
${STATUSQ_DIR}/include/StatusQ/rxvalidator.h
)
set(STATUSQ_SOURCES
${STATUSQ_DIR}/src/statuswindow.cpp
${STATUSQ_DIR}/src/typesregistration.cpp
${STATUSQ_DIR}/src/QClipboardProxy.cpp
${STATUSQ_DIR}/src/statussyntaxhighlighter.cpp
${STATUSQ_DIR}/src/rxvalidator.cpp
)
if(APPLE)
list(APPEND STATUSQ_SOURCES
${STATUSQ_DIR}/src/statuswindow_osx.mm
)
else()
list(APPEND STATUSQ_SOURCES
${STATUSQ_DIR}/src/statuswindow_other.cpp
)
endif()
set(QRC_FILES qml.qrc ../src/statusq.qrc ../src/assets.qrc)
qt5_add_big_resources(QRC_COMPILED ${QRC_FILES})

View File

@ -5,6 +5,8 @@ include(GNUInstallDirs)
option(MONITORING "Tools for real-time inspection of the application." OFF)
set(MONITORING_QML_ENTRY_POINT "" CACHE STRING "QML file intended to start the monitoring tool UI.")
include(../../../ui/StatusQ/StatusQSources.cmake)
# Macro for merging common code between static and shared
macro(add_target name type)
find_package(Qt5 COMPONENTS Core Qml Gui Quick QuickControls2 Widgets Network Multimedia REQUIRED)
@ -18,33 +20,6 @@ macro(add_target name type)
file(GLOB MONITORING_SOURCES src/Status/Monitoring/*.cpp)
endif()
set(STATUSQ_DIR ../../../ui/StatusQ)
set(STATUSQ_HEADERS
${STATUSQ_DIR}/include/StatusQ/statuswindow.h
${STATUSQ_DIR}/include/StatusQ/typesregistration.h
${STATUSQ_DIR}/include/StatusQ/QClipboardProxy.h
${STATUSQ_DIR}/include/StatusQ/statussyntaxhighlighter.h
${STATUSQ_DIR}/include/StatusQ/rxvalidator.h
)
set(STATUSQ_SOURCES
${STATUSQ_DIR}/src/statuswindow.cpp
${STATUSQ_DIR}/src/typesregistration.cpp
${STATUSQ_DIR}/src/QClipboardProxy.cpp
${STATUSQ_DIR}/src/statussyntaxhighlighter.cpp
${STATUSQ_DIR}/src/rxvalidator.cpp
)
if(APPLE)
list(APPEND STATUSQ_SOURCES
${STATUSQ_DIR}/src/statuswindow_osx.mm
)
else()
list(APPEND STATUSQ_SOURCES
${STATUSQ_DIR}/src/statuswindow_other.cpp
)
endif()
if(APPLE)
file(GLOB MM_FILES src/*.mm src/Status/*.mm)
#prepend items because .mm files need build priority to override cpp impl