diff --git a/.github/workflows/documentation-workflow.yml b/.github/workflows/documentation-workflow.yml new file mode 100644 index 0000000..d2d6d94 --- /dev/null +++ b/.github/workflows/documentation-workflow.yml @@ -0,0 +1,42 @@ +name: Awesome Documentation Build + +on: + workflow_dispatch: # Allow manual triggers + push: + branches: [ master ] + +jobs: + ubuntu-build: + name: Ubuntu Build + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Create build directory and run CMake + run: | + sudo apt-get -y update + sudo apt-get -y install fdoxygen graphviz reeglut3-dev libgtk2.0-dev libgtkgl2.0-dev libboost-dev + mkdir cmake_download_dir + DOWNLOAD_FILE_COIN=coin-latest-Ubuntu2204-gcc11-x64.tar.gz + RELEASE_ID=`curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/coin3d/coin/releases | jq -r --arg COIN_REPO_TAG_NAME "CI-builds" '.[] | select(.tag_name==$COIN_REPO_TAG_NAME) | .id'` + ASSET_ID=`curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/coin3d/coin/releases/$RELEASE_ID | jq -r --arg DOWNLOAD_FILE_COIN "$DOWNLOAD_FILE_COIN" '.assets[] | select(.name==$DOWNLOAD_FILE_COIN) | .id'` + export DOWNLOAD_ADDRESS_COIN=https://api.github.com/repos/coin3d/coin/releases/assets/$ASSET_ID + echo download file $DOWNLOAD_FILE_COIN from address $DOWNLOAD_ADDRESS_COIN + curl -s -S -L -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/octet-stream" -o $DOWNLOAD_FILE_COIN $DOWNLOAD_ADDRESS_COIN + tar xzf $DOWNLOAD_FILE_COIN -C cmake_download_dir + curl -L -o doxygen-1.10.0.linux.bin.tar.gz https://github.com/doxygen/doxygen/releases/download/Release_1_10_0/doxygen-1.10.0.linux.bin.tar.gz + tar xzf doxygen-1.10.0.linux.bin.tar.gz + export PATH=${{ github.workspace }}/doxygen-1.10.0/bin:$PATH + cmake -S . -B cmake_build_dir -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake_install_dir -DCMAKE_PREFIX_PATH=cmake_download_dir/Coin3D -DSOGTK_BUILD_AWESOME_DOCUMENTATION=ON + - name: Build project + run: | + export PATH=${{ github.workspace }}/doxygen-1.10.0/bin:$PATH + doxygen --version + cmake --build cmake_build_dir --target documentation_awesome --config Release -- -j4 + - name: Deploy Awesome Documentation to Github Pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: cmake_build_dir/html_awesome diff --git a/CMakeLists.txt b/CMakeLists.txt index 48ad020..8080288 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,6 +97,7 @@ option(WITH_STATIC_DEFAULTS "Enable statically linked in default materials" ON) option(HAVE_SPACENAV_SUPPORT "Enable Space Navigator support" ON) option(SO${GUI}_USE_CPACK "If enabled the cpack subrepo is mandatory" OFF) option(SO${GUI}_BUILD_DOCUMENTATION "Build and install API documentation (requires Doxygen)." OFF) +option(SO${GUI}_BUILD_AWESOME_DOCUMENTATION "Build and install API documentation in new modern style (requires Doxygen)." OFF) option(SO${GUI}_BUILD_TESTS "Build small test programs." ON) option(SO${GUI}_SANITIZE_ADDRESS "Add sanitize address options." OFF) @@ -113,6 +114,7 @@ report_prepare( WITH_STATIC_DEFAULTS HAVE_SPACENAV_SUPPORT SO${GUI}_BUILD_DOCUMENTATION + SO${GUI}_BUILD_AWESOME_DOCUMENTATION SO${GUI}_BUILD_INTERNAL_DOCUMENTATION SO${GUI}_BUILD_DOC_MAN SO${GUI}_BUILD_DOC_QTHELP diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d421c1f..149a2a4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -223,6 +223,56 @@ if(SO${GUI}_BUILD_DOCUMENTATION) endif() endif() +# Add a target to generate new modern API documentation with Doxygen +if(SO${GUI}_BUILD_AWESOME_DOCUMENTATION) + find_package(Doxygen) + if(NOT DOXYGEN_FOUND) + message(FATAL_ERROR "Doxygen is needed to build the documentation.") + endif() + + if(NOT "${Coin_DOC_DIR}" STREQUAL "") + get_filename_component(_coin_versioned_dir ${Coin_DOC_DIR} NAME) + set(DOXYGEN_TAGFILES "${Coin_DOC_DIR}/html/Coin.tag=../../${_coin_versioned_dir}/html") + endif() + +# ############################################################################ +# Setup documentation options +# ############################################################################ + set(GENERATE_HTMLHELP NO) + set(DOXYGEN_GENERATE_MAN NO) + set(GENERATE_QHP NO) + set(GENERATE_TREEVIEW YES) + set(DOXYGEN_INTERNAL_DOCS NO) + set(DOXYGEN_EXTRACT_PRIVATE NO) + set(DOXYGEN_WARN_IF_UNDOCUMENTED YES) + set(DOXYGEN_EXCLUDE) + set(GITHUB_LINK "https://github.com/coin3d/so${gui}") + + set(DOXYFILE_AWESOME "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_awesome") + set(HTML_HEADER_AWESOME "${CMAKE_BINARY_DIR}/header_awesome.html") + set(DOXYGEN_OUTPUT_AWESOME "${CMAKE_BINARY_DIR}/html_awesome/index.html") + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Inventor/${Gui}/common/sogui.doxygen.awesome.cmake.in" ${DOXYFILE_AWESOME} @ONLY) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Inventor/${Gui}/common/docs/doxygen-awesome/doxygen-custom/header.html.cmake.in" ${HTML_HEADER_AWESOME} @ONLY) + +# ############################################################################ +# Setup documentation targets +# ############################################################################ + add_custom_command( + OUTPUT ${DOXYGEN_OUTPUT_AWESOME} + COMMAND ${CMAKE_COMMAND} -E echo_append "Generating modern API documentation with Doxygen " + COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE_AWESOME} + COMMAND ${CMAKE_COMMAND} -E echo "done." + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" + DEPENDS ${DOXYFILE_AWESOME} + ) + add_custom_target(documentation_awesome ALL DEPENDS ${DOXYGEN_OUTPUT_AWESOME}) + +# ############################################################################ +# Install built documentation files +# ############################################################################ + install(DIRECTORY "${CMAKE_BINARY_DIR}/html_awesome" DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT documentation REGEX ".*\\.(chm|qch)" EXCLUDE) +endif() + # ############################################################################ # Installation headers # ############################################################################ diff --git a/src/Inventor/Gtk/common b/src/Inventor/Gtk/common index 64e18cd..1fe77b0 160000 --- a/src/Inventor/Gtk/common +++ b/src/Inventor/Gtk/common @@ -1 +1 @@ -Subproject commit 64e18cd4b250d941a7a283ba4a789b1dbb9c99b5 +Subproject commit 1fe77b0f449a3160de42a7aa6d28f4a787f0d55e