Skip to content

Commit

Permalink
Merge pull request #767 from arogge/dev/arogge/master/generated-files
Browse files Browse the repository at this point in the history
cmake: do not pollute sourcetree with untracked files
  • Loading branch information
pstorz committed Apr 16, 2021
2 parents c7aa25e + 0931898 commit 8e7d624
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -57,6 +57,7 @@ debian/bareos-filedaemon-python-plugin.install
debian/bareos-filedaemon-python-plugins-common.install
debian/bareos-filedaemon-python2-plugin.install
debian/bareos-filedaemon-python3-plugin.install
debian/bareos-filedaemon-postgresql-python-plugin.install
debian/bareos-filedaemon.bareos-fd.init
debian/bareos-filedaemon.install
debian/bareos-filedaemon.postinst
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -46,6 +46,7 @@ and since Bareos version 20 this project adheres to [Semantic Versioning](https:
- storage daemon: class Device: rename dev_name to archive_device_string (as the value stored here is the value of the "Archive Device" directive) [PR #744]
- Enable c++17 support [PR #741]
- webui: Localization updated [PR #776]
- running cmake for the core-directory only is now forbidden [PR #767]

### Deprecated

Expand Down
7 changes: 7 additions & 0 deletions core/CMakeLists.txt
Expand Up @@ -21,6 +21,13 @@ message("Entering ${CMAKE_CURRENT_SOURCE_DIR}")
cmake_minimum_required(VERSION 3.12)
project(bareos C CXX)

if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
message(
FATAL_ERROR
"Building from bareos/core/ is not supported anymore. Use bareos/ instead"
)
endif()

if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif(POLICY CMP0054)
Expand Down
19 changes: 8 additions & 11 deletions core/cmake/BareosConfigureFile.cmake
@@ -1,6 +1,6 @@
# BAREOS® - Backup Archiving REcovery Open Sourced
#
# Copyright (C) 2017-2020 Bareos GmbH & Co. KG
# Copyright (C) 2017-2021 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
Expand All @@ -21,16 +21,13 @@
# configure file all *.in files
#

# if we're not the toplevel project, then we want to glob in core and debian
# subdirectories only
get_directory_property(have_parent PARENT_DIRECTORY)
if(have_parent)
file(GLOB_RECURSE IN_FILES "${CMAKE_SOURCE_DIR}/core/*.in"
"${CMAKE_SOURCE_DIR}/debian/*.in"
)
else()
file(GLOB_RECURSE IN_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.in")
endif()
file(
GLOB_RECURSE IN_FILES
"${CMAKE_SOURCE_DIR}/debian/*.in"
"${CMAKE_SOURCE_DIR}/core/src/*.in"
"${CMAKE_SOURCE_DIR}/core/scripts/*.in"
"${CMAKE_SOURCE_DIR}/core/platforms/*.in"
)

foreach(in_file ${IN_FILES})
string(REGEX REPLACE ".in\$" "" file ${in_file})
Expand Down

0 comments on commit 8e7d624

Please sign in to comment.