From 291002a53bf40d58a08f13b4a04b1e91b620b1be Mon Sep 17 00:00:00 2001 From: Spiros Date: Wed, 16 Apr 2025 01:57:21 +0300 Subject: [PATCH] Move headers to an include folder --- CMakeLists.txt | 4 +++- {src => include}/asciiview.h | 0 {src => include}/custombutton.h | 0 {src => include}/jsonparser.h | 0 {src => include}/mainwindow.h | 3 ++- {src => include}/statusdot.h | 0 {src => include}/utils.h | 0 src/mainwindow.cpp | 1 + 8 files changed, 6 insertions(+), 2 deletions(-) rename {src => include}/asciiview.h (100%) rename {src => include}/custombutton.h (100%) rename {src => include}/jsonparser.h (100%) rename {src => include}/mainwindow.h (98%) rename {src => include}/statusdot.h (100%) rename {src => include}/utils.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index d7a9846..b309f6f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ endif() find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS ${QT_COMPONENTS}) file(GLOB_RECURSE PROJECT_SOURCES - src/*.h + include/*.h src/*.cpp src/*.ui src/resources.qrc @@ -65,6 +65,8 @@ if(CALL_LUPDATE) add_dependencies(${PROJECT_NAME} update_translations) endif() +target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/include) + target_compile_definitions(${PROJECT_NAME} PRIVATE PROJECT_VERSION_MAJOR=${${PROJECT_NAME}_VERSION_MAJOR} PROJECT_VERSION_MINOR=${${PROJECT_NAME}_VERSION_MINOR} diff --git a/src/asciiview.h b/include/asciiview.h similarity index 100% rename from src/asciiview.h rename to include/asciiview.h diff --git a/src/custombutton.h b/include/custombutton.h similarity index 100% rename from src/custombutton.h rename to include/custombutton.h diff --git a/src/jsonparser.h b/include/jsonparser.h similarity index 100% rename from src/jsonparser.h rename to include/jsonparser.h diff --git a/src/mainwindow.h b/include/mainwindow.h similarity index 98% rename from src/mainwindow.h rename to include/mainwindow.h index 202148d..b25ba71 100644 --- a/src/mainwindow.h +++ b/include/mainwindow.h @@ -3,8 +3,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -12,7 +14,6 @@ #include #include "utils.h" -#include "./ui_mainwindow.h" QT_BEGIN_NAMESPACE namespace Ui { diff --git a/src/statusdot.h b/include/statusdot.h similarity index 100% rename from src/statusdot.h rename to include/statusdot.h diff --git a/src/utils.h b/include/utils.h similarity index 100% rename from src/utils.h rename to include/utils.h diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index b3d8e3b..4d9fb71 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1,4 +1,5 @@ #include "mainwindow.h" +#include "ui_mainwindow.h" #include "asciiview.h" #include "statusdot.h" #include "custombutton.h"