Skip to content

Commit de7d79e

Browse files
authored
Build docs (#49)
* 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.
1 parent 9d78249 commit de7d79e

19 files changed

+2218
-1
lines changed

.github/workflows/docs.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
paths:
6+
- 'doc/**'
7+
pull_request:
8+
paths:
9+
- 'doc/**'
10+
11+
jobs:
12+
docs:
13+
name: ubuntu-latest
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install dependencies
20+
run: |
21+
sudo apt update
22+
sudo apt install -y \
23+
cmake \
24+
imagemagick \
25+
texlive-latex-extra
26+
27+
- name: Build
28+
run: |
29+
cmake -S. -Bbuild -DBUILD_DOCS=ON -DBUILD_OPENGX=OFF
30+
cd build
31+
make
32+
33+
- name: Archive built documentation
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: opengx.pdf
37+
path: build/doc/src/opengx.pdf

CMakeLists.txt

+16
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
cmake_minimum_required(VERSION 3.13)
22
project(OpenGX VERSION 0.1)
33

4+
option(BUILD_OPENGX "Build the opengx library" ON)
5+
option(BUILD_DOCS "Build the documentation" OFF)
6+
47
set(CMAKE_C_STANDARD 11)
58
set(CMAKE_CXX_STANDARD 17)
69

10+
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" "${CMAKE_MODULE_PATH}")
11+
12+
# This is ON by default, of course, but we allow switching it off in case one
13+
# just needs to build the documentation
14+
if(BUILD_OPENGX)
15+
716
set(TARGET opengx)
817

918
include(GNUInstallDirs)
@@ -43,3 +52,10 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/opengl.pc
4352
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
4453
install(FILES OpenGLConfig.cmake
4554
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/OpenGL")
55+
56+
endif(BUILD_OPENGX)
57+
58+
if(BUILD_DOCS)
59+
include(UseLATEX)
60+
add_subdirectory(doc/src)
61+
endif()

0 commit comments

Comments
 (0)