CMake: handle doc/
This commit is contained in:
parent
df765e08b3
commit
87f390f288
|
@ -207,6 +207,11 @@ else() # Warn the user about missing dependencies
|
|||
endif()
|
||||
|
||||
|
||||
### Documentation ###
|
||||
|
||||
add_subdirectory(doc)
|
||||
|
||||
|
||||
### Meta-targets ###
|
||||
|
||||
# The OWLPS_SEMISTATIC_TARGET is defined in subdirectories
|
||||
|
|
|
@ -45,7 +45,8 @@ successfully), or re-run ``cmake``.
|
|||
Once you have all the required libraries installed, the easy way is to
|
||||
just call ``make`` to build all the modules. The built executables and
|
||||
libraries will be put in the ``bin`` and ``lib`` directories under the
|
||||
build directory's root.
|
||||
build directory's root; the manual pages will be generated in the
|
||||
``man`` directory.
|
||||
|
||||
You can then type ``make install`` to install everything (the default is
|
||||
to install to ``/usr/local``, so you will need to type this as root).
|
||||
|
|
5
TODO.t2t
5
TODO.t2t
|
@ -53,10 +53,11 @@ Work to do in OwlPS
|
|||
- Add option dump-configuration (displays the config & exits).
|
||||
|
||||
- CMake:
|
||||
- handle doc/ and logo/
|
||||
- handle logo/
|
||||
- use the installation prefix as search prefix for configuration files
|
||||
in Listener, Aggregator and Positioner
|
||||
- make sure doxygen is available
|
||||
- make sure doxygen is available (the FindDoxygen module exists)
|
||||
- make sure txt2tags is available
|
||||
|
||||
- Support string-based positioning requests
|
||||
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
# This file is part of the Owl Positioning System (OwlPS) project.
|
||||
# It is subject to the copyright notice and license terms in the
|
||||
# COPYRIGHT.t2t file found in the top-level directory of this
|
||||
# distribution and at
|
||||
# http://code.lm7.fr/p/owlps/source/tree/master/COPYRIGHT.t2t
|
||||
# No part of the OwlPS Project, including this file, may be copied,
|
||||
# modified, propagated, or distributed except according to the terms
|
||||
# contained in the COPYRIGHT.t2t file; the COPYRIGHT.t2t file must be
|
||||
# distributed along with this file, either separately or by replacing
|
||||
# this notice by the COPYRIGHT.t2t file's contents.
|
||||
|
||||
|
||||
### Man pages ###
|
||||
|
||||
set(MAN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/man")
|
||||
set(PREPROC_MAN ./preproc-man.sh)
|
||||
|
||||
add_custom_target(doc ALL true)
|
||||
|
||||
function(add_manpage PAGENAME SECTION)
|
||||
set(OUTPUT_DIRECTORY "${MAN_OUTPUT_DIRECTORY}/man${SECTION}")
|
||||
set(SOURCE ${PAGENAME}.t2t)
|
||||
set(TARGETNAME ${PAGENAME}.${SECTION})
|
||||
set(TARGET "${OUTPUT_DIRECTORY}/${TARGETNAME}")
|
||||
|
||||
# Create the output directory
|
||||
# Note: this is done only when first calling cmake and when rebuilding
|
||||
# cache; it would be nice if it could be called every time, but there
|
||||
# doesn't seem to be any simple solution.
|
||||
file(MAKE_DIRECTORY "${OUTPUT_DIRECTORY}")
|
||||
|
||||
# Command to generate the man page
|
||||
add_custom_command(
|
||||
OUTPUT "${TARGET}"
|
||||
COMMAND "${PREPROC_MAN}" "${SOURCE}" | txt2tags -q --infile=- --outfile="${TARGET}" -t man
|
||||
DEPENDS "${SOURCE}"
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
COMMENT "Generating ${TARGETNAME}")
|
||||
|
||||
# Set up the target
|
||||
add_custom_target(${TARGETNAME} true DEPENDS "${TARGET}")
|
||||
|
||||
# Add the target to the "doc" meta-target
|
||||
add_dependencies(doc "${TARGETNAME}")
|
||||
endfunction()
|
||||
|
||||
add_manpage(owlps 7)
|
||||
add_manpage(owlps-architecture 7)
|
||||
add_manpage(owlps-client 1)
|
16
doc/Makefile
16
doc/Makefile
|
@ -1,16 +0,0 @@
|
|||
all: \
|
||||
owlps.7 \
|
||||
owlps-architecture.7 \
|
||||
owlps-client.1
|
||||
|
||||
%.1: %.man
|
||||
mv $< $@
|
||||
|
||||
%.7: %.man
|
||||
mv $< $@
|
||||
|
||||
%.man: %.t2t
|
||||
./preproc-man.sh $< | txt2tags --infile=- --outfile=$@ -t man
|
||||
|
||||
clean:
|
||||
rm -f *~ *.html *.man *.7 *.1
|
Loading…
Reference in New Issue