From e7f1d48db622188ce5512a31fdf961be625b9fa2 Mon Sep 17 00:00:00 2001 From: blue Date: Mon, 10 Oct 2022 23:51:48 +0300 Subject: [PATCH] some fixes to help build in nested project --- CMakeLists.txt | 6 +++++- database.h | 1 + exceptions.h | 2 ++ serializer.h | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 26e1b4a..7d774e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,9 @@ option(BUILD_STATIC "Builds library as static library" ON) option(BUILD_TESTS "Builds tests" ON) include(GNUInstallDirs) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTORCC ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake") @@ -68,7 +71,8 @@ endif () set_target_properties(storage PROPERTIES PUBLIC_HEADER "${HEADERS}") -target_include_directories(storage PRIVATE ${CMAKE_SOURCE_DIR}) +target_include_directories(storage PUBLIC ${CMAKE_SOURCE_DIR}) +target_include_directories(storage PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories(storage PRIVATE ${Qt${QT_VERSION_MAJOR}_INCLUDE_DIRS}) target_include_directories(storage PRIVATE ${Qt${QT_VERSION_MAJOR}Core_INCLUDE_DIRS}) diff --git a/database.h b/database.h index 98ce4cf..a56a5a4 100644 --- a/database.h +++ b/database.h @@ -19,6 +19,7 @@ #include #include +#include #include #include diff --git a/exceptions.h b/exceptions.h index 2d06535..88c2e6a 100644 --- a/exceptions.h +++ b/exceptions.h @@ -19,6 +19,8 @@ #include #include +#include + #include "database.h" class DataBase::Exception : public std::exception diff --git a/serializer.h b/serializer.h index 82f9880..3350e8b 100644 --- a/serializer.h +++ b/serializer.h @@ -17,6 +17,8 @@ #ifndef CORE_DATABASE_SERIALIZER_H #define CORE_DATABASE_SERIALIZER_H +#include + #include #include #include