Skip to content
Snippets Groups Projects
Commit 53efe628 authored by Pascal Palenda's avatar Pascal Palenda
Browse files

Add doc for ihta_add_library

parent 1be31d66
Branches
No related tags found
No related merge requests found
...@@ -3,23 +3,106 @@ include_guard () ...@@ -3,23 +3,106 @@ include_guard ()
#[=======================================================================[.rst: #[=======================================================================[.rst:
..command:: ihta_add_library ..command:: ihta_add_library
Macro to generate doxygen documentation with custom logo and style sheet. Macro to create a library including most of the common settings/setups.
This macro also allows to create a unit test executable with the same command.
In most cases, after this command only link libraries have to be set and
optionally install directives.
Note: when using generated export headers from cmake, these have to be added
to the lib and test targets manually.
:: ::
build_doc( ihta_add_library(
SOURCES <documentation-folder...> NAME <library-name>
[README_MAINPAGE <readme-file-for-main-page>] SOURCES <library-source-files...>
[COLOR_STYLE <css-style-sheet>] [LIBRARY_TYPE <STATIC|SHARED>]
[LOGO <logo-file>] [NAMESPACE <target-alias-namespace>]
[ADD_DEV_SECTION] [IDE_FOLDER <folder-name-for-IDE>]
[SIDEBAR_ONLY] [INCLUDE_DIR <library-include-dir>]
[INSTALL_INCLUDE_DIR <library-install-include-dir>]
[OUT_VAR <output-library-target-name-variable>]
[TEST_SOURCES <test-source-files...>]
[TEST_INTERNALS]
[SRC_DIR <library-source-dir>]
[OBJECT_LIB_POSTFIX <object-lib-postfix>]
) )
.. variable:: SIDEBAR_ONLY .. variable:: NAME
Specifies, that the `doxygen-awesome-css` sidebar ony style should be used. Specifies, that the `doxygen-awesome-css` sidebar ony style should be used.
.. variable:: SOURCES
Source files for the library.
If you are using `target_sources` you can use `""` as the sources.
Todo: test this!
.. variable:: LIBRARY_TYPE
Optionally specify the library type. Either `STATIC` or `SHARED`.
If not specified, this macro behaves similarly to `add_library` in that it
assumes the type to be `STATIC` unless `BUILD_SHARED_LIBS` is turned on.
.. variable:: NAMESPACE
Optional namespace for the alias target of the library.
At least NAMESPACE or IDE_FOLDER must be given. If only one is given, the other
one will be set to the value of the given one.
.. variable:: IDE_FOLDER
Optional IDE folder for the library target(s).
At least NAMESPACE or IDE_FOLDER must be given. If only one is given, the other
one will be set to the value of the given one.
.. variable:: INCLUDE_DIR
Optionally specify the libraries include directory.
Default is `${CMAKE_CURRENT_SOURCE_DIR}/include`.
.. variable:: INSTALL_INCLUDE_DIR
Optionally specify the install include directory for the library.
If not specified, the install expects the same include folder structure as in the
libraries include folder.
.. variable:: OUT_VAR
Variable name into which the library target name will be set.
This can be useful when testing the internals and an object library is created,
onto which most further settings must be applied.
.. variable:: TEST_SOURCES
Sources files for the optional unit test executable.
.. variable:: TEST_INTERNALS
Specifies if the unit test should be able to test the internals of the library.
Under the hood, this then creates an object library for both the library and
the test to save on compilation time.
See `cmake_registertest <https://github.com/pthom/cmake_registertest>`_
.. variable:: SRC_DIR
Optionally specify the libraries source directory.
Default is `${CMAKE_CURRENT_SOURCE_DIR}/src`.
This should be given if TEST_INTERNALS is given and one wants to test the internals.
.. variable:: OBJECT_LIB_POSTFIX
Optionally specify a postfix for the object library if TEST_INTERNALS is specified.
The default is `_object`.
#]=======================================================================] #]=======================================================================]
macro (ihta_add_library) macro (ihta_add_library)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment