From 29e331ee6d5b8becf5a4bc1c54a5eea918dd2259 Mon Sep 17 00:00:00 2001 From: Jesse Qu Date: Thu, 17 Apr 2025 11:26:46 +0800 Subject: [PATCH] Adjusted the project architecture --- apps/CMakeLists.txt | 29 +++++++++++++++++++++++------ apps/{ => include}/logger.h | 0 apps/{ => include}/mainwindow.h | 0 apps/{ => include}/settings.h | 0 apps/{ => source}/logger.cpp | 0 apps/{ => source}/main.cpp | 0 apps/{ => source}/mainwindow.cpp | 0 apps/{ => source}/settings.cpp | 0 apps/{ => ui}/mainwindow.ui | 0 libs/libsGoesHere.txt | 0 10 files changed, 23 insertions(+), 6 deletions(-) rename apps/{ => include}/logger.h (100%) rename apps/{ => include}/mainwindow.h (100%) rename apps/{ => include}/settings.h (100%) rename apps/{ => source}/logger.cpp (100%) rename apps/{ => source}/main.cpp (100%) rename apps/{ => source}/mainwindow.cpp (100%) rename apps/{ => source}/settings.cpp (100%) rename apps/{ => ui}/mainwindow.ui (100%) create mode 100644 libs/libsGoesHere.txt diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt index 162b826..eb98e32 100644 --- a/apps/CMakeLists.txt +++ b/apps/CMakeLists.txt @@ -3,18 +3,35 @@ project(EventConfigurator LANGUAGES CXX) find_package(Qt6 6.5 REQUIRED COMPONENTS Core Widgets) +set(CMAKE_AUTOUIC_SEARCH_PATHS "ui") + qt_standard_project_setup() +set(H_HEADER_FILES + include/mainwindow.h + include/logger.h + include/settings.h +) + +set(CPP_SOURCE_FILES + source/main.cpp + source/mainwindow.cpp + source/logger.cpp + source/settings.cpp +) + +set(UI_FILES + ui/mainwindow.ui +) + qt_add_executable(EventConfigurator WIN32 MACOSX_BUNDLE - main.cpp - mainwindow.cpp - mainwindow.h - mainwindow.ui - logger.h logger.cpp - settings.h settings.cpp + ${H_HEADER_FILES} + ${CPP_SOURCE_FILES} + ${UI_FILES} ) +target_include_directories(EventConfigurator PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include") target_link_libraries(EventConfigurator PRIVATE Qt::Core diff --git a/apps/logger.h b/apps/include/logger.h similarity index 100% rename from apps/logger.h rename to apps/include/logger.h diff --git a/apps/mainwindow.h b/apps/include/mainwindow.h similarity index 100% rename from apps/mainwindow.h rename to apps/include/mainwindow.h diff --git a/apps/settings.h b/apps/include/settings.h similarity index 100% rename from apps/settings.h rename to apps/include/settings.h diff --git a/apps/logger.cpp b/apps/source/logger.cpp similarity index 100% rename from apps/logger.cpp rename to apps/source/logger.cpp diff --git a/apps/main.cpp b/apps/source/main.cpp similarity index 100% rename from apps/main.cpp rename to apps/source/main.cpp diff --git a/apps/mainwindow.cpp b/apps/source/mainwindow.cpp similarity index 100% rename from apps/mainwindow.cpp rename to apps/source/mainwindow.cpp diff --git a/apps/settings.cpp b/apps/source/settings.cpp similarity index 100% rename from apps/settings.cpp rename to apps/source/settings.cpp diff --git a/apps/mainwindow.ui b/apps/ui/mainwindow.ui similarity index 100% rename from apps/mainwindow.ui rename to apps/ui/mainwindow.ui diff --git a/libs/libsGoesHere.txt b/libs/libsGoesHere.txt new file mode 100644 index 0000000..e69de29