"Fossies" - the Fresh Open Source Software Archive

Member "bareos-Release-21.1.4/docs/manuals/CMakeLists.txt" (5 Aug 2022, 5425 Bytes) of package /linux/misc/bareos-Release-21.1.4.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": 21.0.0_vs_21.1.0.

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