summaryrefslogtreecommitdiffstats
path: root/libccnx-common/documentation/CMakeLists.txt
diff options
context:
space:
mode:
authorMichele Papalini <micpapal+fdio@cisco.com>2017-02-24 08:00:13 +0000
committerGerrit Code Review <gerrit@fd.io>2017-02-24 08:00:13 +0000
commit6d4b6878ceff22f9ec8d8e9423214f9666007472 (patch)
treefa27e0c747676519cb87ff8448bfed62fce5009d /libccnx-common/documentation/CMakeLists.txt
parentf28308bd99381ef5f1e178e2e1f870f245e35873 (diff)
parentd18ae43123fcd7604d1c36a1ec8450dbe6071824 (diff)
Merge "Initial commit: ccnxlibs." into ccnxlibs/master
Diffstat (limited to 'libccnx-common/documentation/CMakeLists.txt')
-rw-r--r--libccnx-common/documentation/CMakeLists.txt49
1 files changed, 49 insertions, 0 deletions
diff --git a/libccnx-common/documentation/CMakeLists.txt b/libccnx-common/documentation/CMakeLists.txt
new file mode 100644
index 00000000..9b934e03
--- /dev/null
+++ b/libccnx-common/documentation/CMakeLists.txt
@@ -0,0 +1,49 @@
+find_package(Doxygen)
+
+if(DOXYGEN_FOUND)
+ set(PARC_REMOTE http://githubenterprise.parc.com/CCNX/Libccnx-common)
+ set(GITHUB_REMOTE http://github.com/PARC/Libccnx-common)
+ configure_file(libccnx-stage1.doxygen.in config.doxygen @ONLY)
+ configure_file(libccnx-stage2.doxygen.in config2.doxygen @ONLY)
+
+ install(DIRECTORY images/ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/images)
+ install(DIRECTORY doxygen-extras/ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/doxygen-extras)
+ install(DIRECTORY examples/ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/examples)
+ install(FILES DoxygenLayout.xml DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+
+ set(HTML_PATH ${CMAKE_CURRENT_BINARY_DIR}/generated-documentation/html)
+
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/documentation.tar
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/config.doxygen
+ COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/config2.doxygen
+ COMMAND tar cf documentation.tar -C ${HTML_PATH} .
+ COMMENT "The file documentation.tar contains the HTML website suitable to update/replace the gh-pages branch of this repository." VERBATIM )
+
+ add_custom_target(documentation
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/documentation.tar
+ WORKING_DIRECTORY ${HTML_PATH})
+
+ add_custom_command(OUTPUT ${HTML_PATH}/.git/config
+ DEPENDS documentation
+ WORKING_DIRECTORY ${HTML_PATH}
+ COMMAND git init .
+ COMMAND git checkout -B gh-pages
+ COMMAND git add .
+ COMMAND git commit -am 'Override all previous versions'
+ COMMAND git remote add parc ${PARC_REMOTE}
+ COMMAND git remote add github ${GITHUB_REMOTE})
+
+ add_custom_target(documentation-install-parc
+ COMMENT "Push to ${PARC_REMOTE} gh-pages"
+ DEPENDS ${HTML_PATH}/.git/config
+ WORKING_DIRECTORY ${HTML_PATH}
+ COMMAND git push parc gh-pages -f)
+
+ add_custom_target(documentation-install-github
+ COMMENT "Push to ${GITHUB_REMOTE} gh-pages"
+ DEPENDS ${HTML_PATH}/.git/config
+ WORKING_DIRECTORY ${HTML_PATH}
+ COMMAND git push github gh-pages -f)
+
+endif(DOXYGEN_FOUND)