Skip to content

Commit

Permalink
Switched from rst to markdown for protobuf documentor
Browse files Browse the repository at this point in the history
  • Loading branch information
mickem committed Jan 15, 2017
1 parent e097699 commit 2d6816f
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 36 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Expand Up @@ -28,3 +28,6 @@
[submodule "ext/miniz"]
path = ext/miniz
url = https://github.com/paulharris/miniz.git
[submodule "ext/md-protobuf"]
path = ext/md-protobuf
url = https://github.com/mickem/md-protobuf.git
8 changes: 4 additions & 4 deletions build/cmake/FindGoogleProtoBuf.cmake
Expand Up @@ -105,10 +105,10 @@ ELSE ()
FIND_PACKAGE_HANDLE_STANDARD_ARGS(protobuf DEFAULT_MSG PROTOBUF_INCLUDE_DIR PROTOBUF_LIBRARY PROTOBUF_PROTOC_EXECUTABLE)

set(PROTOBUF_PROTOC_VERSION "")
# if (PROTOBUF_PROTOC_EXECUTABLE)
# execute_process(COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} --version OUTPUT_VARIABLE TMP_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
# string(REGEX REPLACE "[a-z]+ ([0-9.]+)$" "\\1" PROTOBUF_PROTOC_VERSION ${TMP_VERSION})
# endif()
if (PROTOBUF_PROTOC_EXECUTABLE)
execute_process(COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} --version OUTPUT_VARIABLE TMP_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX REPLACE "[a-z]+ ([0-9.]+)$" "\\1" PROTOBUF_PROTOC_VERSION ${TMP_VERSION})
endif()

# ensure that they are cached
SET(PROTOBUF_INCLUDE_DIR ${PROTOBUF_INCLUDE_DIR} CACHE INTERNAL "The protocol buffers include path")
Expand Down
20 changes: 20 additions & 0 deletions build/cmake/FindProtocGenMd.cmake
@@ -0,0 +1,20 @@
IF (WIN32)
SET(EXE_NAME protoc-gen-md.cmd)
ELSE(WIN32)
SET(EXE_NAME protoc-gen-md)
ENDIF(WIN32)
FIND_PROGRAM(PROTOC_GEN_MD_BIN
NAMES
${EXE_NAME}
PATHS
${CMAKE_SOURCE_DIR}/ext/md-protobuf
${PROTOC_GEN_MD}
/usr/local/bin/
/usr/bin/
${PYTHON_ROOT}/Scripts
)
IF(PROTOC_GEN_MD_BIN)
SET(PROTOC_GEN_MD_FOUND TRUE)
ELSE()
SET(PROTOC_GEN_MD_FOUND FALSE)
ENDIF()
20 changes: 0 additions & 20 deletions build/cmake/FindProtocGenRst.cmake

This file was deleted.

12 changes: 6 additions & 6 deletions build/cmake/GoogleProtoBuf.cmake
Expand Up @@ -58,12 +58,12 @@ FOREACH(FIL ${ARGN})
LIST(APPEND ${VAR}_JSON_C "${PROJECT_BINARY_DIR}/libs/json_pb/${FIL_WE}.pb-json.cc")
LIST(APPEND ${VAR}_JSON_H "${PROJECT_BINARY_DIR}/libs/json_pb/${FIL_WE}.pb-json.h")
ENDIF(PROTOC_GEN_JSON_FOUND)
IF(PROTOC_GEN_RST_FOUND AND PROTOBUF_PROTOC_VERSION STREQUAL "2.6.1")
IF(PROTOC_GEN_RST_BIN)
SET(PROTOC_GEN_RST_EXTRA --plugin=protoc-gen-rst=${PROTOC_GEN_RST_BIN})
ENDIF(PROTOC_GEN_RST_BIN)
LIST(APPEND ARGS --rst_out ${BUILD_ROOT_FOLDER}/ext/docs/api ${PROTOC_GEN_RST_EXTRA})
LIST(APPEND ${VAR}_RST "${BUILD_ROOT_FOLDER}/ext/docs/api/${FIL_WE}.rst")
IF(PROTOC_GEN_MD_FOUND AND PROTOBUF_PROTOC_VERSION STREQUAL "2.6.1")
IF(PROTOC_GEN_MD_BIN)
SET(PROTOC_GEN_MD_EXTRA --plugin=protoc-gen-md=${PROTOC_GEN_MD_BIN})
ENDIF(PROTOC_GEN_MD_BIN)
LIST(APPEND ARGS --md_out ${BUILD_ROOT_FOLDER}/ext/docs/docs/api ${PROTOC_GEN_MD_EXTRA})
LIST(APPEND ${VAR}_MD "${BUILD_ROOT_FOLDER}/ext/docs/docs/api/${FIL_WE}.md")
ENDIF()

IF(WIN32)
Expand Down
12 changes: 6 additions & 6 deletions build/cmake/dependencies.cmake
Expand Up @@ -14,7 +14,7 @@ FIND_PACKAGE(CryptoPP)
FIND_PACKAGE(LUA)
FIND_PACKAGE(PROTOC_GEN_LUA)
FIND_PACKAGE(PROTOC_GEN_JSON)
FIND_PACKAGE(ProtocGenRst)
FIND_PACKAGE(ProtocGenMd)
FIND_PACKAGE(GoogleProtoBuf)
FIND_PACKAGE(GoogleTest)
FIND_PACKAGE(GoogleBreakpad)
Expand Down Expand Up @@ -89,11 +89,11 @@ IF(PROTOC_GEN_JSON_FOUND)
ELSE(PROTOC_GEN_JSON_FOUND)
MESSAGE(STATUS " ! json.protocol_buffers not found: PROTOC_GEN_JSON_BIN=${PROTOC_GEN_JSON_BIN}")
ENDIF(PROTOC_GEN_JSON_FOUND)
IF(PROTOC_GEN_RST_FOUND)
MESSAGE(STATUS " - rst.protocol_buffers found in: ${PROTOC_GEN_RST_BIN}")
ELSE(PROTOC_GEN_RST_FOUND)
MESSAGE(STATUS " ! rst.protocol_buffers not found: PROTOC_GEN_RST_BIN=${PROTOC_GEN_RST_BIN}")
ENDIF(PROTOC_GEN_RST_FOUND)
IF(PROTOC_GEN_MD_FOUND)
MESSAGE(STATUS " - md.protocol_buffers found in: ${PROTOC_GEN_MD_BIN}")
ELSE(PROTOC_GEN_MD_FOUND)
MESSAGE(STATUS " ! md.protocol_buffers not found: PROTOC_GEN_MD_BIN=${PROTOC_GEN_MD_BIN}")
ENDIF(PROTOC_GEN_MD_FOUND)
IF(PROTOBUF_FOUND)
MESSAGE(STATUS " - protocol buffers found in: ${PROTOBUF_INCLUDE_DIR} (${PROTOBUF_PROTOC_EXECUTABLE})")
ELSE(PROTOBUF_FOUND)
Expand Down
1 change: 1 addition & 0 deletions ext/md-protobuf
Submodule md-protobuf added at 53716a

0 comments on commit 2d6816f

Please sign in to comment.