diff --git a/storybook/CMakeLists.txt b/storybook/CMakeLists.txt index dc936308dc..f9ee7fdcde 100644 --- a/storybook/CMakeLists.txt +++ b/storybook/CMakeLists.txt @@ -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 diff --git a/ui/StatusQ/StatusQSources.cmake b/ui/StatusQ/StatusQSources.cmake new file mode 100644 index 0000000000..774cf02315 --- /dev/null +++ b/ui/StatusQ/StatusQSources.cmake @@ -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() diff --git a/ui/StatusQ/sandbox/CMakeLists.txt b/ui/StatusQ/sandbox/CMakeLists.txt index ff0f2c9b81..26039c608d 100644 --- a/ui/StatusQ/sandbox/CMakeLists.txt +++ b/ui/StatusQ/sandbox/CMakeLists.txt @@ -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}) diff --git a/vendor/DOtherSide/lib/CMakeLists.txt b/vendor/DOtherSide/lib/CMakeLists.txt index 3e9bfdfb01..d8f7df9d1f 100644 --- a/vendor/DOtherSide/lib/CMakeLists.txt +++ b/vendor/DOtherSide/lib/CMakeLists.txt @@ -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