Skip to content

Commit 975a019

Browse files
docs: add readthedocs build using doxygen
Co-Authored-By: Lukas Senionis <[email protected]>
1 parent f1cb666 commit 975a019

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+735
-405
lines changed

.codeql-prebuild-cpp-Linux.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ sudo rm -rf /var/lib/apt/lists/*
2121
# build
2222
mkdir -p build
2323
cd build || exit 1
24-
cmake -G Ninja ..
24+
cmake \
25+
-DBUILD_DOCS=OFF \
26+
-G Ninja ..
2527
ninja
2628

2729
# skip autobuild

.codeql-prebuild-cpp-Windows.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ pacman --noconfirm -S \
1616
# build
1717
mkdir -p build
1818
cd build || exit 1
19-
cmake -G Ninja ..
19+
cmake \
20+
-DBUILD_DOCS=OFF \
21+
-G Ninja ..
2022
ninja
2123

2224
# skip autobuild

.codeql-prebuild-cpp-macOS.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ brew install \
1111
# build
1212
mkdir -p build
1313
cd build || exit 1
14-
cmake -G Ninja ..
14+
cmake \
15+
-DBUILD_DOCS=OFF \
16+
-G Ninja ..
1517
ninja
1618

1719
# skip autobuild

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ jobs:
4242
sudo apt-get install -y \
4343
build-essential \
4444
cmake \
45+
doxygen \
46+
graphviz \
4547
ninja-build \
4648
nlohmann-json3-dev
4749
@@ -50,6 +52,8 @@ jobs:
5052
run: |
5153
brew install \
5254
cmake \
55+
doxygen \
56+
graphviz \
5357
ninja \
5458
boost \
5559
nlohmann-json
@@ -61,8 +65,10 @@ jobs:
6165
msystem: ucrt64
6266
update: true
6367
install: >-
68+
doxygen
6469
mingw-w64-ucrt-x86_64-binutils
6570
mingw-w64-ucrt-x86_64-cmake
71+
mingw-w64-ucrt-x86_64-graphviz
6672
mingw-w64-ucrt-x86_64-ninja
6773
mingw-w64-ucrt-x86_64-toolchain
6874
mingw-w64-ucrt-x86_64-boost

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[submodule "third-party/doxygen-awesome-css"]
2+
path = third-party/doxygen-awesome-css
3+
url = https://github.com/jothepro/doxygen-awesome-css.git
4+
branch = main
15
[submodule "third-party/googletest"]
26
path = third-party/googletest
37
url = https://github.com/google/googletest.git

.readthedocs.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
# .readthedocs.yaml
3+
# Read the Docs configuration file
4+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
5+
6+
# Required
7+
version: 2
8+
9+
# Set the version of Python
10+
build:
11+
os: ubuntu-24.04
12+
tools:
13+
python: "miniconda-latest"
14+
commands:
15+
# because we are overriding the build commands, we need to setup the environment ourselves
16+
- cat docs/environment.yml
17+
- conda env create --quiet --name $READTHEDOCS_VERSION --file docs/environment.yml
18+
- cmake -B build -S .
19+
- cmake --build build --target docs
20+
21+
# using conda, we can get newer doxygen and graphviz than ubuntu provide
22+
# https://github.com/readthedocs/readthedocs.org/issues/8151#issuecomment-890359661
23+
conda:
24+
environment: docs/environment.yml
25+
26+
submodules:
27+
include: all
28+
recursive: true

CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Project configuration
33
#
44
cmake_minimum_required(VERSION 3.24)
5-
project(libdisplaydevice
5+
project(libdisplaydevice VERSION 0.0.0
66
DESCRIPTION "Library to modify display devices."
77
HOMEPAGE_URL "https://app.lizardbyte.dev"
88
LANGUAGES CXX)
@@ -21,8 +21,16 @@ list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
2121
#
2222
# Project optional configuration
2323
#
24+
option(BUILD_DOCS "Build documentation" ON)
2425
option(BUILD_TESTS "Build tests" ON)
2526

27+
#
28+
# Documentation
29+
#
30+
if(BUILD_DOCS)
31+
add_subdirectory(docs)
32+
endif()
33+
2634
#
2735
# Testing only available if this is the main project
2836
#

README.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Overview
2+
3+
[![GitHub Workflow Status (CI)](https://img.shields.io/github/actions/workflow/status/lizardbyte/libdisplaydevice/ci.yml.svg?branch=master&label=CI%20build&logo=github&style=for-the-badge)](https://github.com/LizardByte/libdisplaydevice/actions/workflows/ci.yml?query=branch%3Amaster)
4+
[![Codecov](https://img.shields.io/codecov/c/gh/LizardByte/libdisplaydevice?token=goyvmDl6J5&style=for-the-badge&logo=codecov&label=codecov)](https://codecov.io/gh/LizardByte/libdisplaydevice)
5+
[![GitHub stars](https://img.shields.io/github/stars/lizardbyte/libdisplaydevice.svg?logo=github&style=for-the-badge)](https://github.com/LizardByte/libdisplaydevice)
6+
7+
## About
8+
9+
LizardByte has the full documentation hosted on [Read the Docs](https://libdisplaydevice.readthedocs.io/).
10+
11+
libdisplaydevice is a WIP library that provides a common interface for interacting with display devices.
12+
It is intended to be used by applications that need to interact with displays, such as screen capture software,
13+
remote desktop software, and video players.
14+
15+
Initial support is planned for Windows, but could be expanded to other platforms in the future.
16+
17+
## Build
18+
19+
### Clone
20+
21+
Ensure [git](https://git-scm.com/) is installed and run the following:
22+
23+
```bash
24+
git clone https://github.com/lizardbyte/libdisplaydevice.git --recurse-submodules
25+
cd libdisplaydevice
26+
mkdir build
27+
cd build
28+
```
29+
30+
### Windows
31+
32+
#### Requirements
33+
34+
First you need to install [MSYS2](https://www.msys2.org), then startup "MSYS2 UCRT64" and execute the following
35+
commands.
36+
37+
Update all packages:
38+
```bash
39+
pacman -Syu
40+
```
41+
42+
Install dependencies:
43+
```bash
44+
pacman -S \
45+
doxygen \
46+
mingw-w64-ucrt-x86_64-binutils \
47+
mingw-w64-ucrt-x86_64-cmake \
48+
mingw-w64-ucrt-x86_64-graphviz \
49+
mingw-w64-ucrt-x86_64-ninja \
50+
mingw-w64-ucrt-x86_64-toolchain \
51+
mingw-w64-ucrt-x86_64-boost \
52+
mingw-w64-ucrt-x86_64-nlohmann-json
53+
```
54+
55+
### Build
56+
57+
> [!WARNING]
58+
> Ensure you are in the build directory created during the clone step earlier before continuing.
59+
60+
```bash
61+
cmake -G Ninja ..
62+
ninja
63+
```
64+
65+
### Test
66+
67+
```bash
68+
tests\test_libdisplaydevice
69+
```
70+
71+
## Support
72+
73+
Our support methods are listed in our [LizardByte Docs](https://lizardbyte.readthedocs.io/en/latest/about/support.html).

README.rst

Lines changed: 0 additions & 84 deletions
This file was deleted.

docs/CMakeLists.txt

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# find doxygen and graphviz
2+
find_package(Doxygen
3+
REQUIRED dot)
4+
5+
# define variables based on whether we are building on readthedocs
6+
if(DEFINED ENV{READTHEDOCS})
7+
set(DOXYGEN_BUILD_DIR_CMAKE $ENV{READTHEDOCS_OUTPUT})
8+
set(DOXYGEN_PROJECT_VERSION $ENV{READTHEDOCS_VERSION})
9+
else()
10+
set(DOXYGEN_BUILD_DIR_CMAKE "${CMAKE_CURRENT_BINARY_DIR}/build")
11+
set(DOXYGEN_PROJECT_VERSION ${PROJECT_VERSION})
12+
endif()
13+
message(STATUS "DOXYGEN_BUILD_DIR_CMAKE: ${DOXYGEN_BUILD_DIR_CMAKE}")
14+
15+
# download icon and logo
16+
file(DOWNLOAD
17+
"https://raw.githubusercontent.com/LizardByte/.github/master/branding/logos/favicon.ico"
18+
"${DOXYGEN_BUILD_DIR_CMAKE}/lizardbyte.ico"
19+
)
20+
file(DOWNLOAD
21+
"https://raw.githubusercontent.com/LizardByte/.github/master/branding/logos/logo-128x128.png"
22+
"${DOXYGEN_BUILD_DIR_CMAKE}/lizardbyte.png"
23+
)
24+
25+
# create build directories, as doxygen fails to create it in some cases?
26+
file(MAKE_DIRECTORY "${DOXYGEN_BUILD_DIR_CMAKE}/html")
27+
28+
# convert to relative path, so doxygen doesn't get confused on Windows
29+
file(RELATIVE_PATH DOXYGEN_BUILD_DIR_RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${DOXYGEN_BUILD_DIR_CMAKE}")
30+
message(STATUS "DOXYGEN_BUILD_DIR_RELATIVE: ${DOXYGEN_BUILD_DIR_RELATIVE}")
31+
32+
# build docs
33+
add_custom_target(docs ALL
34+
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
35+
COMMENT "Building Doxygen documentation"
36+
COMMAND ${CMAKE_COMMAND} -E env
37+
LDD_DOXYGEN_BUILD_DIR=${DOXYGEN_BUILD_DIR_RELATIVE}
38+
LDD_PROJECT_VERSION=${DOXYGEN_PROJECT_VERSION}
39+
${DOXYGEN_EXECUTABLE} Doxyfile
40+
VERBATIM
41+
)

0 commit comments

Comments
 (0)