Reorganize repository

* Move the project top-level CMakeLists.txt to the root of the project;
  this allows building Cyclone as part of ROS2 without any special
  tricks;

* Clean up the build options:

  ENABLE_SSL:    whether to check for and include OpenSSL support if a
                 library can be found (default = ON); this used to be
                 called DDSC_ENABLE_OPENSSL, the old name is deprecated
                 but still works
  BUILD_DOCS:    whether to build docs (default = OFF)
  BUILD_TESTING: whether to build test (default = OFF)

* Collect all documentation into top-level "docs" directory;

* Move the examples to the top-level directory;

* Remove the unused and somewhat misleading pseudo-default
  cyclonedds.xml;

* Remove unused cmake files

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
Erik Boasson 2019-07-26 09:43:53 +02:00 committed by eboasson
parent 4e80559763
commit 9cf4b97f1a
102 changed files with 627 additions and 1925 deletions

49
docs/CMakeLists.txt Normal file
View file

@ -0,0 +1,49 @@
#
# 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
# TODO depending on requirements we can add/remove options as needed,
# these are examples of generators we'll need as a minimum.
# Perhaps we should also consider options for building subset of all docs.
# When a certain doc is related to a target, no option is needed; you can simply check if the target exists
# (i.e. if a target 'ddsc' exists, build ddsc api docs). And possibly make the target definition dependent on an option.
find_program(SPHINX_EXECUTABLE NAMES sphinx-build DOC "Sphinx documentation builder")
if (NOT SPHINX_EXECUTABLE)
message(FATAL_ERROR "${CMAKE_PROJECT_NAME} documentation: unable to find sphinx-build executable")
endif()
find_package(Doxygen)
if (NOT Doxygen_FOUND)
message(FATAL_ERROR "${CMAKE_PROJECT_NAME} documentation: unable to find Doxygen")
endif()
# Creating pdf from latex requires latexmk (which depends on perl, latexpdf et. al)
find_program(LATEXMK_EXECUTABLE NAMES latexmk DOC "LateX PDF Generator")
if (NOT LATEXMK_EXECUTABLE)
message(FATAL_ERROR "${CMAKE_PROJECT_NAME} documentation: unable to find latexmk")
endif()
if (SPHINX_EXECUTABLE AND Doxygen_FOUND AND LATEXMK_EXECUTABLE)
set(BUILD_DOCS ON PARENT_SCOPE) # for examples' docs
set(BUILD_DOCS ON)
message(STATUS "${CMAKE_PROJECT_NAME} documentation: Success (build)")
endif()
if(BUILD_DOCS)
add_subdirectory(manual)
endif()
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html
DESTINATION ${CMAKE_INSTALL_DOCDIR}
COMPONENT dev)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.pdf
DESTINATION ${CMAKE_INSTALL_DOCDIR}
COMPONENT dev)