picrin/docs/CMakeLists.txt

27 lines
926 B
CMake
Raw Normal View History

# contribs
file(GLOB PICRIN_CONTRIB_DOCS ${PROJECT_SOURCE_DIR}/contrib/*/docs/*.rst)
file(GLOB PICRIN_DOCS ${PROJECT_SOURCE_DIR}/docs/*.rst)
list(SORT PICRIN_CONTRIB_DOCS)
set(PICRIN_CONTRIBS_DOC ${PROJECT_SOURCE_DIR}/docs/contrib.rst)
set(PICRIN_DOC_OUTPUT_DIRECTORY doc)
add_custom_command(
OUTPUT ${PICRIN_CONTRIBS_DOC}
2014-09-01 07:57:32 -04:00
COMMAND echo "Contrib Libraries \\\(a.k.a nitros\\\)" > ${PICRIN_CONTRIBS_DOC}
2014-11-11 23:46:00 -05:00
COMMAND echo "================================" >> ${PICRIN_CONTRIBS_DOC}
COMMAND echo "" >> ${PICRIN_CONTRIBS_DOC}
COMMAND cat ${PICRIN_CONTRIB_DOCS} >> ${PICRIN_CONTRIBS_DOC}
DEPENDS ${PICRIN_CONTRIB_DOCS}
)
add_custom_target(doc
COMMAND make -C ${PROJECT_SOURCE_DIR}/docs html
DEPENDS ${PICRIN_CONTRIBS_DOC}
)
add_custom_command(
TARGET doc POST_BUILD
COMMAND mkdir -p ${PICRIN_DOC_OUTPUT_DIRECTORY}
COMMAND cp -uR ${PROJECT_SOURCE_DIR}/docs/_build/* -t ${PICRIN_DOC_OUTPUT_DIRECTORY}/
)