"Fossies" - the Fresh Open Source Software Archive

Member "bareos-Release-20.0.3/docs/manuals/CMakeLists.txt" (14 Sep 2021, 5288 Bytes) of package /linux/misc/bareos-Release-20.0.3.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "CMakeLists.txt": 19.2.9_vs_20.0.0.

    1 # BAREOSĀ® - Backup Archiving REcovery Open Sourced
    2 #
    3 # Copyright (C) 2019-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 cmake_minimum_required(VERSION 3.0)
   21 
   22 project(bareos-docs NONE)
   23 
   24 # commands building json files ######
   25 add_custom_command(
   26   OUTPUT
   27     ${PROJECT_SOURCE_DIR}/source/include/autogenerated/bareos-dir-config-schema.json
   28   COMMAND bareos-dir -xs >/dev/null
   29   COMMAND
   30     bareos-dir -xs
   31     >${PROJECT_SOURCE_DIR}/source/include/autogenerated/bareos-dir-config-schema.json
   32   COMMAND
   33     sed --in-place --expression="/\\\"version\\\":/d"
   34     ${PROJECT_SOURCE_DIR}/source/include/autogenerated/bareos-dir-config-schema.json
   35   DEPENDS $<$<BOOL:${docs-build-json}>:bareos-dir>
   36 )
   37 
   38 add_custom_command(
   39   OUTPUT
   40     ${PROJECT_SOURCE_DIR}/source/include/autogenerated/bareos-sd-config-schema.json
   41   COMMAND bareos-sd -xs >/dev/null
   42   COMMAND
   43     bareos-sd -xs
   44     >${PROJECT_SOURCE_DIR}/source/include/autogenerated/bareos-sd-config-schema.json
   45   COMMAND
   46     sed --in-place --expression="/\\\"version\\\":/d"
   47     ${PROJECT_SOURCE_DIR}/source/include/autogenerated/bareos-sd-config-schema.json
   48   DEPENDS $<$<BOOL:${docs-build-json}>:bareos-sd>
   49 )
   50 
   51 add_custom_command(
   52   OUTPUT
   53     ${PROJECT_SOURCE_DIR}/source/include/autogenerated/bareos-fd-config-schema.json
   54   COMMAND bareos-fd -xs >/dev/null
   55   COMMAND
   56     bareos-fd -xs
   57     >${PROJECT_SOURCE_DIR}/source/include/autogenerated/bareos-fd-config-schema.json
   58   COMMAND
   59     sed --in-place --expression="/\\\"version\\\":/d"
   60     ${PROJECT_SOURCE_DIR}/source/include/autogenerated/bareos-fd-config-schema.json
   61   DEPENDS $<$<BOOL:${docs-build-json}>:bareos-fd>
   62 )
   63 
   64 add_custom_command(
   65   OUTPUT
   66     ${PROJECT_SOURCE_DIR}/source/include/autogenerated/bconsole-config-schema.json
   67   COMMAND bconsole -xs >/dev/null
   68   COMMAND
   69     bconsole -xs
   70     >${PROJECT_SOURCE_DIR}/source/include/autogenerated/bconsole-config-schema.json
   71   COMMAND
   72     sed --in-place --expression="/\\\"version\\\":/d"
   73     ${PROJECT_SOURCE_DIR}/source/include/autogenerated/bconsole-config-schema.json
   74   DEPENDS $<$<BOOL:${docs-build-json}>:bconsole>
   75 )
   76 
   77 add_custom_command(
   78   OUTPUT
   79     ${PROJECT_SOURCE_DIR}/source/include/autogenerated/bareos-tray-monitor-config-schema.json
   80   COMMAND bareos-tray-monitor -xs >/dev/null
   81   COMMAND
   82     bareos-tray-monitor -xs
   83     >${PROJECT_SOURCE_DIR}/source/include/autogenerated/bareos-tray-monitor-config-schema.json
   84   COMMAND
   85     sed --in-place --expression="/\\\"version\\\":/d"
   86     ${PROJECT_SOURCE_DIR}/source/include/autogenerated/bareos-tray-monitor-config-schema.json
   87   DEPENDS $<$<BOOL:${docs-build-json}>:bareos-tray-monitor>
   88 )
   89 
   90 set(AUTOGENERATED_RESOURCE_DESCRIPTION_JSON_FILES
   91     ${PROJECT_SOURCE_DIR}/source/include/autogenerated/bareos-dir-config-schema.json
   92     ${PROJECT_SOURCE_DIR}/source/include/autogenerated/bareos-sd-config-schema.json
   93     ${PROJECT_SOURCE_DIR}/source/include/autogenerated/bareos-fd-config-schema.json
   94     ${PROJECT_SOURCE_DIR}/source/include/autogenerated/bconsole-config-schema.json
   95     ${PROJECT_SOURCE_DIR}/source/include/autogenerated/bareos-tray-monitor-config-schema.json
   96 )
   97 
   98 if(${docs-build-json})
   99   set(CLEAN_JSON_FILES
  100       rm -f ${PROJECT_SOURCE_DIR}/source/include/autogenerated/*.json
  101   )
  102 endif()
  103 
  104 # target: clean-docs ######
  105 add_custom_target(
  106   clean-docs
  107   COMMAND ${CLEAN_JSON_FILES}
  108   COMMAND rm -f ${PROJECT_SOURCE_DIR}/source/include/autogenerated/*.inc
  109   COMMAND rm -rf ${PROJECT_BINARY_DIR}/BareosMainReference
  110 )
  111 
  112 # target: check-git ###### To prevent documentation to be built out of sync with
  113 # the actual binaries, this target checks if the generated json files differ
  114 # from the ones in the repository.
  115 
  116 add_custom_target(
  117   check-git
  118   COMMAND git diff -p --exit-code --stat=80
  119           ${PROJECT_SOURCE_DIR}/source/include/autogenerated
  120   DEPENDS ${AUTOGENERATED_RESOURCE_DESCRIPTION_JSON_FILES}
  121   WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
  122   COMMENT
  123     "Comparing json files in \"${PROJECT_SOURCE_DIR}/source/include/autogenerated\" with git repo"
  124 )
  125 
  126 set(SPHINX_OPTS $ENV{SPHINX_OPTS})
  127 set(SPHINX_COMMAND sphinx-build)
  128 set(SPHINX_BUILDDIR ${PROJECT_BINARY_DIR}/BareosMainReference)
  129 set(SPHINX_SOURCE_DIR ${PROJECT_SOURCE_DIR}/source)
  130 
  131 if(${docs-only})
  132   set(DOCS_ALL ALL) # this enables "make docs" by just typing "make"
  133 endif()
  134 
  135 # target: docs ######
  136 add_custom_target(
  137   docs
  138   ${DOCS_ALL}
  139   COMMAND ${SPHINX_COMMAND} -M html "${SPHINX_SOURCE_DIR}" "${SPHINX_BUILDDIR}"
  140           "${SPHINX_OPTS}"
  141   COMMAND ${SPHINX_COMMAND} -b man "${SPHINX_SOURCE_DIR}" "${SPHINX_BUILDDIR}"
  142           "${SPHINX_OPTS}"
  143   DEPENDS $<$<BOOL:${docs-build-json}>:clean-docs>
  144   DEPENDS check-git
  145 )