Skip to content

Commit

Permalink
Build docs (#49)
Browse files Browse the repository at this point in the history
* add CMake files for building the documentation
* dynamically generate PNG files from SGVs
* add workflow for building the documentation
* rename original opengx PDF file. This is to make it clear that it's from 2012.
  • Loading branch information
mardy authored Jun 24, 2024
1 parent 9d78249 commit de7d79e
Show file tree
Hide file tree
Showing 19 changed files with 2,218 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Documentation

on:
push:
paths:
- 'doc/**'
pull_request:
paths:
- 'doc/**'

jobs:
docs:
name: ubuntu-latest
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt update
sudo apt install -y \
cmake \
imagemagick \
texlive-latex-extra
- name: Build
run: |
cmake -S. -Bbuild -DBUILD_DOCS=ON -DBUILD_OPENGX=OFF
cd build
make
- name: Archive built documentation
uses: actions/upload-artifact@v4
with:
name: opengx.pdf
path: build/doc/src/opengx.pdf
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
cmake_minimum_required(VERSION 3.13)
project(OpenGX VERSION 0.1)

option(BUILD_OPENGX "Build the opengx library" ON)
option(BUILD_DOCS "Build the documentation" OFF)

set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" "${CMAKE_MODULE_PATH}")

# This is ON by default, of course, but we allow switching it off in case one
# just needs to build the documentation
if(BUILD_OPENGX)

set(TARGET opengx)

include(GNUInstallDirs)
Expand Down Expand Up @@ -43,3 +52,10 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/opengl.pc
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
install(FILES OpenGLConfig.cmake
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/OpenGL")

endif(BUILD_OPENGX)

if(BUILD_DOCS)
include(UseLATEX)
add_subdirectory(doc/src)
endif()
Loading

0 comments on commit de7d79e

Please sign in to comment.