File tree Expand file tree Collapse file tree 4 files changed +16
-4
lines changed
Expand file tree Collapse file tree 4 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 2222 run : |
2323 mkdir build
2424 cd build
25- cmake .. -DRAPIDJSON_BUILD_DOC =ON -DRAPIDJSON_BUILD_EXAMPLES=OFF -DRAPIDJSON_BUILD_TESTS=OFF
25+ cmake .. -DRAPIDJSON_BUILD_DOC_FOR_PUBLISH =ON -DRAPIDJSON_BUILD_EXAMPLES=OFF -DRAPIDJSON_BUILD_TESTS=OFF
2626 cmake --build .
2727 - name : Add changes & push to deploy
2828 run : |
Original file line number Diff line number Diff line change @@ -150,6 +150,10 @@ endif()
150150SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /bin)
151151
152152option (RAPIDJSON_BUILD_DOC "Build rapidjson documentation." ON )
153+ option (RAPIDJSON_BUILD_DOC_FOR_PUBLISH "Build rapidjson documentation and prepare the html directory for publication to gh-pages branch" OFF )
154+ if (RAPIDJSON_BUILD_DOC_FOR_PUBLISH)
155+ set (RAPIDJSON_BUILD_DOC ON )
156+ endif ()
153157option (RAPIDJSON_BUILD_EXAMPLES "Build rapidjson examples." ON )
154158option (RAPIDJSON_BUILD_TESTS "Build rapidjson perftests and unittests." ON )
155159option (RAPIDJSON_BUILD_THIRDPARTY_GTEST
Original file line number Diff line number Diff line change @@ -11,9 +11,17 @@ ELSE()
1111
1212 file (GLOB DOXYFILES ${CMAKE_CURRENT_BINARY_DIR} /Doxyfile* )
1313
14+ set (GIT_COMMANDS)
15+ if (RAPIDJSON_BUILD_DOC_FOR_PUBLISH)
16+ set (
17+ GIT_COMMANDS
18+ COMMAND git fetch origin gh-pages
19+ COMMAND git worktree add -f ${CMAKE_CURRENT_BINARY_DIR} /html gh-pages
20+ )
21+ endif ()
22+
1423 add_custom_command (OUTPUT html
15- COMMAND git fetch origin gh-pages
16- COMMAND git worktree add -f ${CMAKE_CURRENT_BINARY_DIR} /html gh-pages
24+ ${GIT_COMMANDS}
1725 COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR} /Doxyfile
1826 COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR} /html
1927 DEPENDS ${MARKDOWN_DOC} ${SOURCES} ${DOXYFILES}
Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ to the gh-pages branch as below.
137137```
138138mkdir build_docs
139139cd build_docs
140- cmake .. -DRAPIDJSON_BUILD_DOC =ON -DRAPIDJSON_BUILD_EXAMPLES=OFF -DRAPIDJSON_BUILD_TESTS=OFF
140+ cmake .. -DRAPIDJSON_BUILD_DOC_FOR_PUBLISH =ON -DRAPIDJSON_BUILD_EXAMPLES=OFF -DRAPIDJSON_BUILD_TESTS=OFF
141141cmake --build .
142142cd doc/html
143143git add -A
You can’t perform that action at this time.
0 commit comments