Skip to content

Commit

Permalink
Drop dependency on YARP, add MkDocs custom target
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterBowman committed Aug 13, 2024
1 parent 9d05ded commit bacfc4a
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
14 changes: 6 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ cmake_minimum_required(VERSION 3.12)
# Define a project.
project(ROBOTICSLAB_INSTALLATION_GUIDES LANGUAGES NONE)

# Find dependencies
find_package(YCM 0.10 REQUIRED)
find_package(YARP 3.0 REQUIRED)
# Pick up our cmake modules.
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)

# Set some useful variables - paths relative to the installation prefix.
yarp_configure_external_installation(roboticslab-installation-guides)
# Find dependencies.
find_package(YCM 0.10 REQUIRED)

# Install docs, and also create a copy in the local build tree.
yarp_install(DIRECTORY docs
DESTINATION ${ROBOTICSLAB-INSTALLATION-GUIDES_CONTEXTS_INSTALL_DIR})
# Add custom rule to generate and install the MkDocs site.
include(AddMkDocsTarget)

# Store the package in the user registry.
set(CMAKE_EXPORT_PACKAGE_REGISTRY ON)
Expand Down
19 changes: 19 additions & 0 deletions cmake/AddMkDocsTarget.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
include_guard(GLOBAL)

# Find MkDocs
find_program(MKDOCS_ABSPATH NAMES mkdocs)

if(MKDOCS_ABSPATH)
include(GNUInstallDirs)

set(_site_dir ${CMAKE_BINARY_DIR}/site)

# Add a custom target to generate the documentation.
add_custom_target(mkdocs ALL ${MKDOCS_ABSPATH} build --site-dir ${_site_dir}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Generating MkDocs documentation in ${_site_dir}")

# Install the generated documentation.
install(DIRECTORY ${_site_dir}
DESTINATION ${CMAKE_INSTALL_DOCDIR})
endif()
2 changes: 1 addition & 1 deletion docs/install-ycm.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ You may set these values on a per-repository basis. In order to achieve that, br

## YCM and OpenSSL

During its build phase, YCM expects that CMake offers support for the `https://` protocol. Older CMake releases and locally built instances may lack this, see [OpenSSL support](install-cmake.md#openssl-support).
During its build phase, YCM expects that CMake offers support for the `https://` protocol. Older CMake releases and locally built instances may lack this, see [OpenSSL support](legacy/legacy-install-cmake.md#openssl-support-older-distros-and-building-from-sources).
2 changes: 1 addition & 1 deletion docs/legacy/legacy-install-openrave.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This is Legacy documentation regarding OpenRAVE installations. Updated OpenRAVE

No official PPA, install from source. Install dependencies that must be installed for compilation:

- [Install CMake](install-cmake.md)
- [Install CMake](../install-cmake.md)

Note that you will be prompted for your password upon using `sudo`.

Expand Down

0 comments on commit bacfc4a

Please sign in to comment.