From 7d46d153c629c9a96c154e9a09ed13d8f0f7474b Mon Sep 17 00:00:00 2001 From: Edward Hennis Date: Wed, 5 Oct 2016 17:39:23 -0400 Subject: [PATCH] Add CMake target for docs: * Includes docs/ files in VC and xcode projects. * Does NOT build automatically, so will not affect systems without the build toolchain. --- CMakeLists.txt | 39 +++++++++++++++++++++++++++++++++++++++ docs/makeqbk.sh | 2 +- 2 files changed, 40 insertions(+), 1 deletion(-) mode change 100644 => 100755 docs/makeqbk.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index e1e48ef1d9..e5c34fd353 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -322,6 +322,27 @@ if (WIN32 OR is_xcode OR NOT unity) # $,$>) endif() +if (WIN32 OR is_xcode) + # Documentation sources + prepend(doc_srcs + docs/ + Jamfile.v2 + boostbook.dtd + index.xml + main.qbk + quickref.xml + reference.xsl + source.dox) + + set_property( + SOURCE ${doc_srcs} + APPEND + PROPERTY HEADER_FILE_ONLY + true) + # Doesn't work + # $,$>) +endif() + ############################################################ add_with_props(rippled_src src/ripple/unity/soci.cpp @@ -401,10 +422,28 @@ endif() if (WIN32 OR is_xcode) group_sources(src) + group_sources(docs) endif() add_executable(rippled ${rippled_src} ${PROTO_HDRS}) +find_program( + B2_EXE + NAMES b2 + PATHS ENV BOOST_ROOT + DOC "Location of the b2 build executable from Boost") +if(${B2_EXE} STREQUAL "b2-NOTFOUND") + message(WARNING + "Boost b2 executable not found. docs target will not be buildable") +endif() +add_custom_target(docs + COMMAND "./makeqbk.sh" + COMMAND ${B2_EXE} + BYPRODUCTS "${CMAKE_SOURCE_DIR}/docs/html/index.html" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/docs" + SOURCES "${doc_srcs}" + ) + create_build_folder(rippled) set_startup_project(rippled) diff --git a/docs/makeqbk.sh b/docs/makeqbk.sh old mode 100644 new mode 100755 index d93deeb84a..c0c03794a7 --- a/docs/makeqbk.sh +++ b/docs/makeqbk.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/bin/bash # Copyright (c) 2013-2016 Vinnie Falco (vinnie dot falco at gmail dot com) #