2019-07-26 09:43:53 +02:00
|
|
|
#
|
|
|
|
# Copyright(c) 2006 to 2019 ADLINK Technology Limited and others
|
|
|
|
#
|
|
|
|
# This program and the accompanying materials are made available under the
|
|
|
|
# terms of the Eclipse Public License v. 2.0 which is available at
|
|
|
|
# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
|
|
|
# v. 1.0 which is available at
|
|
|
|
# http://www.eclipse.org/org/documents/edl-v10.php.
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
2020-04-02 10:25:16 -05:00
|
|
|
|
|
|
|
# These are all various expressions of the configuration schema
|
|
|
|
get_filename_component(config_c_PATH "../src/core/ddsi/src/q_config.c" REALPATH BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
|
|
|
|
|
|
|
# although the following files are generated, we check them into source control for convenience
|
|
|
|
get_filename_component(config_rnc_PATH "../etc/cyclonedds.rnc" REALPATH BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
|
|
|
get_filename_component(config_xsd_PATH "../etc/cyclonedds.xsd" REALPATH BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
|
|
|
get_filename_component(config_md_PATH "./manual/options.md" REALPATH BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
|
|
|
|
|
|
|
if(BUILD_SCHEMA OR BUILD_DOCS)
|
|
|
|
find_package(Perl REQUIRED)
|
2019-11-01 14:54:27 +01:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT
|
2020-04-02 10:25:16 -05:00
|
|
|
"${config_md_PATH}" "${config_rnc_PATH}"
|
2019-11-01 14:54:27 +01:00
|
|
|
COMMAND
|
2020-04-02 10:25:16 -05:00
|
|
|
${PERL_EXECUTABLE} -w "${CMAKE_CURRENT_SOURCE_DIR}/makernc.pl" "${config_c_PATH}" "${config_md_PATH}" "${config_rnc_PATH}"
|
|
|
|
COMMENT "Generating Relax NG schema and Markdown documentation for config options"
|
2019-11-01 14:54:27 +01:00
|
|
|
DEPENDS
|
2020-04-02 10:25:16 -05:00
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/makernc.pl"
|
|
|
|
"${config_c_PATH}")
|
|
|
|
add_custom_target(options_doc ALL DEPENDS "${config_md_PATH}" "${config_rnc_PATH}")
|
2019-11-01 14:54:27 +01:00
|
|
|
|
2020-04-02 10:25:16 -05:00
|
|
|
find_package(Trang REQUIRED)
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT "${config_xsd_PATH}"
|
|
|
|
COMMAND ${Trang_TRANG_CMD} -I rnc -O xsd "${config_rnc_PATH}" "${config_xsd_PATH}"
|
|
|
|
COMMENT "Translating schema into XSD"
|
|
|
|
DEPENDS "${config_rnc_PATH}")
|
|
|
|
add_custom_target(options_xsd ALL DEPENDS "${config_xsd_PATH}")
|
2019-11-01 14:54:27 +01:00
|
|
|
endif()
|
2019-07-26 09:43:53 +02:00
|
|
|
|
2020-04-02 10:25:16 -05:00
|
|
|
if(BUILD_DOCS)
|
|
|
|
find_package(Sphinx REQUIRED breathe)
|
|
|
|
sphinx_add_docs(
|
|
|
|
docs
|
|
|
|
BREATHE_PROJECTS ddsc_api_docs
|
|
|
|
BUILDER html
|
2020-05-06 09:57:56 +02:00
|
|
|
SOURCE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/manual")
|
2020-04-02 10:25:16 -05:00
|
|
|
add_dependencies(docs options_doc)
|
|
|
|
|
|
|
|
install(
|
2020-05-06 09:57:56 +02:00
|
|
|
DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/docs"
|
2020-04-02 10:25:16 -05:00
|
|
|
DESTINATION "${CMAKE_INSTALL_DOCDIR}/manual"
|
|
|
|
COMPONENT dev)
|
|
|
|
endif()
|