From 207bfcf6cef3327fd4ca88cbf4e50a49aa719ae7 Mon Sep 17 00:00:00 2001 From: Andreas Rogge Date: Fri, 2 Feb 2024 08:35:37 +0100 Subject: [PATCH] cmake: move config.h to binary dir --- .gitignore | 1 - core/src/CMakeLists.txt | 6 +++++- core/src/include/bareos.h | 4 ++-- core/src/plugins/CMakeLists.txt | 3 ++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 6a1a53453e0..cedba4701b0 100644 --- a/.gitignore +++ b/.gitignore @@ -54,7 +54,6 @@ core/src/defaultconfigs/tray-monitor.d/client/FileDaemon-local.conf core/src/defaultconfigs/tray-monitor.d/director/Director-local.conf core/src/defaultconfigs/tray-monitor.d/monitor/bareos-mon.conf core/src/defaultconfigs/tray-monitor.d/storage/StorageDaemon-local.conf -core/src/include/config.h core/src/qt-tray-monitor/bareos-tray-monitor.desktop core/src/tests/configs/bareos-configparser-tests/bareos-sd-CFG_TYPE_STR_VECTOR_OF_DIRS.conf core/src/tests/configs/bareos-configparser-tests/bareos-sd.d/storage/bareos-sd.conf diff --git a/core/src/CMakeLists.txt b/core/src/CMakeLists.txt index 3cdbb6a595e..7b035c8f00c 100644 --- a/core/src/CMakeLists.txt +++ b/core/src/CMakeLists.txt @@ -1,6 +1,6 @@ # BAREOSĀ® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2017-2021 Bareos GmbH & Co. KG +# Copyright (C) 2017-2024 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -18,6 +18,10 @@ # 02110-1301, USA. message("Entering ${CMAKE_CURRENT_SOURCE_DIR}") +include(BareosConfigureFile) +bareos_configure_file(FILES include/config.h.in) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + add_subdirectory(filed) if(NOT client-only) diff --git a/core/src/include/bareos.h b/core/src/include/bareos.h index c23b64442c3..60066951153 100644 --- a/core/src/include/bareos.h +++ b/core/src/include/bareos.h @@ -3,7 +3,7 @@ Copyright (C) 2000-2010 Free Software Foundation Europe e.V. Copyright (C) 2011-2012 Planets Communications B.V. - Copyright (C) 2013-2023 Bareos GmbH & Co. KG + Copyright (C) 2013-2024 Bareos GmbH & Co. KG This program is Free Software; you can redistribute it and/or modify it under the terms of version three of the GNU Affero General Public @@ -71,7 +71,7 @@ #ifndef BAREOS_INCLUDE_BAREOS_H_ #define BAREOS_INCLUDE_BAREOS_H_ -#include "config.h" +#include "include/config.h" #if HAVE_AIX_OS # define _LINUX_SOURCE_COMPAT 1 diff --git a/core/src/plugins/CMakeLists.txt b/core/src/plugins/CMakeLists.txt index c6df106f4d2..b42a6bee68b 100644 --- a/core/src/plugins/CMakeLists.txt +++ b/core/src/plugins/CMakeLists.txt @@ -1,6 +1,6 @@ # BAREOSĀ® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2017-2023 Bareos GmbH & Co. KG +# Copyright (C) 2017-2024 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -21,6 +21,7 @@ message("Entering ${CMAKE_CURRENT_SOURCE_DIR}") # create include dirs needed when compiling python modules set(pymod_include_dirs ${PROJECT_SOURCE_DIR}/src) +list(APPEND pymod_include_dirs ${PROJECT_BINARY_DIR}/src) # FreeBSD if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")