Skip to content

Commit

Permalink
docs: Create config for doxygen
Browse files Browse the repository at this point in the history
  • Loading branch information
pktiuk committed Aug 31, 2021
1 parent 2a44b75 commit 7a98ab2
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 3 deletions.
19 changes: 16 additions & 3 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,32 +38,39 @@ In order to build this program, open a terminal and cd into the antimicrox
directory. Enter the following commands in order to:

Build the program:

```bash
cd antimicrox
mkdir build && cd build
cmake ..
cmake --build .
```

Run built binaries

```
./bin/antimicrox
```

A recommended way of installation is building package typical for for your system (or building universal one like an AppImage).

<details>
<summary>Installation using cmake (not recommended)</summary>

This way of installation is not recommended, because it doesn't integrate very well with some environments.


Install:

```bash
sudo cmake --install .
```

Uninstall:

```bash
sudo make uninstall
```

</details>

### Build Options for CMake
Expand All @@ -72,9 +79,12 @@ There are a few application specific options that can be used when running
cmake to build antimicrox. The following file will attempt to list some of those
options and describe their use in the project.


### Universal Options

-DBUILD_DOCS

Default: OFF. Build documentation using doxygen (installed doxygen and dot required). Generated files can be found in `docs` directory

-DUPDATE_TRANSLATIONS

Default: OFF. Set updateqm target to call lupdate in order to update
Expand Down Expand Up @@ -138,11 +148,13 @@ cmake --build . --target package
## Building AppImage

Create build directory

```bash
mkdir build && cd ./build
```

Download tools used for creating appimages (and make them executable)

```bash
wget https://github.com/linuxdeploy/linuxdeploy/releases/downloacontinuous/linuxdeploy-x86_64.AppImage
wget https://github.com/AppImage/AppImageKit/releases/downloacontinuous/appimagetool-x86_64.AppImage
Expand All @@ -153,14 +165,15 @@ chmod +x linuxdeploy-plugin-qt-x86_64.AppImage
```

Build antimicrox and install it in AppDir directory

```bash
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
make
make install DESTDIR=AppDir
```


Create AppImage file

```bash
./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin qt
./appimagetool-x86_64.AppImage AppDir/ --no-appstream
Expand Down
28 changes: 28 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ option(UPDATE_TRANSLATIONS "Call lupdate to update translation files from source
option(TRANS_KEEP_OBSOLETE "Add -noobsolete option to lupdate command to get rid of old text entries" OFF)
option(ATTACH_FAKE_CLASSES "Fake classes can be used in application to tests functionalities" OFF)
option(ANTIMICROX_PKG_VERSION "Manually define version of package displayed in info tab" OFF)
option(BUILD_DOCS "Build documentation" OFF)

if(ANTIMICROX_PKG_VERSION)
message("This build will be marked as: ${ANTIMICROX_PKG_VERSION}")
Expand Down Expand Up @@ -623,3 +624,30 @@ endif()

set(CPACK_PACKAGE_EXECUTABLES "antimicrox" "antimicrox")
include(CPack)


# Building docs using doxygen
if(BUILD_DOCS)
message("Docs build enabled")
find_package(Doxygen)

if (DOXYGEN_FOUND)
# set input and output files
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/other/Doxyfile_config.in)
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/docs/Doxyfile)

# request to configure the file
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
message("Doxygen build started")

# note the option ALL which allows to build the docs together with the application
add_custom_target( doc_doxygen ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM )

else (DOXYGEN_FOUND)
message("Doxygen need to be installed to generate the doxygen documentation")
endif (DOXYGEN_FOUND)
endif(BUILD_DOCS)
41 changes: 41 additions & 0 deletions other/Doxyfile_config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
PROJECT_NAME = "AntiMicroX"

OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@/docs/
INPUT = @CMAKE_CURRENT_SOURCE_DIR@/src/

QT_AUTOBRIEF = YES
OPTIMIZE_OUTPUT_FOR_C = YES
PROJECT_LOGO = @CMAKE_CURRENT_SOURCE_DIR@/src/icons/application/48x48/apps/48-apps-io.github.antimicrox.antimicrox.png

HAVE_DOT = YES
DOT_IMAGE_FORMAT = svg
INTERACTIVE_SVG = YES

EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES
EXTRACT_STATIC = YES

# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
# each documented class showing the direct and indirect inheritance relations.
# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.

CLASS_GRAPH = YES

COLLABORATION_GRAPH = YES

# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and
# collaboration diagrams in a style similar to the OMG's Unified Modeling
# Language.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.

UML_LOOK = NO


CALL_GRAPH = YES

CALLER_GRAPH = YES

GRAPHICAL_HIERARCHY = YES

0 comments on commit 7a98ab2

Please sign in to comment.