1#   BAREOS® - Backup Archiving REcovery Open Sourced
2#
3#   Copyright (C) 2017-2020 Bareos GmbH & Co. KG
4#
5#   This program is Free Software; you can redistribute it and/or
6#   modify it under the terms of version three of the GNU Affero General Public
7#   License as published by the Free Software Foundation and included
8#   in the file LICENSE.
9#
10#   This program is distributed in the hope that it will be useful, but
11#   WITHOUT ANY WARRANTY; without even the implied warranty of
12#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13#   Affero General Public License for more details.
14#
15#   You should have received a copy of the GNU Affero General Public License
16#   along with this program; if not, write to the Free Software
17#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18#   02110-1301, USA.
19
20#
21# configure file all *.in files
22#
23
24# if we're not the toplevel project, then we want to glob in core and debian
25# subdirectories only
26get_directory_property(have_parent PARENT_DIRECTORY)
27if(have_parent)
28  file(GLOB_RECURSE IN_FILES "${CMAKE_SOURCE_DIR}/core/*.in"
29       "${CMAKE_SOURCE_DIR}/debian/*.in"
30  )
31else()
32  file(GLOB_RECURSE IN_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.in")
33endif()
34
35foreach(in_file ${IN_FILES})
36  string(REGEX REPLACE ".in\$" "" file ${in_file})
37  message(STATUS "creating file ${file}")
38  configure_file(${in_file} ${file} @ONLY)
39endforeach()
40