Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add make docs target

add docs target and update readme to refelct build requirements
  • Loading branch information...
commit 7fcf5aeb40ba221a4d8d02440cbb5e0096f547f9 1 parent 6471fc5
@poelzi authored
Showing with 88 additions and 2 deletions.
  1. +3 −0  .gitignore
  2. +0 −2  CMakeLists.txt
  3. +9 −0 README
  4. +76 −0 docs/CMakeLists.txt
View
3  .gitignore
@@ -15,6 +15,9 @@ GSYMS
GTAGS
tests/memleak
docs/api
+docs/html
+docs/txt
+docs/wiki
.nfs*
View
2  CMakeLists.txt
@@ -124,8 +124,6 @@ add_subdirectory(modules)
add_subdirectory(tests)
add_subdirectory(docs)
-add_custom_target(docs-api
- doxygen ${CMAKE_CURRENT_SOURCE_DIR}/docs/doxygen.conf)
#SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall")
#SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -pg -Wall")
View
9 README
@@ -38,6 +38,11 @@ Build Requirements:
liblua5.1-0-dev | libluajit-5.1-dev
liblua5.1-posix1 (sometimes called luaposix)
+Documentation:
+ doxygen
+ libmoose-perl
+ pandoc
+
Compiling:
# cmake .
@@ -47,6 +52,10 @@ Configure options (optional):
# ccmake .
+Building Documentation:
+
+ # make docs
+
Install:
# sudo make install
View
76 docs/CMakeLists.txt
@@ -0,0 +1,76 @@
+install(FILES ulatency.1
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/man/man1)
+install(FILES ulatencyd.8
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/man/man8)
+
+
+FILE(GLOB docfiles RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
+ "wiki/*.md")
+
+MESSAGE(STATUS "Process file: ${docfiles}")
+
+macro(CONVDOC SUFFIX TARGET_FORMAT TARGET_DIR)
+ ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_DIR}
+ COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_DIR}
+ )
+
+ #FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_DIR})
+ FOREACH(infileName ${docfiles})
+ #MESSAGE(STATUS "Process file: ${infileName}")
+
+ # Generate output file name
+ STRING(REPLACE ".md" "${SUFFIX}" outfileName "${infileName}")
+ STRING(REPLACE "wiki/" "" outfileName "${outfileName}")
+ SET(outfile "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_DIR}/${outfileName}")
+ #MESSAGE(STATUS "Output file: ${outfile}")
+
+ # Generate input file name
+ SET(infile "${CMAKE_CURRENT_SOURCE_DIR}/${infileName}")
+
+ # Custom command to do the processing
+ ADD_CUSTOM_COMMAND(OUTPUT "${outfile}"
+ COMMAND pandoc
+ "${infile}" -o "${outfile}" -t ${TARGET_FORMAT}
+ DEPENDS "${infile}" "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_DIR}" # depends on the 'processor'
+ COMMENT "convent ${infile} => ${outfile}")
+
+ # Finally remember the output file for dependencies
+ SET(${TARGET_DIR}Files ${${TARGET_DIR}Files} "${outfile}")
+ ENDFOREACH(infileName)
+endmacro(CONVDOC)
+
+CONVDOC(.html html html)
+CONVDOC("" plain txt)
+# Setup a target to drive the conversion
+ADD_CUSTOM_TARGET(docs-html ALL DEPENDS ${htmlFiles})
+ADD_CUSTOM_TARGET(docs-txt ALL DEPENDS ${txtFiles})
+
+
+ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/api
+ COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/api
+ )
+add_custom_target(docs-api
+ doxygen ${CMAKE_SOURCE_DIR}/docs/doxygen.conf
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/api)
+
+
+
+add_custom_target(docs)
+add_dependencies(docs docs-txt docs-html docs-api)
+
+
+# macro(CONVDOC GLOB SUFFIX TARGET_FORMAT)
+# file(GLOB DOCS RELATIVE wiki ${GLOB})
+# message(${DOCS})
+# file(MAKE_DIRECTORY ${TARGET_FORMAT})
+# foreach(cfile in DOCS)
+# message(string(REPLACE ".md" "${SUFFIX}"))
+# #set(ofile, string(REPLACE ".md" "${SUFFIX}"))
+# #execute_process(pandoc -o ${TARGET_FORMAT}/${ofile} -t {TARGET_FORMAT} -f markdown ${cfile})
+# endforeach(cfile in DOCS)
+# endmacro(CONVDOC)
+#
+#
+# add_custom_target(docs-html
+# COMMAND )
Please sign in to comment.
Something went wrong with that request. Please try again.