mirror of
https://github.com/mfontanini/libtins
synced 2026-01-23 02:35:57 +01:00
Added documentation generation through the build system.
This commit is contained in:
@@ -29,7 +29,7 @@ ENDIF(LIBTINS_BUILD_SHARED)
|
||||
# The version number.
|
||||
SET(LIBTINS_VERSION_MAJOR 3)
|
||||
SET(LIBTINS_VERSION_MINOR 1)
|
||||
SET(LIBTINS_CPP_VERSION "${LIBTINS_VERSION_MAJOR}.${LIBTINS_VERSION_MINOR}")
|
||||
SET(LIBTINS_VERSION "${LIBTINS_VERSION_MAJOR}.${LIBTINS_VERSION_MINOR}")
|
||||
|
||||
# Required Packages
|
||||
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
|
||||
@@ -81,6 +81,22 @@ IF(LIBTINS_ENABLE_DOT11)
|
||||
ENDIF(LIBTINS_ENABLE_WPA2)
|
||||
ENDIF(LIBTINS_ENABLE_DOT11)
|
||||
|
||||
# add a target to generate API documentation with Doxygen
|
||||
FIND_PACKAGE(Doxygen QUIET)
|
||||
IF(DOXYGEN_FOUND)
|
||||
CONFIGURE_FILE(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
|
||||
@ONLY
|
||||
)
|
||||
ADD_CUSTOM_TARGET(
|
||||
docs
|
||||
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Generating API documentation with Doxygen" VERBATIM
|
||||
)
|
||||
ENDIF(DOXYGEN_FOUND)
|
||||
|
||||
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
|
||||
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
|
||||
|
||||
|
||||
@@ -31,14 +31,14 @@ PROJECT_NAME = libtins
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 3.2
|
||||
PROJECT_NUMBER = @LIBTINS_VERSION@
|
||||
|
||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||
# base path where the generated documentation will be put.
|
||||
# If a relative path is entered, it will be relative to the location
|
||||
# where doxygen was started. If left blank the current directory will be used.
|
||||
|
||||
OUTPUT_DIRECTORY = ../docs/
|
||||
OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@/docs/
|
||||
|
||||
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
|
||||
# 4096 sub-directories (in 2 levels) under the output directory of each output
|
||||
@@ -581,7 +581,7 @@ WARN_LOGFILE =
|
||||
# directories like "/usr/src/myproject". Separate the files or directories
|
||||
# with spaces.
|
||||
|
||||
INPUT = include src
|
||||
INPUT = @CMAKE_CURRENT_SOURCE_DIR@/include @CMAKE_CURRENT_SOURCE_DIR@/src @CMAKE_CURRENT_SOURCE_DIR@/mainpage.dox
|
||||
|
||||
# This tag can be used to specify the character encoding of the source files
|
||||
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
|
||||
29
mainpage.dox
Normal file
29
mainpage.dox
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* \mainpage Documentation
|
||||
*
|
||||
* \section intro_sec Introduction
|
||||
*
|
||||
* <i>libtins</i> is a high-level, multiplatform <i>C++</i> network packet
|
||||
* sniffing and crafting library.
|
||||
*
|
||||
* Its main purpose is to provide the <i>C++</i> developer an easy, efficient,
|
||||
* platform and endianess-independent way to create tools which need to
|
||||
* send, receive and manipulate network packets.
|
||||
*
|
||||
* \section install_sec Installation
|
||||
*
|
||||
* Please visit the <a href="http://libtins.github.io/download/">downloads
|
||||
* section</a> in order to see the installation instructions.
|
||||
*
|
||||
* \section tutorials_sec Tutorials
|
||||
*
|
||||
* If you want to learn about how the library works, please visit the
|
||||
* <a href="http://libtins.github.io/tutorial/">tutorials</a> section.
|
||||
*
|
||||
* \section examples_sec Examples
|
||||
*
|
||||
* Make sure to visit the <a href="http://libtins.github.io/examples/">
|
||||
* examples</a> section to see some short but illustrative examples on how
|
||||
* to send and sniff packets using <i>libtins</i>.
|
||||
*
|
||||
*/
|
||||
@@ -62,7 +62,7 @@ ADD_LIBRARY(
|
||||
TARGET_LINK_LIBRARIES(tins ${PCAP_LIBRARY} ${OPENSSL_LIBRARIES} ${LIBTINS_OS_LIBS})
|
||||
|
||||
SET_TARGET_PROPERTIES(tins PROPERTIES OUTPUT_NAME tins )
|
||||
SET_TARGET_PROPERTIES(tins PROPERTIES VERSION ${LIBTINS_CPP_VERSION} SOVERSION ${LIBTINS_CPP_VERSION} )
|
||||
SET_TARGET_PROPERTIES(tins PROPERTIES VERSION ${LIBTINS_VERSION} SOVERSION ${LIBTINS_VERSION} )
|
||||
|
||||
# Install instructions for this target
|
||||
INSTALL(
|
||||
|
||||
Reference in New Issue
Block a user