0001 ##
0002 ## @brief Build documentation
0003 ##
0004 ## @file CMakeLists.txt
0005 ##
0006 ## -----------------------------------------------------------------------------
0007 ## Enduro/X Middleware Platform for Distributed Transaction Processing
0008 ## Copyright (C) 2009-2016, ATR Baltic, Ltd. All Rights Reserved.
0009 ## Copyright (C) 2017-2023, Mavimax, Ltd. All Rights Reserved.
0010 ## This software is released under one of the following licenses:
0011 ## AGPL (with Java and Go exceptions) or Mavimax's license for commercial use.
0012 ## See LICENSE file for full text.
0013 ## -----------------------------------------------------------------------------
0014 ## AGPL license:
0015 ##
0016 ## This program is free software; you can redistribute it and/or modify it under
0017 ## the terms of the GNU Affero General Public License, version 3 as published
0018 ## by the Free Software Foundation;
0019 ##
0020 ## This program is distributed in the hope that it will be useful, but WITHOUT ANY
0021 ## WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
0022 ## PARTICULAR PURPOSE. See the GNU Affero General Public License, version 3
0023 ## for more details.
0024 ##
0025 ## You should have received a copy of the GNU Affero General Public License along
0026 ## with this program; if not, write to the Free Software Foundation, Inc.,
0027 ## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
0028 ##
0029 ## -----------------------------------------------------------------------------
0030 ## A commercial use license is available from Mavimax, Ltd
0031 ## contact@mavimax.com
0032 ## -----------------------------------------------------------------------------
0033 ##
0034 cmake_minimum_required(VERSION 3.5)
0035
0036 find_program(A2X_EXECUTABLE NAMES a2x)
0037
0038 set(MAN5_NAMES ex_env ndrxdebug.conf ndrxconfig.xml ex_envover q.conf
0039 viewfile tpcache.ini ubfdb.ini tm_mib)
0040
0041 set(MAN8_NAMES xadmin ndrxd ud mkfldhdr tpbridge tpevsrv tmsrv
0042 tprecover cpmsrv tmqueue cconfsrv tpbrdcstsv uvlog xmemck
0043 viewc buildclient buildserver buildtms exencrypt exdecrypt libcryptohost
0044 edb_dump edb_copy edb_stat edb_load tpcachebtsv tpcached tpcachesv
0045 libndrxxapq libndrxxaecpg libndrxxawsmqs libndrxxaoras tpadmsv libndrxxanulls
0046 libndrxxatmsx exbenchcl exbenchsv libndrxxaqdisks
0047 tmrecovercl tmrecoversv ubb2ex exsinglesv exsingleckl exsingleckr)
0048
0049 set(HTML_FILES ${MAN5_NAMES} ${MAN8_NAMES})
0050
0051 file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man5
0052 ${CMAKE_CURRENT_BINARY_DIR}/man8
0053 ${CMAKE_CURRENT_BINARY_DIR}/html5
0054 ${CMAKE_CURRENT_BINARY_DIR}/html8)
0055
0056 # Generate MAN5
0057 set(A2X_OPTS_MAN5 --format=manpage -D man5)
0058 set(MAN5_FILES)
0059 foreach(m IN LISTS MAN5_NAMES)
0060 set(mf ${CMAKE_CURRENT_BINARY_DIR}/man5/${m}.5)
0061 set(ms ${CMAKE_CURRENT_SOURCE_DIR}/${m}.adoc)
0062 add_custom_command(OUTPUT ${mf}
0063 COMMAND ${A2X_EXECUTABLE} ${A2X_OPTS_MAN5} ${ms}
0064 DEPENDS ${ms}
0065 WORKING_DIRECTORY .
0066 COMMENT "Building MAN 5 ${mf}"
0067 VERBATIM)
0068 list(APPEND MAN5_FILES ${mf})
0069 # Install the docs
0070 install (FILES
0071 ${mf}
0072 DESTINATION share/man/man5)
0073
0074 endforeach()
0075 add_custom_target(man5 ALL DEPENDS ${MAN5_FILES})
0076
0077 # Generate MAN8
0078 set(A2X_OPTS_MAN8 --format=manpage -D man8)
0079 set(MAN8_FILES)
0080 foreach(m IN LISTS MAN8_NAMES)
0081 set(mf ${CMAKE_CURRENT_BINARY_DIR}/man8/${m}.8)
0082 set(ms ${CMAKE_CURRENT_SOURCE_DIR}/${m}.adoc)
0083 add_custom_command(OUTPUT ${mf}
0084 COMMAND ${A2X_EXECUTABLE} ${A2X_OPTS_MAN8} ${ms}
0085 DEPENDS ${ms}
0086 WORKING_DIRECTORY .
0087 COMMENT "Building MAN 8 ${mf}"
0088 VERBATIM)
0089 list(APPEND MAN8_FILES ${mf})
0090
0091 # Install the docs
0092 install (FILES
0093 ${mf}
0094 DESTINATION share/man/man8)
0095
0096 endforeach()
0097 add_custom_target(man8 ALL DEPENDS ${MAN8_FILES})
0098
0099 #
0100 # html man pages, man 5
0101 #
0102 set(A2X_OPTS_XHTML_MAN -f xhtml -D html5)
0103 set(HTML_FILES)
0104 foreach(m IN LISTS MAN5_NAMES)
0105 set(mf ${CMAKE_CURRENT_BINARY_DIR}/html5/${m}.html)
0106 set(ms ${CMAKE_CURRENT_SOURCE_DIR}/${m}.adoc)
0107 add_custom_command(OUTPUT ${mf}
0108 COMMAND ${A2X_EXECUTABLE} ${A2X_OPTS_XHTML_MAN} ${ms}
0109 DEPENDS ${ms}
0110 WORKING_DIRECTORY .
0111 COMMENT "Building HTML_MAN ${mf}"
0112 VERBATIM)
0113 list(APPEND HTML_FILES ${mf})
0114
0115 # Install the docs
0116 install (FILES
0117 ${mf}
0118 DESTINATION share/endurox/doc/html/manuals)
0119
0120 endforeach()
0121 add_custom_target(man5html ALL DEPENDS ${HTML_FILES})
0122
0123 install (FILES
0124 ${CMAKE_CURRENT_BINARY_DIR}/html5/docbook-xsl.css
0125 DESTINATION share/endurox/doc/html/manuals
0126 OPTIONAL)
0127
0128
0129 #
0130 # html man pages, man 8
0131 #
0132 set(A2X_OPTS_XHTML_MAN -f xhtml -D html8)
0133 set(HTML_FILES)
0134 foreach(m IN LISTS MAN8_NAMES)
0135 set(mf ${CMAKE_CURRENT_BINARY_DIR}/html8/${m}.html)
0136 set(ms ${CMAKE_CURRENT_SOURCE_DIR}/${m}.adoc)
0137 add_custom_command(OUTPUT ${mf}
0138 COMMAND ${A2X_EXECUTABLE} ${A2X_OPTS_XHTML_MAN} ${ms}
0139 DEPENDS ${ms}
0140 WORKING_DIRECTORY .
0141 COMMENT "Building HTML_MAN ${mf}"
0142 VERBATIM)
0143 list(APPEND HTML_FILES ${mf})
0144
0145 # Install the docs
0146 install (FILES
0147 ${mf}
0148 DESTINATION share/endurox/doc/html/manuals)
0149
0150 endforeach()
0151
0152 add_custom_target(man8html ALL DEPENDS ${HTML_FILES})
0153
0154 # end.
0155
0156
0157 # vim: set ts=4 sw=4 et smartindent: