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:
		
							parent
							
								
									4e80559763
								
							
						
					
					
						commit
						9cf4b97f1a
					
				
					 102 changed files with 627 additions and 1925 deletions
				
			
		
							
								
								
									
										105
									
								
								examples/CMakeLists.txt
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										105
									
								
								examples/CMakeLists.txt
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,105 @@
 | 
			
		|||
#
 | 
			
		||||
# Copyright(c) 2006 to 2018 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
 | 
			
		||||
#
 | 
			
		||||
set(CMAKE_INSTALL_EXAMPLESDIR "${CMAKE_INSTALL_DATADIR}/${CMAKE_PROJECT_NAME}/examples")
 | 
			
		||||
 | 
			
		||||
add_subdirectory(helloworld)
 | 
			
		||||
add_subdirectory(roundtrip)
 | 
			
		||||
add_subdirectory(throughput)
 | 
			
		||||
 | 
			
		||||
if (BUILD_DOCS)
 | 
			
		||||
  message(STATUS "${CMAKE_PROJECT_NAME} Examples documentation: Success (build)")
 | 
			
		||||
  set(EXAMPLES_HTML_ARCHIVE "${CMAKE_PROJECT_NAME}ExamplesHTML.tar.gz")
 | 
			
		||||
  # Process sphinx configuration file
 | 
			
		||||
  set(sph_conf_author "Eclipse Cyclone DDS project")
 | 
			
		||||
  string(TIMESTAMP sph_conf_copyright "%Y")
 | 
			
		||||
  set(sph_conf_version "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
 | 
			
		||||
  set(sph_conf_release "${PROJECT_VERSION}")
 | 
			
		||||
  configure_file(sphinx-conf.py.in conf.py @ONLY)
 | 
			
		||||
 | 
			
		||||
  set(builder_output "examples_html_output")
 | 
			
		||||
  set(builder_log "sphinx-examples-html.log")
 | 
			
		||||
  add_custom_command(OUTPUT ${builder_output}
 | 
			
		||||
    COMMAND ${SPHINX_EXECUTABLE}
 | 
			
		||||
    -b html
 | 
			
		||||
    -d ${CMAKE_CURRENT_BINARY_DIR}/cache
 | 
			
		||||
    -c ${CMAKE_CURRENT_BINARY_DIR}
 | 
			
		||||
    ${CMAKE_CURRENT_SOURCE_DIR}
 | 
			
		||||
    ${CMAKE_CURRENT_BINARY_DIR} > ${builder_log}
 | 
			
		||||
    COMMENT "Running Sphinx for examples html output"
 | 
			
		||||
    VERBATIM)
 | 
			
		||||
 | 
			
		||||
  # OUTPUT is a fake target / symbolic name, not an actual file
 | 
			
		||||
  set_property(SOURCE ${builder_output} PROPERTY SYMBOLIC 1)
 | 
			
		||||
  add_custom_target(examples_docs ALL DEPENDS ${builder_output})
 | 
			
		||||
 | 
			
		||||
  # Archive the output html files, will become a jenkins artifact for use in other jobs
 | 
			
		||||
  # TODO this hardcoded list and archiving should be replaced by ExternalData refs
 | 
			
		||||
  set(html_outputs
 | 
			
		||||
    "_static"
 | 
			
		||||
    "search.html"
 | 
			
		||||
    "searchindex.js"
 | 
			
		||||
    "genindex.html"
 | 
			
		||||
    "examples.html"
 | 
			
		||||
    "helloworld/readme.html"
 | 
			
		||||
    "roundtrip/readme.html"
 | 
			
		||||
    "throughput/readme.html")
 | 
			
		||||
 | 
			
		||||
  add_custom_command(OUTPUT ${builder_output}
 | 
			
		||||
    COMMAND ${CMAKE_COMMAND}
 | 
			
		||||
    -E tar "zcf"
 | 
			
		||||
    "${EXAMPLES_HTML_ARCHIVE}"
 | 
			
		||||
    ${html_outputs}
 | 
			
		||||
    APPEND
 | 
			
		||||
    VERBATIM)
 | 
			
		||||
 | 
			
		||||
  # Remove generated files when cleaning the build tree
 | 
			
		||||
  set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
 | 
			
		||||
    "cache"
 | 
			
		||||
    "${builder_log}"
 | 
			
		||||
    "objects.inv"
 | 
			
		||||
    ${html_outputs}
 | 
			
		||||
    "_sources"
 | 
			
		||||
    "${EXAMPLES_HTML_ARCHIVE}")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
 | 
			
		||||
  set(platform_exclude "examples/helloworld/Makefile")
 | 
			
		||||
elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
 | 
			
		||||
  set(platform_exclude "examples/helloworld/vs|examples/helloworld/HelloWorld\.sln")
 | 
			
		||||
else()
 | 
			
		||||
  set(platform_exclude "this_is_a_placeholder")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
# Install example source-files
 | 
			
		||||
install(
 | 
			
		||||
  DIRECTORY "${PROJECT_SOURCE_DIR}/examples/"
 | 
			
		||||
  DESTINATION "${CMAKE_INSTALL_EXAMPLESDIR}"
 | 
			
		||||
  COMPONENT dev
 | 
			
		||||
  PATTERN "CMakeLists.export" EXCLUDE
 | 
			
		||||
  PATTERN "examples/CMakeLists.txt" EXCLUDE
 | 
			
		||||
  REGEX ${platform_exclude} EXCLUDE
 | 
			
		||||
  REGEX "\.rst|\.py" EXCLUDE)
 | 
			
		||||
 | 
			
		||||
# Install example html docs files
 | 
			
		||||
# TODO this should be replaced by install commands that use ExternalData refs (preferably in examples' CMakeLists.txt)
 | 
			
		||||
install(
 | 
			
		||||
  DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/"
 | 
			
		||||
  DESTINATION "${CMAKE_INSTALL_EXAMPLESDIR}"
 | 
			
		||||
  COMPONENT dev
 | 
			
		||||
  FILES_MATCHING
 | 
			
		||||
  PATTERN "CMakeFiles" EXCLUDE
 | 
			
		||||
  PATTERN "cache" EXCLUDE
 | 
			
		||||
  PATTERN "_sources" EXCLUDE
 | 
			
		||||
  PATTERN "*.html"
 | 
			
		||||
  PATTERN "*.js"
 | 
			
		||||
  PATTERN "_static/*")
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue