From b446e4d14a0694d23573d77672ef6d70c51d6a08 Mon Sep 17 00:00:00 2001 From: Maximilien Siavelis <maximilien.siavelis@simulease.com> Date: 周五, 05 1月 2018 09:10:37 +0800 Subject: [PATCH] make install and some cleanup --- src/library/CMakeLists.txt | 4 .gitignore | 4 modules/target_arch.cmake | 0 src/library/os/win/CMakeLists.txt | 2 src/tools/base_lib/CMakeLists.txt | 2 CMakeLists.txt | 33 ------ src/library/base/CMakeLists.txt | 4 src/tools/license-generator/CMakeLists.txt | 4 test/library/CMakeLists.txt | 4 /dev/null | 187 ------------------------------------- test/functional/CMakeLists.txt | 1 test/license-generator/CMakeLists.txt | 2 src/library/os/linux/CMakeLists.txt | 2 modules/utilities.cmake | 0 14 files changed, 27 insertions(+), 222 deletions(-) diff --git a/.gitignore b/.gitignore index 1dc413f..f4c435e 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,7 @@ *.a /Makefile /Testing + +# Cmake generated files +build + diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c69513..cc755ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,4 @@ #TODO guess address_model 64 in boost -#make it compatible with find_boost (exchange lowercase to camelcase) #fix shared libraries activation #cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR) @@ -19,7 +18,7 @@ project (license++ C CXX) SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) -SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/build/modules/") +SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/modules/") include(utilities) if(CMAKE_BUILD_TYPE) @@ -101,35 +100,6 @@ list(APPEND EXTERNAL_LIBS dl) endif(NOT MSVC) -FIND_PACKAGE(Doxygen) - -IF (DOXYGEN_FOUND) - - SET(DOXYGEN_INPUT ${CMAKE_BINARY_DIR}/doc/Doxyfile) - SET(DOXYGEN_OUTPUT ${CMAKE_BINARY_DIR}/doc/doxy_output) - - configure_file ( - "doc/Doxyfile.in" - "doc/Doxyfile" - ) - - ADD_CUSTOM_COMMAND( - OUTPUT ${DOXYGEN_OUTPUT} - COMMAND ${CMAKE_COMMAND} -E echo_append "Building API Documentation..." - COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_INPUT} - COMMAND ${CMAKE_COMMAND} -E echo "Done." - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - DEPENDS ${DOXYGEN_INPUT}) - - ADD_CUSTOM_TARGET(apidoc ALL DEPENDS ${DOXYGEN_OUTPUT}) - - ADD_CUSTOM_TARGET(apidoc_forced - COMMAND ${CMAKE_COMMAND} -E echo_append "Building API Documentation..." - COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_INPUT} - COMMAND ${CMAKE_COMMAND} -E echo "Done." - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) -ENDIF (DOXYGEN_FOUND) - configure_file ( "src/build_properties.h.in" "${CMAKE_BINARY_DIR}/build_properties.h" @@ -147,7 +117,6 @@ ENDIF(BUILD_TESTING) add_subdirectory(test) -#include(build/modules/CmakeDebugVariables.txt) message( STATUS "C compiler: " ${CMAKE_C_COMPILER}) message( STATUS "C compiler flags: " ${CMAKE_C_FLAGS}) message( STATUS "CXX compiler: " ${CMAKE_CXX_COMPILER}) diff --git a/build/linux/.gitignore b/build/linux/.gitignore deleted file mode 100644 index 22e8364..0000000 --- a/build/linux/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/* \ No newline at end of file diff --git a/build/modules/CmakeDebugVariables.txt b/build/modules/CmakeDebugVariables.txt deleted file mode 100644 index f1b8012..0000000 --- a/build/modules/CmakeDebugVariables.txt +++ /dev/null @@ -1,152 +0,0 @@ -# ------------------------- Begin Generic CMake Variable Logging ------------------ - -# /* C++ comment style not allowed */ - - -# if you are building in-source, this is the same as CMAKE_SOURCE_DIR, otherwise -# this is the top level directory of your build tree -MESSAGE( STATUS "CMAKE_BINARY_DIR: " ${CMAKE_BINARY_DIR} ) - -# if you are building in-source, this is the same as CMAKE_CURRENT_SOURCE_DIR, otherwise this -# is the directory where the compiled or generated files from the current CMakeLists.txt will go to -MESSAGE( STATUS "CMAKE_CURRENT_BINARY_DIR: " ${CMAKE_CURRENT_BINARY_DIR} ) - -# this is the directory, from which cmake was started, i.e. the top level source directory -MESSAGE( STATUS "CMAKE_SOURCE_DIR: " ${CMAKE_SOURCE_DIR} ) - -# this is the directory where the currently processed CMakeLists.txt is located in -MESSAGE( STATUS "CMAKE_CURRENT_SOURCE_DIR: " ${CMAKE_CURRENT_SOURCE_DIR} ) - -# contains the full path to the top level directory of your build tree -MESSAGE( STATUS "PROJECT_BINARY_DIR: " ${PROJECT_BINARY_DIR} ) - -# contains the full path to the root of your project source directory, -# i.e. to the nearest directory where CMakeLists.txt contains the PROJECT() command -MESSAGE( STATUS "PROJECT_SOURCE_DIR: " ${PROJECT_SOURCE_DIR} ) - -# set this variable to specify a common place where CMake should put all executable files -# (instead of CMAKE_CURRENT_BINARY_DIR) -MESSAGE( STATUS "EXECUTABLE_OUTPUT_PATH: " ${EXECUTABLE_OUTPUT_PATH} ) - -# set this variable to specify a common place where CMake should put all libraries -# (instead of CMAKE_CURRENT_BINARY_DIR) -MESSAGE( STATUS "LIBRARY_OUTPUT_PATH: " ${LIBRARY_OUTPUT_PATH} ) - -# tell CMake to search first in directories listed in CMAKE_MODULE_PATH -# when you use FIND_PACKAGE() or INCLUDE() -MESSAGE( STATUS "CMAKE_MODULE_PATH: " ${CMAKE_MODULE_PATH} ) - -# this is the complete path of the cmake which runs currently (e.g. /usr/local/bin/cmake) -MESSAGE( STATUS "CMAKE_COMMAND: " ${CMAKE_COMMAND} ) - -# this is the CMake installation directory -MESSAGE( STATUS "CMAKE_ROOT: " ${CMAKE_ROOT} ) - -# this is the filename including the complete path of the file where this variable is used. -MESSAGE( STATUS "CMAKE_CURRENT_LIST_FILE: " ${CMAKE_CURRENT_LIST_FILE} ) - -# this is linenumber where the variable is used -MESSAGE( STATUS "CMAKE_CURRENT_LIST_LINE: " ${CMAKE_CURRENT_LIST_LINE} ) - -# this is used when searching for include files e.g. using the FIND_PATH() command. -MESSAGE( STATUS "CMAKE_INCLUDE_PATH: " ${CMAKE_INCLUDE_PATH} ) - -# this is used when searching for libraries e.g. using the FIND_LIBRARY() command. -MESSAGE( STATUS "CMAKE_LIBRARY_PATH: " ${CMAKE_LIBRARY_PATH} ) - -# the complete system name, e.g. "Linux-2.4.22", "FreeBSD-5.4-RELEASE" or "Windows 5.1" -MESSAGE( STATUS "CMAKE_SYSTEM: " ${CMAKE_SYSTEM} ) - -# the short system name, e.g. "Linux", "FreeBSD" or "Windows" -MESSAGE( STATUS "CMAKE_SYSTEM_NAME: " ${CMAKE_SYSTEM_NAME} ) - -# only the version part of CMAKE_SYSTEM -MESSAGE( STATUS "CMAKE_SYSTEM_VERSION: " ${CMAKE_SYSTEM_VERSION} ) - -# the processor name (e.g. "Intel(R) Pentium(R) M processor 2.00GHz") -MESSAGE( STATUS "CMAKE_SYSTEM_PROCESSOR: " ${CMAKE_SYSTEM_PROCESSOR} ) - -# is TRUE on all UNIX-like OS's, including Apple OS X and CygWin -MESSAGE( STATUS "UNIX: " ${UNIX} ) - -# is TRUE on Windows, including CygWin -MESSAGE( STATUS "WIN32: " ${WIN32} ) - -# is TRUE on Apple OS X -MESSAGE( STATUS "APPLE: " ${APPLE} ) - -# is TRUE when using the MinGW compiler in Windows -MESSAGE( STATUS "MINGW: " ${MINGW} ) - -# is TRUE on Windows when using the CygWin version of cmake -MESSAGE( STATUS "CYGWIN: " ${CYGWIN} ) - -# is TRUE on Windows when using a Borland compiler -MESSAGE( STATUS "BORLAND: " ${BORLAND} ) - -# Microsoft compiler -MESSAGE( STATUS "MSVC: " ${MSVC} ) -MESSAGE( STATUS "MSVC_IDE: " ${MSVC_IDE} ) -MESSAGE( STATUS "MSVC60: " ${MSVC60} ) -MESSAGE( STATUS "MSVC70: " ${MSVC70} ) -MESSAGE( STATUS "MSVC71: " ${MSVC71} ) -MESSAGE( STATUS "MSVC80: " ${MSVC80} ) -MESSAGE( STATUS "CMAKE_COMPILER_2005: " ${CMAKE_COMPILER_2005} ) - - -# set this to true if you don't want to rebuild the object files if the rules have changed, -# but not the actual source files or headers (e.g. if you changed the some compiler switches) -MESSAGE( STATUS "CMAKE_SKIP_RULE_DEPENDENCY: " ${CMAKE_SKIP_RULE_DEPENDENCY} ) - -# since CMake 2.1 the install rule depends on all, i.e. everything will be built before installing. -# If you don't like this, set this one to true. -MESSAGE( STATUS "CMAKE_SKIP_INSTALL_ALL_DEPENDENCY: " ${CMAKE_SKIP_INSTALL_ALL_DEPENDENCY} ) - -# If set, runtime paths are not added when using shared libraries. Default it is set to OFF -MESSAGE( STATUS "CMAKE_SKIP_RPATH: " ${CMAKE_SKIP_RPATH} ) - -# set this to true if you are using makefiles and want to see the full compile and link -# commands instead of only the shortened ones -MESSAGE( STATUS "CMAKE_VERBOSE_MAKEFILE: " ${CMAKE_VERBOSE_MAKEFILE} ) - -# this will cause CMake to not put in the rules that re-run CMake. This might be useful if -# you want to use the generated build files on another machine. -MESSAGE( STATUS "CMAKE_SUPPRESS_REGENERATION: " ${CMAKE_SUPPRESS_REGENERATION} ) - - -# A simple way to get switches to the compiler is to use ADD_DEFINITIONS(). -# But there are also two variables exactly for this purpose: - -# the compiler flags for compiling C sources -MESSAGE( STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS} ) - -# the compiler flags for compiling C++ sources -MESSAGE( STATUS "CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} ) - - -# Choose the type of build. Example: SET(CMAKE_BUILD_TYPE Debug) -MESSAGE( STATUS "CMAKE_BUILD_TYPE: " ${CMAKE_BUILD_TYPE} ) - -# if this is set to ON, then all libraries are built as shared libraries by default. -MESSAGE( STATUS "BUILD_SHARED_LIBS: " ${BUILD_SHARED_LIBS} ) - -# the compiler used for C files -MESSAGE( STATUS "CMAKE_C_COMPILER: " ${CMAKE_C_COMPILER} ) - -# the compiler used for C++ files -MESSAGE( STATUS "CMAKE_CXX_COMPILER: " ${CMAKE_CXX_COMPILER} ) - -# if the compiler is a variant of gcc, this should be set to 1 -MESSAGE( STATUS "CMAKE_COMPILER_IS_GNUCC: " ${CMAKE_COMPILER_IS_GNUCC} ) - -# if the compiler is a variant of g++, this should be set to 1 -MESSAGE( STATUS "CMAKE_COMPILER_IS_GNUCXX : " ${CMAKE_COMPILER_IS_GNUCXX} ) - -# the tools for creating libraries -MESSAGE( STATUS "CMAKE_AR: " ${CMAKE_AR} ) -MESSAGE( STATUS "CMAKE_RANLIB: " ${CMAKE_RANLIB} ) - -# -#MESSAGE( STATUS ": " ${} ) - -# ------------------------- End of Generic CMake Variable Logging ------------------ \ No newline at end of file diff --git a/build/modules/FindCryptoPP.cmake b/build/modules/FindCryptoPP.cmake deleted file mode 100644 index 2d0216d..0000000 --- a/build/modules/FindCryptoPP.cmake +++ /dev/null @@ -1,109 +0,0 @@ -# Module for locating the Crypto++ encryption library. -# -# Customizable variables: -# CRYPTOPP_ROOT_DIR -# This variable points to the CryptoPP root directory. On Windows the -# library location typically will have to be provided explicitly using the -# -D command-line option. The directory should include the include/cryptopp, -# lib and/or bin sub-directories. -# -# Read-only variables: -# CRYPTOPP_FOUND -# Indicates whether the library has been found. -# -# CRYPTOPP_INCLUDE_DIRS -# Points to the CryptoPP include directory. -# -# CRYPTOPP_LIBRARIES -# Points to the CryptoPP libraries that should be passed to -# target_link_libararies. -# -# -# Copyright (c) 2012 Sergiu Dotenco -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -INCLUDE (FindPackageHandleStandardArgs) - -FIND_PATH (CRYPTOPP_ROOT_DIR - NAMES cryptopp/cryptlib.h include/cryptopp/cryptlib.h - PATHS ENV CRYPTOPPROOT - DOC "CryptoPP root directory") - -# Re-use the previous path: -FIND_PATH (CRYPTOPP_INCLUDE_DIR - NAMES cryptopp/cryptlib.h - HINTS ${CRYPTOPP_ROOT_DIR} - PATH_SUFFIXES include - DOC "CryptoPP include directory") - -FIND_LIBRARY (CRYPTOPP_LIBRARY_DEBUG - NAMES cryptlibd cryptoppd - HINTS ${CRYPTOPP_ROOT_DIR} - PATH_SUFFIXES lib - DOC "CryptoPP debug library") - -FIND_LIBRARY (CRYPTOPP_LIBRARY_RELEASE - NAMES cryptlib cryptopp - HINTS ${CRYPTOPP_ROOT_DIR} - PATH_SUFFIXES lib - DOC "CryptoPP release library") - -IF (CRYPTOPP_LIBRARY_DEBUG AND CRYPTOPP_LIBRARY_RELEASE) - SET (CRYPTOPP_LIBRARY - optimized ${CRYPTOPP_LIBRARY_RELEASE} - debug ${CRYPTOPP_LIBRARY_DEBUG} CACHE DOC "CryptoPP library") -ELSEIF (CRYPTOPP_LIBRARY_RELEASE) - SET (CRYPTOPP_LIBRARY ${CRYPTOPP_LIBRARY_RELEASE} CACHE DOC - "CryptoPP library") -ENDIF (CRYPTOPP_LIBRARY_DEBUG AND CRYPTOPP_LIBRARY_RELEASE) - -IF (CRYPTOPP_INCLUDE_DIR) - SET (_CRYPTOPP_VERSION_HEADER ${CRYPTOPP_INCLUDE_DIR}/cryptopp/config.h) - - IF (EXISTS ${_CRYPTOPP_VERSION_HEADER}) - FILE (STRINGS ${_CRYPTOPP_VERSION_HEADER} _CRYPTOPP_VERSION_TMP REGEX - "^#define CRYPTOPP_VERSION[ \t]+[0-9]+$") - - STRING (REGEX REPLACE - "^#define CRYPTOPP_VERSION[ \t]+([0-9]+)" "\\1" _CRYPTOPP_VERSION_TMP - ${_CRYPTOPP_VERSION_TMP}) - - STRING (REGEX REPLACE "([0-9]+)[0-9][0-9]" "\\1" CRYPTOPP_VERSION_MAJOR - ${_CRYPTOPP_VERSION_TMP}) - STRING (REGEX REPLACE "[0-9]([0-9])[0-9]" "\\1" CRYPTOPP_VERSION_MINOR - ${_CRYPTOPP_VERSION_TMP}) - STRING (REGEX REPLACE "[0-9][0-9]([0-9])" "\\1" CRYPTOPP_VERSION_PATCH - ${_CRYPTOPP_VERSION_TMP}) - - SET (CRYPTOPP_VERSION_COUNT 3) - SET (CRYPTOPP_VERSION - ${CRYPTOPP_VERSION_MAJOR}.${CRYPTOPP_VERSION_MINOR}.${CRYPTOPP_VERSION_PATCH}) - ENDIF (EXISTS ${_CRYPTOPP_VERSION_HEADER}) -ENDIF (CRYPTOPP_INCLUDE_DIR) - -SET (CRYPTOPP_INCLUDE_DIRS ${CRYPTOPP_INCLUDE_DIR}) -SET (CRYPTOPP_LIBRARIES ${CRYPTOPP_LIBRARY}) - -MARK_AS_ADVANCED (CRYPTOPP_INCLUDE_DIR CRYPTOPP_LIBRARY CRYPTOPP_LIBRARY_DEBUG - CRYPTOPP_LIBRARY_RELEASE) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS (CryptoPP REQUIRED_VARS CRYPTOPP_ROOT_DIR - CRYPTOPP_INCLUDE_DIR CRYPTOPP_LIBRARY VERSION_VAR CRYPTOPP_VERSION) - \ No newline at end of file diff --git a/build/modules/FindDbus.cmake b/build/modules/FindDbus.cmake deleted file mode 100644 index 5b5bcde..0000000 --- a/build/modules/FindDbus.cmake +++ /dev/null @@ -1,72 +0,0 @@ -# - Try to find the low-level D-Bus library -# Once done this will define -# -# DBUS_FOUND - system has D-Bus -# DBUS_INCLUDE_DIR - the D-Bus include directory -# DBUS_ARCH_INCLUDE_DIR - the D-Bus architecture-specific include directory -# DBUS_LIBRARIES - the libraries needed to use D-Bus - -# Copyright (c) 2008, Kevin Kofler, <kevin.kofler@chello.at> -# modeled after FindLibArt.cmake: -# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org> -# -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. - -if (DBUS_INCLUDE_DIR AND DBUS_ARCH_INCLUDE_DIR AND DBUS_LIBRARIES) - - # in cache already - SET(DBUS_FOUND TRUE) - -else (DBUS_INCLUDE_DIR AND DBUS_ARCH_INCLUDE_DIR AND DBUS_LIBRARIES) - - IF (NOT WIN32) - FIND_PACKAGE(PkgConfig) - IF (PKG_CONFIG_FOUND) - # use pkg-config to get the directories and then use these values - # in the FIND_PATH() and FIND_LIBRARY() calls - pkg_check_modules(_DBUS_PC QUIET dbus-1) - ENDIF (PKG_CONFIG_FOUND) - ENDIF (NOT WIN32) - - FIND_PATH(DBUS_INCLUDE_DIR dbus/dbus.h - ${_DBUS_PC_INCLUDE_DIRS} - /usr/include - /usr/include/dbus-1.0 - /usr/local/include - ) - - FIND_PATH(DBUS_ARCH_INCLUDE_DIR dbus/dbus-arch-deps.h - ${_DBUS_PC_INCLUDE_DIRS} - /usr/lib${LIB_SUFFIX}/include - /usr/lib${LIB_SUFFIX}/dbus-1.0/include - /usr/lib64/include - /usr/lib64/dbus-1.0/include - /usr/lib/include - /usr/lib/dbus-1.0/include - ) - - FIND_LIBRARY(DBUS_LIBRARIES NAMES dbus-1 dbus - PATHS - ${_DBUS_PC_LIBDIR} - ) - - - if (DBUS_INCLUDE_DIR AND DBUS_ARCH_INCLUDE_DIR AND DBUS_LIBRARIES) - set(DBUS_FOUND TRUE) - endif (DBUS_INCLUDE_DIR AND DBUS_ARCH_INCLUDE_DIR AND DBUS_LIBRARIES) - - - if (DBUS_FOUND) - if (NOT DBus_FIND_QUIETLY) - message(STATUS "Found D-Bus: ${DBUS_LIBRARIES}") - endif (NOT DBus_FIND_QUIETLY) - else (DBUS_FOUND) - if (DBus_FIND_REQUIRED) - message(FATAL_ERROR "Could NOT find D-Bus") - endif (DBus_FIND_REQUIRED) - endif (DBUS_FOUND) - - MARK_AS_ADVANCED(DBUS_INCLUDE_DIR DBUS_ARCH_INCLUDE_DIR DBUS_LIBRARIES) - -endif (DBUS_INCLUDE_DIR AND DBUS_ARCH_INCLUDE_DIR AND DBUS_LIBRARIES) \ No newline at end of file diff --git a/build/win/README.txt b/build/win/README.txt deleted file mode 100644 index e69de29..0000000 --- a/build/win/README.txt +++ /dev/null diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in deleted file mode 100644 index 96db8ee..0000000 --- a/doc/Doxyfile.in +++ /dev/null @@ -1,1904 +0,0 @@ -# Doxyfile 1.8.4 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a double hash (##) is considered a comment and is placed -# in front of the TAG it is preceding . -# All text after a hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" "). - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or sequence of words) that should -# identify the project. Note that if you do not use Doxywizard you need -# to put quotes around the project name if it contains spaces. - -PROJECT_NAME = license++ - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = ${LICENSE_MAN_VERSION} - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer -# a quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = - -# With the PROJECT_LOGO tag one can specify an logo or icon that is -# included in the documentation. The maximum height of the logo should not -# exceed 55 pixels and the maximum width should not exceed 200 pixels. -# Doxygen will copy the logo to the output directory. - -PROJECT_LOGO = - -# 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 = ${DOXYGEN_OUTPUT} - -# 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 -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Latvian, Lithuanian, Norwegian, Macedonian, -# Persian, Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, -# Slovak, Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = YES - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = NO - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. Note that you specify absolute paths here, but also -# relative paths, which will be relative from the directory where doxygen is -# started. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful if your file system -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = YES - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding -# "class=itcl::class" will allow you to use the command class in the -# itcl::class meaning. - -TCL_SUBST = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given -# extension. Doxygen has a built-in mapping, but you can override or extend it -# using this tag. The format is ext=language, where ext is a file extension, -# and language is one of the parsers supported by doxygen: IDL, Java, -# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, -# C++. For instance to make doxygen treat .inc files as Fortran files (default -# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note -# that for custom extensions you also need to set FILE_PATTERNS otherwise the -# files are not read by doxygen. - -EXTENSION_MAPPING = - -# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all -# comments according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you -# can mix doxygen, HTML, and XML commands with Markdown formatting. -# Disable only in case of backward compatibilities issues. - -MARKDOWN_SUPPORT = YES - -# When enabled doxygen tries to link words that correspond to documented -# classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by by putting a % sign in front of the word -# or globally by setting AUTOLINK_SUPPORT to NO. - -AUTOLINK_SUPPORT = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also makes the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate -# getter and setter methods for a property. Setting this option to YES (the -# default) will make doxygen replace the get and set methods by a property in -# the documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and -# unions are shown inside the group in which they are included (e.g. using -# @ingroup) instead of on a separate page (for HTML and Man pages) or -# section (for LaTeX and RTF). - -INLINE_GROUPED_CLASSES = NO - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and -# unions with only public data fields or simple typedef fields will be shown -# inline in the documentation of the scope in which they are defined (i.e. file, -# namespace, or group documentation), provided this scope is documented. If set -# to NO (the default), structs, classes, and unions are shown on a separate -# page (for HTML and Man pages) or section (for LaTeX and RTF). - -INLINE_SIMPLE_STRUCTS = NO - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = NO - -# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This -# cache is used to resolve symbols given their name and scope. Since this can -# be an expensive process and often the same symbol appear multiple times in -# the code, doxygen keeps a cache of pre-resolved symbols. If the cache is too -# small doxygen will become slower. If the cache is too large, memory is wasted. -# The cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid -# range is 0..9, the default is 0, corresponding to a cache size of 2^16 = 65536 -# symbols. - -LOOKUP_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal -# scope will be included in the documentation. - -EXTRACT_PACKAGE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = NO - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespaces are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = YES - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen -# will list include files with double quotes in the documentation -# rather than with sharp brackets. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = NO - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen -# will sort the (brief and detailed) documentation of class members so that -# constructors and destructors are listed first. If set to NO (the default) -# the constructors will appear in the respective orders defined by -# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. -# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO -# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to -# do proper type resolution of all parameters of a function it will reject a -# match between the prototype and the implementation of a member function even -# if there is only one candidate or it is obvious which candidate to choose -# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen -# will still accept a match between prototype and implementation in such cases. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = NO - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = NO - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if section-label ... \endif -# and \cond section-label ... \endcond blocks. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or macro consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and macros in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. -# This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command <command> <input-file>, where <command> is the value of -# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. To create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. -# You can optionally specify a file name after the option, if omitted -# DoxygenLayout.xml will be used as the name of the layout file. - -LAYOUT_FILE = - -# The CITE_BIB_FILES tag can be used to specify one or more bib files -# containing the references data. This must be a list of .bib files. The -# .bib extension is automatically appended if omitted. Using this command -# requires the bibtex tool to be installed. See also -# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style -# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this -# feature you need bibtex and perl available in the search path. Do not use -# file names with spaces, bibtex cannot handle them. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = YES - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# The WARN_NO_PARAMDOC option can be enabled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = /usbpp.cpp \ - /usbpp.h - -# 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 -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh -# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py -# *.f90 *.f *.for *.vhd *.vhdl - -FILE_PATTERNS = *.h \ - *.cpp \ - *.cc \ - *.hpp \ - *.dox \ - *.c++ \ - *.cxx \ - *.h++ \ - *.hh - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = YES - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = *.moc.* \ - moc* \ - *.all_cpp.* \ - *unload.* \ - */test/* \ - */tests/* - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command <filter> <input-file>, where <filter> -# is the value of the INPUT_FILTER tag, and <input-file> is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. -# If FILTER_PATTERNS is specified, this tag will be ignored. -# Note that the filter must not add or remove lines; it is applied before the -# code is scanned, but not when the output code is generated. If lines are added -# or removed, the anchors will not be placed correctly. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. -# Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. -# The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty or if -# non of the patterns match the file name, INPUT_FILTER is applied. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) -# and it is also possible to disable source filtering for a specific pattern -# using *.ext= (so without naming a filter). This option only has effect when -# FILTER_SOURCE_FILES is enabled. - -FILTER_SOURCE_PATTERNS = - -# If the USE_MD_FILE_AS_MAINPAGE tag refers to the name of a markdown file that -# is part of the input, its contents will be placed on the main page -# (index.html). This can be useful if you have a project on for instance GitHub -# and want reuse the introduction page also for the doxygen output. - -USE_MDFILE_AS_MAINPAGE = - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C, C++ and Fortran comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = YES - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. -# Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = YES - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 3 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = K - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = ./html/ - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. Note that when using a custom header you are responsible -# for the proper inclusion of any scripts and style sheets that doxygen -# needs, which is dependent on the configuration options used. -# It is advised to generate a default header using "doxygen -w html -# header.html footer.html stylesheet.css YourConfigFile" and then modify -# that header. Note that the header is subject to change so you typically -# have to redo this when upgrading to a newer version of doxygen or when -# changing the value of configuration settings such as GENERATE_TREEVIEW! - -HTML_HEADER = ${CMAKE_SOURCE_DIR}/doc/header.html - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = ${CMAKE_SOURCE_DIR}/doc/footer.html - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If left blank doxygen will -# generate a default style sheet. Note that it is recommended to use -# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this -# tag will in the future become obsolete. - -HTML_STYLESHEET = - -# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional -# user-defined cascading style sheet that is included after the standard -# style sheets created by doxygen. Using this option one can overrule -# certain style aspects. This is preferred over using HTML_STYLESHEET -# since it does not replace the standard style sheet and is therefor more -# robust against future updates. Doxygen will copy the style sheet file to -# the output directory. - -HTML_EXTRA_STYLESHEET = - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that -# the files will be copied as-is; there are no commands or markers available. - -HTML_EXTRA_FILES = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. -# Doxygen will adjust the colors in the style sheet and background images -# according to this color. Hue is specified as an angle on a colorwheel, -# see http://en.wikipedia.org/wiki/Hue for more information. -# For instance the value 0 represents red, 60 is yellow, 120 is green, -# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. -# The allowed range is 0 to 359. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of -# the colors in the HTML output. For a value of 0 the output will use -# grayscales only. A value of 255 will produce the most vivid colors. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to -# the luminance component of the colors in the HTML output. Values below -# 100 gradually make the output lighter, whereas values above 100 make -# the output darker. The value divided by 100 is the actual gamma applied, -# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, -# and 100 does not change the gamma. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting -# this to NO can help when comparing the output of multiple runs. - -HTML_TIMESTAMP = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. - -HTML_DYNAMIC_SECTIONS = NO - -# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of -# entries shown in the various tree structured indices initially; the user -# can expand and collapse entries dynamically later on. Doxygen will expand -# the tree to such a level that at most the specified number of entries are -# visible (unless a fully collapsed tree already exceeds this amount). -# So setting the number of entries 1 will produce a full collapsed tree by -# default. 0 is a special value representing an infinite number of entries -# and will result in a full expanded tree by default. - -HTML_INDEX_NUM_ENTRIES = 100 - -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely -# identify the documentation publisher. This should be a reverse domain-name -# style string, e.g. com.mycompany.MyDocSet.documentation. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated -# that can be used as input for Qt's qhelpgenerator to generate a -# Qt Compressed Help (.qch) of the generated HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to -# add. For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see -# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters"> -# Qt Help Project / Custom Filters</a>. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's -# filter section matches. -# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes"> -# Qt Help Project / Filter Attributes</a>. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files -# will be generated, which together with the HTML files, form an Eclipse help -# plugin. To install this plugin and make it available under the help contents -# menu in Eclipse, the contents of the directory containing the HTML and XML -# files needs to be copied into the plugins directory of eclipse. The name of -# the directory within the plugins directory should be the same as -# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before -# the help appears. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have -# this name. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) -# at top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. Since the tabs have the same information as the -# navigation tree you can set this option to NO if you already set -# GENERATE_TREEVIEW to YES. - -DISABLE_INDEX = NO - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. -# Since the tree basically has the same information as the tab index you -# could consider to set DISABLE_INDEX to NO when enabling this option. - -GENERATE_TREEVIEW = NO - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values -# (range [0,1..20]) that doxygen will group on one line in the generated HTML -# documentation. Note that a value of 0 will completely suppress the enum -# values from appearing in the overview section. - -ENUM_VALUES_PER_LINE = 4 - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open -# links to external symbols imported via tag files in a separate window. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are -# not supported properly for IE 6.0, but are supported on all modern browsers. -# Note that when changing this option you need to delete any form_*.png files -# in the HTML output before the changes have effect. - -FORMULA_TRANSPARENT = YES - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax -# (see http://www.mathjax.org) which uses client side Javascript for the -# rendering instead of using prerendered bitmaps. Use this if you do not -# have LaTeX installed or if you want to formulas look prettier in the HTML -# output. When enabled you may also need to install MathJax separately and -# configure the path to it using the MATHJAX_RELPATH option. - -USE_MATHJAX = NO - -# When MathJax is enabled you can set the default output format to be used for -# the MathJax output. Supported types are HTML-CSS, NativeMML (i.e. MathML) and -# SVG. The default value is HTML-CSS, which is slower, but has the best -# compatibility. - -MATHJAX_FORMAT = HTML-CSS - -# When MathJax is enabled you need to specify the location relative to the -# HTML output directory using the MATHJAX_RELPATH option. The destination -# directory should contain the MathJax.js script. For instance, if the mathjax -# directory is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to -# the MathJax Content Delivery Network so you can quickly see the result without -# installing MathJax. -# However, it is strongly recommended to install a local -# copy of MathJax from http://www.mathjax.org before deployment. - -MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest - -# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension -# names that should be enabled during MathJax rendering. - -MATHJAX_EXTENSIONS = - -# The MATHJAX_CODEFILE tag can be used to specify a file with javascript -# pieces of code that will be used on startup of the MathJax code. - -MATHJAX_CODEFILE = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box -# for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using -# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets -# (GENERATE_DOCSET) there is already a search function so this one should -# typically be disabled. For large projects the javascript based search engine -# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. - -SEARCHENGINE = NO - -# When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a web server instead of a web client using Javascript. -# There are two flavours of web server based search depending on the -# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for -# searching and an index file used by the script. When EXTERNAL_SEARCH is -# enabled the indexing and searching needs to be provided by external tools. -# See the manual for details. - -SERVER_BASED_SEARCH = NO - -# When EXTERNAL_SEARCH is enabled doxygen will no longer generate the PHP -# script for searching. Instead the search results are written to an XML file -# which needs to be processed by an external indexer. Doxygen will invoke an -# external search engine pointed to by the SEARCHENGINE_URL option to obtain -# the search results. Doxygen ships with an example indexer (doxyindexer) and -# search engine (doxysearch.cgi) which are based on the open source search -# engine library Xapian. See the manual for configuration details. - -EXTERNAL_SEARCH = NO - -# The SEARCHENGINE_URL should point to a search engine hosted by a web server -# which will returned the search results when EXTERNAL_SEARCH is enabled. -# Doxygen ships with an example search engine (doxysearch) which is based on -# the open source search engine library Xapian. See the manual for configuration -# details. - -SEARCHENGINE_URL = - -# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed -# search data is written to a file for indexing by an external tool. With the -# SEARCHDATA_FILE tag the name of this file can be specified. - -SEARCHDATA_FILE = searchdata.xml - -# When SERVER_BASED_SEARCH AND EXTERNAL_SEARCH are both enabled the -# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is -# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple -# projects and redirect the results back to the right project. - -EXTERNAL_SEARCH_ID = - -# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen -# projects other than the one defined by this configuration file, but that are -# all added to the same external search index. Each project needs to have a -# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id -# of to a relative location where the documentation can be found. -# The format is: EXTRA_SEARCH_MAPPINGS = id1=loc1 id2=loc2 ... - -EXTRA_SEARCH_MAPPINGS = - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. -# Note that when enabling USE_PDFLATEX this option is only used for -# generating bitmaps for formulas in the HTML output, but not in the -# Makefile that is written to the output directory. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, letter, legal and -# executive. If left blank a4 will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for -# the generated latex document. The footer should contain everything after -# the last chapter. If it is left blank doxygen will generate a -# standard footer. Notice: only use this tag if you know what you are doing! - -LATEX_FOOTER = - -# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images -# or other source files which should be copied to the LaTeX output directory. -# Note that the files will be copied as-is; there are no commands or markers -# available. - -LATEX_EXTRA_FILES = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = NO - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = NO - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -# If LATEX_SOURCE_CODE is set to YES then doxygen will include -# source code with syntax highlighting in the LaTeX output. -# Note that which sources are shown also depends on other settings -# such as SOURCE_BROWSER. - -LATEX_SOURCE_CODE = NO - -# The LATEX_BIB_STYLE tag can be used to specify the style to use for the -# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See -# http://en.wikipedia.org/wiki/BibTeX for more info. - -LATEX_BIB_STYLE = plain - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load style sheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .kde3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options related to the DOCBOOK output -#--------------------------------------------------------------------------- - -# If the GENERATE_DOCBOOK tag is set to YES Doxygen will generate DOCBOOK files -# that can be used to generate PDF. - -GENERATE_DOCBOOK = NO - -# The DOCBOOK_OUTPUT tag is used to specify where the DOCBOOK pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in -# front of it. If left blank docbook will be used as the default path. - -DOCBOOK_OUTPUT = docbook - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. -# This is useful -# if you want to understand what is going on. -# On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# pointed to by INCLUDE_PATH will be searched when a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = __cplusplus - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition that -# overrules the definition found in the source code. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all references to function-like macros -# that are alone on a line, have an all uppercase name, and do not end with a -# semicolon, because these will confuse the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. For each -# tag file the location of the external documentation should be added. The -# format of a tag file without this location is as follows: -# -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths -# or URLs. Note that each tag file must have a unique name (where the name does -# NOT include the path). If a tag file is not located in the directory in which -# doxygen is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = NO - -# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed -# in the related pages index. If set to NO, only the current project's -# pages will be listed. - -EXTERNAL_PAGES = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option also works with HAVE_DOT disabled, but it is recommended to -# install and use dot, since it yields more powerful graphs. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = NO - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = YES - -# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is -# allowed to run in parallel. When set to 0 (the default) doxygen will -# base this on the number of processors available in the system. You can set it -# explicitly to a value larger than 0 to get control over the balance -# between CPU load and processing speed. - -DOT_NUM_THREADS = 0 - -# By default doxygen will use the Helvetica font for all dot files that -# doxygen generates. When you want a differently looking font you can specify -# the font name using DOT_FONTNAME. You need to make sure dot is able to find -# the font, which can be done by putting it in a standard location or by setting -# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the -# directory containing the font. - -DOT_FONTNAME = Helvetica - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the Helvetica font. -# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to -# set the path where dot can find it. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are 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. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = 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. - -UML_LOOK = NO - -# If the UML_LOOK tag is enabled, the fields and methods are shown inside -# the class node. If there are many fields or methods and many nodes the -# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS -# threshold limits the number of items for each type to make the size more -# manageable. Set this to 0 for no limit. Note that the threshold may be -# exceeded by 50% before the limit is enforced. - -UML_LIMIT_NUM_FIELDS = 10 - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will generate a graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are svg, png, jpg, or gif. -# If left blank png will be used. If you choose svg you need to set -# HTML_FILE_EXTENSION to xhtml in order to make the SVG files -# visible in IE 9+ (other browsers do not have this requirement). - -DOT_IMAGE_FORMAT = png - -# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to -# enable generation of interactive SVG images that allow zooming and panning. -# Note that this requires a modern browser other than Internet Explorer. -# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you -# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files -# visible. Older versions of IE do not have SVG support. - -INTERACTIVE_SVG = NO - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MSCFILE_DIRS tag can be used to specify one or more directories that -# contain msc files that are included in the documentation (see the -# \mscfile command). - -MSCFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not -# seem to support this out of the box. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the edges of -# a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = YES - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES diff --git a/doc/footer.html b/doc/footer.html deleted file mode 100644 index e69de29..0000000 --- a/doc/footer.html +++ /dev/null diff --git a/doc/header.html b/doc/header.html deleted file mode 100644 index e69de29..0000000 --- a/doc/header.html +++ /dev/null diff --git a/build/modules/target_arch.cmake b/modules/target_arch.cmake similarity index 100% rename from build/modules/target_arch.cmake rename to modules/target_arch.cmake diff --git a/build/modules/utilities.cmake b/modules/utilities.cmake similarity index 100% rename from build/modules/utilities.cmake rename to modules/utilities.cmake diff --git a/src/library/CMakeLists.txt b/src/library/CMakeLists.txt index 47bc4ba..f9c58dd 100644 --- a/src/library/CMakeLists.txt +++ b/src/library/CMakeLists.txt @@ -18,3 +18,7 @@ os ) +install(TARGETS license++_static ARCHIVE DESTINATION lib) +install(FILES api/datatypes.h api/license++.h DESTINATION include/api) +install(FILES base/base.h DESTINATION include/base) +install(FILES pc-identifiers.h DESTINATION include/) diff --git a/src/library/base/CMakeLists.txt b/src/library/base/CMakeLists.txt index 700c851..6dc0c98 100644 --- a/src/library/base/CMakeLists.txt +++ b/src/library/base/CMakeLists.txt @@ -4,4 +4,6 @@ logger.c ) -add_dependencies( base public_key ) \ No newline at end of file +add_dependencies( base public_key ) + +install(TARGETS base ARCHIVE DESTINATION lib) diff --git a/src/library/os/linux/CMakeLists.txt b/src/library/os/linux/CMakeLists.txt index fb41404..690f989 100644 --- a/src/library/os/linux/CMakeLists.txt +++ b/src/library/os/linux/CMakeLists.txt @@ -8,3 +8,5 @@ base ${EXTERNAL_LIBS} ) + +install(TARGETS os ARCHIVE DESTINATION lib) diff --git a/src/library/os/win/CMakeLists.txt b/src/library/os/win/CMakeLists.txt index 044586d..972fdb8 100644 --- a/src/library/os/win/CMakeLists.txt +++ b/src/library/os/win/CMakeLists.txt @@ -7,3 +7,5 @@ base ${EXTERNAL_LIBS} ) + +install(TARGETS os ARCHIVE DESTINATION lib) diff --git a/src/scratch/linux/LicenseSigner_linux.cpp b/src/scratch/linux/LicenseSigner_linux.cpp deleted file mode 100644 index aa56203..0000000 --- a/src/scratch/linux/LicenseSigner_linux.cpp +++ /dev/null @@ -1,148 +0,0 @@ -/* - * LicenseSigner.cpp - * - * Created on: Apr 6, 2014 - * - */ - -#include "../LicenseSigner.h" -#include "../private-key.h" -#include <stdexcept> -#include <string.h> -#include <openssl/evp.h> -#include <openssl/bio.h> -#include <openssl/pem.h> -#include <openssl/err.h> -#include <iostream> -#include <cmath> - -namespace license { -using namespace std; - -LicenseSigner::LicenseSigner() { - os_initialize(); -} - -LicenseSigner::LicenseSigner(const std::string& alternatePrimaryKey) { - os_initialize(); -} - -string LicenseSigner::Opensslb64Encode(size_t slen, unsigned char* signature) { - /* - FILE* stream = fmemopen(*buffer, encodedSize+1, "w"); - */ - //bio = BIO_new_fp(stdout, BIO_NOCLOSE); - /*int encodedSize = 4 * ceil(slen / 3); - char* buffer = (char*) (malloc(encodedSize + 1)); - memset(buffer,0,encodedSize+1);*/ - BIO* mem_bio = BIO_new(BIO_s_mem()); - BIO* b64 = BIO_new(BIO_f_base64()); - BIO* bio1 = BIO_push(b64, mem_bio); - BIO_set_flags(bio1, BIO_FLAGS_BASE64_NO_NL); - BIO_write(bio1, signature, slen); - BIO_flush(bio1); - char* charBuf; - int sz = BIO_get_mem_data(mem_bio, &charBuf); - string signatureStr; - signatureStr.assign(charBuf, sz); - BIO_free_all(bio1); - return signatureStr; -} - -string LicenseSigner::signString(const string& license) { - - size_t slen; - unsigned char* signature; - signature = NULL; - /* Create the Message Digest Context */ - EVP_MD_CTX* mdctx = EVP_MD_CTX_create(); - if (!mdctx) { - throw logic_error("Message digest creation context"); - } - const char *private_key = PRIVATE_KEY - ; - BIO* bio = BIO_new_mem_buf((void*) (private_key), strlen(private_key)); - EVP_PKEY *pktmp = PEM_read_bio_PrivateKey(bio, NULL, NULL, NULL); - BIO_free(bio); - /*Initialise the DigestSign operation - SHA-256 has been selected - * as the message digest function in this example */ - if (1 != EVP_DigestSignInit(mdctx, NULL, EVP_sha256(), NULL, pktmp)) { - EVP_MD_CTX_destroy(mdctx); - } - /* Call update with the message */ - if (EVP_DigestSignUpdate(mdctx, license.c_str(), license.length()) != 1) { - EVP_MD_CTX_destroy(mdctx); - throw logic_error("Message signing exception"); - } - /* Finalise the DigestSign operation */ - /* First call EVP_DigestSignFinal with a NULL sig parameter to obtain the length of the - * signature. Length is returned in slen */ - if (EVP_DigestSignFinal(mdctx, NULL, &slen) != 1) { - EVP_MD_CTX_destroy(mdctx); - throw logic_error("Message signature finalization exception"); - } - /* Allocate memory for the signature based on size in slen */ - if (!(signature = (unsigned char *) OPENSSL_malloc( - sizeof(unsigned char) * slen))) { - EVP_MD_CTX_destroy(mdctx); - throw logic_error("Message signature memory allocation exception"); - } - /* Obtain the signature */ - if (1 != EVP_DigestSignFinal(mdctx, signature, &slen)) { - OPENSSL_free(signature); - EVP_MD_CTX_destroy(mdctx); - throw logic_error("Message signature exception"); - } - /* - FILE* stream = fmemopen(*buffer, encodedSize+1, "w"); - */ - //bio = BIO_new_fp(stdout, BIO_NOCLOSE); - /*int encodedSize = 4 * ceil(slen / 3); - char* buffer = (char*) (malloc(encodedSize + 1)); - memset(buffer,0,encodedSize+1);*/ - string signatureStr = Opensslb64Encode(slen, signature); - /* - * BIO *bio, *b64; - char message[] = "Hello World \n"; - b64 = BIO_new(BIO_f_base64()); - bio = BIO_new_fp(stdout, BIO_NOCLOSE); - bio = BIO_push(b64, bio); - BIO_write(bio, message, strlen(message)); - BIO_flush(bio); - BIO_free_all(bio); - Read Base64 encoded data from standard input and write the decoded data to standard output: - - BIO *bio, *b64, *bio_out; - char inbuf[512]; - int inlen; - b64 = BIO_new(BIO_f_base64()); - bio = BIO_new_fp(stdin, BIO_NOCLOSE); - bio_out = BIO_new_fp(stdout, BIO_NOCLOSE); - bio = BIO_push(b64, bio); - while((inlen = BIO_read(bio, inbuf, 512)) > 0) - BIO_write(bio_out, inbuf, inlen); - BIO_free_all(bio); - */ - /* Clean up */ - //free(buffer); - if (pktmp) - EVP_PKEY_free(pktmp); - if (signature) - OPENSSL_free(signature); - - if (mdctx) - EVP_MD_CTX_destroy(mdctx); - return signatureStr; -} - -void LicenseSigner::signLicense(FullLicenseInfo& licenseInfo) { - string license = licenseInfo.printForSign(); - string signature = signString(license); - licenseInfo.license_signature = signature; -} - -LicenseSigner::~LicenseSigner() { - -} - -} /* namespace license */ diff --git a/src/scratch/linux/bootstrap_linux.cpp b/src/scratch/linux/bootstrap_linux.cpp deleted file mode 100644 index 8e42993..0000000 --- a/src/scratch/linux/bootstrap_linux.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/* - * boostrap.c - * - * Created on: Apr 5, 2014 - * - */ - -#include <string> -#include <iostream> -#include <build_properties.h> -#include <openssl/rsa.h> -#include <openssl/pem.h> - -const int kBits = 1024; -const int kExp = 65537; - -using namespace std; - -std::string replaceAll(std::string subject, const std::string& search, - const std::string& replace) { - size_t pos = 0; - while ((pos = subject.find(search, pos)) != std::string::npos) { - subject.replace(pos, search.length(), replace); - pos += replace.length(); - } - return subject; -} - - -/* - * TODO: a large security bug here. PEM format included into - * the executable can easily replaced thanks to its headers and - * footers. Use a binary format instead - * http://www.openssl.org/docs/crypto/d2i_X509.html - * http://www.openssl.org/docs/crypto/d2i_RSAPublicKey.html - * - */ -void writePublicRSAHeader(const std::string& public_fname, RSA* rsa,int random) { - /* To get the C-string PEM form: */ - //BIO bio_private* = BIO_new_file(const char *filename, "w") - BIO* bio_private = BIO_new(BIO_s_mem()); - PEM_write_bio_RSAPublicKey(bio_private, rsa); - int keylen = BIO_pending(bio_private); - char* pem_key = (char*) (calloc(keylen + 1, 1)); /* Null-terminate */ - BIO_read(bio_private, pem_key, keylen); - std::string dest = replaceAll(string(pem_key), string("\n"), - string("\\n\" \\\n\"")); - FILE* fp = fopen(public_fname.c_str(), "w"); - fprintf(fp, "//file generated by bootstrap.c, do not edit.\n\n"); - fprintf(fp, "#ifndef PUBLIC_KEY_H_\n#define PUBLIC_KEY_H_\n"); - fprintf(fp, "#define PUBLIC_KEY \"%s\";\n", dest.c_str()); - fprintf(fp, "#define SHARED_RANDOM %d;\n", abs(random)); - fprintf(fp, "#endif\n"); - fclose(fp); - BIO_free_all(bio_private); - free(pem_key); -} - -void writePrivateRSAHeader(const std::string& private_fname, RSA* rsa) { - /* To get the C-string PEM form: */ - //BIO bio_private* = BIO_new_file(const char *filename, "w") - BIO* bio_private = BIO_new(BIO_s_mem()); - PEM_write_bio_RSAPrivateKey(bio_private, rsa, NULL, NULL, 0, NULL, NULL); - int keylen = BIO_pending(bio_private); - char* pem_key = (char*) (calloc(keylen + 1, 1)); /* Null-terminate */ - BIO_read(bio_private, pem_key, keylen); - std::string dest = replaceAll(string(pem_key), string("\n"), - string("\\n\" \\\n\"")); - FILE* fp = fopen(private_fname.c_str(), "w"); - fprintf(fp, "//file generated by bootstrap.c, do not edit.\n\n"); - fprintf(fp, "#ifndef PRIVATE_KEY_H_\n#define PRIVATE_KEY_H_\n"); - fprintf(fp, "#define PRIVATE_KEY \"%s\";\n", dest.c_str()); - fprintf(fp, "#endif\n"); - fclose(fp); - BIO_free_all(bio_private); - free(pem_key); -} - -void generatePk(std::string private_fname,string public_fname) { - srand(time(NULL)); /* seed random number generator */ - int random=rand(); - RSA *rsa = RSA_generate_key(kBits, kExp, 0, 0); - /* To get the C-string PEM form: */ - //BIO bio_private* = BIO_new_file(const char *filename, "w") - - writePrivateRSAHeader(private_fname, rsa); - writePublicRSAHeader(public_fname, rsa, random); - RSA_free(rsa); -} - -void print_usage() { - printf("usage: bootstrap private-fname public-fname\n"); -} - -int main(int argc, char** argv) { - - if (argc != 3) { - print_usage(); - exit(2); - } else { - printf("********************************************\n"); - printf("* Bootstrap!!! *\n"); - printf("********************************************\n"); - - } - string private_fname = string(argv[1]); - string public_fname(argv[2]); - - generatePk(private_fname,public_fname); - return 0; -} diff --git a/src/scratch/linux/os-linux.cpp b/src/scratch/linux/os-linux.cpp deleted file mode 100644 index d9e8662..0000000 --- a/src/scratch/linux/os-linux.cpp +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE /* To get defns of NI_MAXSERV and NI_MAXHOST */ -#endif -#include <arpa/inet.h> -#include <sys/socket.h> -#include <netdb.h> -#include <ifaddrs.h> -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <linux/if_link.h> -#include <sys/socket.h> -#include <netpacket/packet.h> - -#include <paths.h> - -#include <stdlib.h> -#include <cstring> -#include <string> -#include <system_error> -#include <unistd.h> -#include <sstream> -#include <sys/ioctl.h> -#include <sys/stat.h> -#include "../os-cpp.h" -#include "public-key.h" - -#include <openssl/evp.h> -#include <openssl/bio.h> -#include <openssl/pem.h> -#include <openssl/err.h> - -namespace license { - -using namespace std; - - - - - -VIRTUALIZATION getVirtualization() { -//http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html -// -//bool rc = true; - /*__asm__ ( - "push %edx\n" - "push %ecx\n" - "push %ebx\n" - "mov %eax, 'VMXh'\n" - "mov %ebx, 0\n" // any value but not the MAGIC VALUE - "mov %ecx, 10\n"// get VMWare version - "mov %edx, 'VX'\n"// port number - "in %eax, dx\n"// read port on return EAX returns the VERSION - "cmp %ebx, 'VMXh'\n"// is it a reply from VMWare? - "setz [rc] \n"// set return value - "pop %ebx \n" - "pop %ecx \n" - "pop %edx \n" - );*/ - - return NONE; -} - -} diff --git a/src/scratch/win/Copy of Main.cpp b/src/scratch/win/Copy of Main.cpp deleted file mode 100644 index deb31ac..0000000 --- a/src/scratch/win/Copy of Main.cpp +++ /dev/null @@ -1,125 +0,0 @@ -#include <stdio.h> -#include "../base_lib/CryptoHelper.h" -#include <string> -#include <stdlib.h> -#include <iostream> - -using namespace std; -namespace license { - -void write_pubkey_file(string public_fname, BYTE *pbPublicKey, - DWORD dwPublicKeySize) { - FILE* fp = fopen(public_fname.c_str(), "w"); - fprintf(fp, "//file generated by bootstrap.cpp, do not edit.\n\n"); - fprintf(fp, "#ifndef PUBLIC_KEY_H_\n#define PUBLIC_KEY_H_\n"); - fprintf(fp, "static BYTE PUBLIC_KEY[] = {"); - for (int i = 0; i < dwPublicKeySize; i++) { - if (i != 0) { - fprintf(fp, ","); - } - if (i % 15 == 0) { - fprintf(fp, "\n "); - } - fprintf(fp, "%d", pbPublicKey[i]); - } - fprintf(fp, "\n};\n\n"); - int random = rand() % 1000; - fprintf(fp, "#define SHARED_RANDOM %d;\n", random); - fprintf(fp, "#endif\n"); - fclose(fp); -} - -void write_privkey_file(string private_fname, BYTE *privateKey, - DWORD dwPrivateKeySize) { - FILE* fp = fopen(private_fname.c_str(), "w"); - fprintf(fp, "//file generated by bootstrap.cpp, do not edit.\n\n"); - fprintf(fp, "#ifndef PRIVATE_KEY_H_\n#define PRIVATE_KEY_H_\n"); - fprintf(fp, "static BYTE PRIVATE_KEY[] = {"); - for (int i = 0; i < dwPrivateKeySize; i++) { - if (i != 0) { - fprintf(fp, ","); - } - if (i % 15 == 0) { - fprintf(fp, "\n "); - } - fprintf(fp, "%d", privateKey[i]); - } - fprintf(fp, "\n};\n\n"); - fprintf(fp, "#endif\n"); - fclose(fp); -} - -void generatePk(string private_include, string public_include) { - unique_ptr<CryptoHelper> cryptoHlpr = CryptoHelper.getInstance(); - BYTE *pbPublicKey = NULL, *pbPrivateKey = NULL; - DWORD dwPublicKeySize = 0, dwPrivateKeySize = 0; - HRESULT hr = S_OK; - // Get the key container context. - if (FAILED(hr = cryptoHlpr.AcquireContext(_T("TestContainer")))) { -// Call FormatMessage to display the error returned in hr. - return; - } - // Generate the public/private key pair. - if (FAILED(hr = cryptoHlpr.GenerateKeyPair())) { -// Call FormatMessage to display the error returned in hr. - return; - } - // Export out the public key blob. - if (FAILED( - hr = cryptoHlpr.ExportPublicKey(&pbPublicKey, dwPublicKeySize))) { -// Call FormatMessage to display the error returned in hr. - cerr << "error exporting pubkey" << endl; - return; - } else { - write_pubkey_file(public_include, pbPublicKey, dwPublicKeySize); - } - // Print out the public key to console as a - // hexadecimal string. - wprintf(L"\n\nPublicKey = \""); - for (DWORD i = 0; i < dwPublicKeySize; i++) { - wprintf(L"%02x", pbPublicKey[i]); - } - wprintf(L"\"\n"); - // Export out the private key blob. - if (FAILED(cryptoHlpr.ExportPrivateKey(&pbPrivateKey, dwPrivateKeySize))) { - cerr << "Error exporting private key." << endl; - return; - } else { - write_privkey_file(private_include, pbPrivateKey, dwPrivateKeySize); - } - // Print out the private key to console as a - // hexadecimal string. - wprintf(L"\n\nPrivateKey = \""); - for (DWORD i = 0; i < dwPrivateKeySize; i++) { - wprintf(L"%02x", pbPrivateKey[i]); - } - wprintf(L"\"\n"); - // Delete the public key blob allocated by the -// ExportPublicKey method. - if (pbPublicKey) - delete[] pbPublicKey; - // Delete the private key blob allocated by the -// ExportPrivateKey method. - if (pbPrivateKey) - delete[] pbPrivateKey; - return; -} -} - -int main(int argc, char** argv) { - - if (argc != 3) { - //print_usage(); - exit(2); - } else { - printf("********************************************\n"); - printf("* Bootstrap!!! *\n"); - printf("********************************************\n"); - - } - string private_fname = string(argv[1]); - string public_fname(argv[2]); - - license::generatePk(private_fname, public_fname); - return 0; -} diff --git a/src/scratch/win/LicenseSigner.cpp b/src/scratch/win/LicenseSigner.cpp deleted file mode 100644 index 28d7c4d..0000000 --- a/src/scratch/win/LicenseSigner.cpp +++ /dev/null @@ -1,306 +0,0 @@ -/* - * LicenseSigner.cpp (Windows) - * - * Created on: Apr 6, 2014 - * - */ - -#include <stdexcept> -#include <string.h> -#include <iostream> -#include <cmath> - -#pragma comment(lib, "crypt32.lib") - -#include <stdio.h> -#include <windows.h> -#include <Wincrypt.h> -#define MY_ENCODING_TYPE (PKCS_7_ASN_ENCODING | X509_ASN_ENCODING) -#include "../private-key.h" - -#include "../LicenseSigner.h" -#include "../../library/base/logger.h" -namespace license { - using namespace std; - - LicenseSigner::LicenseSigner() { - os_initialize(); - - if (CryptAcquireContext( - &hProv, - "license-manager2++", - MS_ENHANCED_PROV, - PROV_RSA_FULL, //CRYPT_NEWKEYSET - 0)) { - LOG_DEBUG("CSP context acquired."); - } - else - { - LOG_ERROR("Error during CryptAcquireContextc %d.",GetLastError()); - throw exception(); - } - if (CryptImportKey( - hProv, - PRIVATE_KEY, - sizeof(PRIVATE_KEY), - 0, - 0, - &hPubKey)) - { - LOG_DEBUG("The key has been imported.\n"); - } - else - { - LOG_ERROR("Private key import failed.\n"); - throw exception(); - } - - } - - LicenseSigner::LicenseSigner(const std::string& alternatePrimaryKey) { - os_initialize(); - } - - string LicenseSigner::Opensslb64Encode(size_t slen, unsigned char* signature) { - - return NULL; - } - - string LicenseSigner::signString(const string& license) { - - //------------------------------------------------------------------- - // Declare and initialize variables. - BYTE *pbBuffer = (BYTE *)license.c_str(); - DWORD dwBufferLen = strlen((char *)pbBuffer) + 1; - HCRYPTHASH hHash; - - HCRYPTKEY hKey; - BYTE *pbKeyBlob; - BYTE *pbSignature; - DWORD dwSigLen; - DWORD dwBlobLen; - - //------------------------------------------------------------------- - // Acquire a cryptographic provider context handle. - - - //------------------------------------------------------------------- - // Get the public at signature key. This is the public key - // that will be used by the receiver of the hash to verify - // the signature. In situations where the receiver could obtain the - // sender's public key from a certificate, this step would not be - // needed. - - if (CryptGetUserKey( - hProv, - AT_SIGNATURE, - &hKey)) - { - printf("The signature key has been acquired. \n"); - } - else - { - printf("Error during CryptGetUserKey for signkey. %d", GetLastError()); - } - - //------------------------------------------------------------------- - // Create the hash object. - - if (CryptCreateHash( - hProv, - CALG_SHA1, - 0, - 0, - &hHash)) - { - printf("Hash object created. \n"); - } - else - { - LOG_ERROR("Error during CryptCreateHash."); - } - //------------------------------------------------------------------- - // Compute the cryptographic hash of the buffer. - - if (CryptHashData( - hHash, - pbBuffer, - dwBufferLen, - 0)) - { - printf("The data buffer has been hashed.\n"); - } - else - { - LOG_ERROR("Error during CryptHashData."); - } - //------------------------------------------------------------------- - // Determine the size of the signature and allocate memory. - - dwSigLen = 0; - if (CryptSignHash( - hHash, - AT_SIGNATURE, - NULL, - 0, - NULL, - &dwSigLen)) - { - printf("Signature length %d found.\n", dwSigLen); - } - else - { - LOG_ERROR("Error during CryptSignHash."); - } - //------------------------------------------------------------------- - // Allocate memory for the signature buffer. - - if (pbSignature = (BYTE *)malloc(dwSigLen)) - { - printf("Memory allocated for the signature.\n"); - } - else - { - LOG_ERROR("Out of memory."); - } - //------------------------------------------------------------------- - // Sign the hash object. - - if (CryptSignHash( - hHash, - AT_SIGNATURE, - NULL, - 0, - pbSignature, - &dwSigLen)) - { - printf("pbSignature is the hash signature.\n"); - } - else - { - LOG_ERROR("Error during CryptSignHash."); - } - //------------------------------------------------------------------- - // Destroy the hash object. - - if (hHash) - CryptDestroyHash(hHash); - - printf("The hash object has been destroyed.\n"); - printf("The signing phase of this program is completed.\n\n"); - - //------------------------------------------------------------------- - // In the second phase, the hash signature is verified. - // This would most often be done by a different user in a - // separate program. The hash, signature, and the PUBLICKEYBLOB - // would be read from a file, an email message, - // or some other source. - - // Here, the original pbBuffer, pbSignature, szDescription. - // pbKeyBlob, and their lengths are used. - - // The contents of the pbBuffer must be the same data - // that was originally signed. - - //------------------------------------------------------------------- - // Get the public key of the user who created the digital signature - // and import it into the CSP by using CryptImportKey. This returns - // a handle to the public key in hPubKey. - - /*if (CryptImportKey( - hProv, - pbKeyBlob, - dwBlobLen, - 0, - 0, - &hPubKey)) - { - printf("The key has been imported.\n"); - } - else - { - MyHandleError("Public key import failed."); - } - //------------------------------------------------------------------- - // Create a new hash object. - - if (CryptCreateHash( - hProv, - CALG_MD5, - 0, - 0, - &hHash)) - { - printf("The hash object has been recreated. \n"); - } - else - { - MyHandleError("Error during CryptCreateHash."); - } - //------------------------------------------------------------------- - // Compute the cryptographic hash of the buffer. - - if (CryptHashData( - hHash, - pbBuffer, - dwBufferLen, - 0)) - { - printf("The new hash has been created.\n"); - } - else - { - MyHandleError("Error during CryptHashData."); - } - //------------------------------------------------------------------- - // Validate the digital signature. - - if (CryptVerifySignature( - hHash, - pbSignature, - dwSigLen, - hPubKey, - NULL, - 0)) - { - printf("The signature has been verified.\n"); - } - else - { - printf("Signature not validated!\n"); - } - //------------------------------------------------------------------- - // Free memory to be used to store signature. - - if (pbSignature) - free(pbSignature); - - //------------------------------------------------------------------- - // Destroy the hash object. - - if (hHash) - CryptDestroyHash(hHash);*/ - - //------------------------------------------------------------------- - // Release the provider handle. - - if (hProv) - CryptReleaseContext(hProv, 0); - return string(""); - } // End of main - - - - - - void LicenseSigner::signLicense(FullLicenseInfo& licenseInfo) { - string license = licenseInfo.printForSign(); - string signature = signString(license); - licenseInfo.license_signature = signature; - } - - LicenseSigner::~LicenseSigner() { - - } - -} /* namespace license */ diff --git a/src/tools/base_lib/CMakeLists.txt b/src/tools/base_lib/CMakeLists.txt index dd1df79..009056a 100644 --- a/src/tools/base_lib/CMakeLists.txt +++ b/src/tools/base_lib/CMakeLists.txt @@ -17,3 +17,5 @@ tools_base ${EXTERNAL_LIBS} ) + +install(TARGETS tools_base ARCHIVE DESTINATION lib) diff --git a/src/tools/license-generator/CMakeLists.txt b/src/tools/license-generator/CMakeLists.txt index 2e25026..1c65372 100644 --- a/src/tools/license-generator/CMakeLists.txt +++ b/src/tools/license-generator/CMakeLists.txt @@ -31,5 +31,7 @@ ) add_dependencies( license_generator private_key ) +install(TARGETS license_generator RUNTIME DESTINATION bin) + #SET_TARGET_PROPERTIES(license_generator PROPERTIES LINK_SEARCH_START_STATIC ON) -#SET_TARGET_PROPERTIES(license_generator PROPERTIES LINK_SEARCH_END_STATIC ON) \ No newline at end of file +#SET_TARGET_PROPERTIES(license_generator PROPERTIES LINK_SEARCH_END_STATIC ON) diff --git a/test/functional/CMakeLists.txt b/test/functional/CMakeLists.txt index a3d70ec..9ec800e 100644 --- a/test/functional/CMakeLists.txt +++ b/test/functional/CMakeLists.txt @@ -54,3 +54,4 @@ ADD_TEST(date_test ${EXECUTABLE_OUTPUT_PATH}/date_test) ADD_TEST(volid_test ${EXECUTABLE_OUTPUT_PATH}/volid_test) +install(TARGETS standard_license_test date_test volid_test RUNTIME DESTINATION bin) diff --git a/test/library/CMakeLists.txt b/test/library/CMakeLists.txt index fc1ec78..44e8c80 100644 --- a/test/library/CMakeLists.txt +++ b/test/library/CMakeLists.txt @@ -32,4 +32,6 @@ #SET_TARGET_PROPERTIES(os_linux_test PROPERTIES LINK_SEARCH_START_STATIC ON) ADD_TEST(os_linux_test ${EXECUTABLE_OUTPUT_PATH}/os_linux_test) -ENDIF(WIN32) \ No newline at end of file +ENDIF(WIN32) + +install(TARGETS license_reader_test RUNTIME DESTINATION bin) diff --git a/test/license-generator/CMakeLists.txt b/test/license-generator/CMakeLists.txt index df4129e..5176e28 100644 --- a/test/license-generator/CMakeLists.txt +++ b/test/license-generator/CMakeLists.txt @@ -13,3 +13,5 @@ #add_dependencies( license_generator_test boost_test boost_filesystem ) #SET_TARGET_PROPERTIES(license_generator_test PROPERTIES LINK_SEARCH_START_STATIC ON) ADD_TEST(license_generator_test ${EXECUTABLE_OUTPUT_PATH}/license_generator_test) + +install(TARGETS license_generator_test RUNTIME DESTINATION bin) diff --git a/test/scratch/base62.c b/test/scratch/base62.c deleted file mode 100644 index 7fae217..0000000 --- a/test/scratch/base62.c +++ /dev/null @@ -1,131 +0,0 @@ - - -/* Division by 62 on an arbitrary length input. - (TODO: Note: the cast will segfault on some systems, so you will need - to use a memcpy instead). - Also TODO: Optimisation: use >32 bit integers if available. - */ -static void b62_divide(const unsigned char* dividend, int dividend_len, - unsigned char* quotient, unsigned int* remainder) -{ - unsigned int quantity; - int i; - - quantity = 0; - for (i=dividend_len-2;i>=0;i-=2) { - quantity |= *((unsigned short*)÷nd[i]); - *((unsigned short *)"ient[i]) = (unsigned short)(quantity/62); - quantity = (quantity%62)<<16; - } - *remainder = quantity>>16; -} - -/* pseudo-base62 encode - base62 encoding is not a very nice mapping to character data. The only - way that we can properly do this is to divide by 62 each time and get - the remainder, this will ensure full use of the base62 space. This is - /not/ very performant. So instead we operate the base62 encoding on - 56 bit (7 byte) chunks. This gives a pretty good usage, with far less - lengthy division operations on moderately sized input. I only did this - for completeness as I got interested in it, but we can prove that you have - to do the full division each time (although you may find a better way of - implementing it!) as follows. We want to encode data as a bitstream, so - we want to find N,M s.t. 62^M = 2^N, and M,N are integers. There are - no such M,N (proof on request). For base64 encoding we get 64^M = 2^N, - obviously we can fit M=1,N=6 which equates to sucking up 6 bits each time - for the encoding algorithm. So instead we try to find a comprise between - the the block size, and the number of bits wasted by the conversion to - base62 space. The constraints here are - - (1) we want to deal with whole numbers of bytes to simplify the code - (2) we want to waste as little of the encoding space as possible - (3) we want to keep the division operations restricted to a reasonable - number of bits as the running time of the division operation depends - on the length of the input bit string. - - The ratio of the length of the bit strings in the two bases will be - log2(256)/log2(62) - For base64 encoding we get 4/3 exactly. So to minimize waste here we - want to take chunks of 3 bytes, then there is no wastage between blocks. - For base62 encoding we get ~1.34. Picking 5 as the block size wastes - some 30% of the encoding space for the last byte. Let me know if you - think another pick is better. This one means that we are operating - on 40-bit strings, so the division isn't too strenuous to compute, and - on a 64-bit platform can be done all in a register. - */ -#define msg_id_length (((134359*(sizeof(time_t)+sizeof(int)*2))/100000)+2) - -static char base62_tab[62] = { - 'A','B','C','D','E','F','G','H', - 'I','J','K','L','M','N','O','P', - 'Q','R','S','T','U','V','W','X', - 'Y','Z','a','b','c','d','e','f', - 'g','h','i','j','k','l','m','n', - 'o','p','q','r','s','t','u','v', - 'w','x','y','z','0','1','2','3', - '4','5','6','7','8','9' -}; - -int b62_encode(char* out, const unsigned char* data, int length, int linelength) -{ - int i,j; - char *start = out; - uint64_t bitstring; - - linelength; - for (i=0;i<length-4;i+=5) { - bitstring = - (uint64_t)data[i]<<32|(uint64_t)data[i+1]<<24|(uint64_t)data[i+2]<<16| - (uint64_t)data[i+3]<<8|(uint64_t)data[i+4]; - - for (j=0;j<7;++j) { - *out++ = base62_tab[bitstring%62]; - bitstring /= 62; - } -/* - b62_divide(quotient,len,quotient,&rem); - *out++ = base62_tab[rem]; - for (j=1;j<len;++j) { - b62_divide(quotient,len,quotient,&rem); - *out++ = base62_tab[rem]; - }*/ - } - switch (length-i) { - case 1: - *out++ = base62_tab[data[i]%62]; - *out++ = base62_tab[data[i]/62]; - break; - case 2: - bitstring = data[i]<<8|data[i+1]; - *out++ = base62_tab[bitstring%62]; - bitstring /= 62; - *out++ = base62_tab[bitstring%62]; - *out++ = base62_tab[bitstring/62]; - break; - case 3: - bitstring = data[i]<<16|data[i+1]<<8|data[i]; - *out++ = base62_tab[bitstring%62]; - bitstring /= 62; - *out++ = base62_tab[bitstring%62]; - bitstring /= 62; - *out++ = base62_tab[bitstring%62]; - bitstring /= 62; - *out++ = base62_tab[bitstring%62]; - *out++ = base62_tab[bitstring/62]; - break; - case 4: - bitstring = data[i]<<24|data[i+1]<<16|data[i+2]<<8|data[i]; - *out++ = base62_tab[bitstring%62]; - bitstring /= 62; - *out++ = base62_tab[bitstring%62]; - bitstring /= 62; - *out++ = base62_tab[bitstring%62]; - bitstring /= 62; - *out++ = base62_tab[bitstring%62]; - bitstring /= 62; - *out++ = base62_tab[bitstring%62]; - *out++ = base62_tab[bitstring/62]; - break; - } - return (int)(out-start); -} diff --git a/test/scratch/pc-identifiers.c b/test/scratch/pc-identifiers.c deleted file mode 100644 index 4fe6630..0000000 --- a/test/scratch/pc-identifiers.c +++ /dev/null @@ -1,415 +0,0 @@ -/* - * pc-identifiers.c - * - * Created on: Apr 16, 2014 - * - */ - -#include "os/os.h" -#include "pc-identifiers.h" -#include <stdlib.h> -#include <string.h> -#include <stdbool.h> -#include "base/base64.h" -#include <valgrind/memcheck.h> - -FUNCTION_RETURN generate_ethernet_pc_id(PcIdentifier * identifiers, - unsigned int * num_identifiers, bool use_mac); -static void encodeStrategy(PcIdentifier * identifier, - IDENTIFICATION_STRATEGY strategy); -static FUNCTION_RETURN generate_platform_specific_pc_id( - PcIdentifier * identifiers, unsigned int * num_identifiers); - - -static FUNCTION_RETURN generate_default_pc_id(PcIdentifier * identifiers, - unsigned int * num_identifiers) { - size_t adapter_num, disk_num, plat_spec_id; - FUNCTION_RETURN result_adapterInfos, result_diskinfos, result_plat_spec; - unsigned int required_id_size, current_identifier, i, j, k; - DiskInfo * diskInfos; - AdapterInfo *adapterInfos; - required_id_size = 0; - - //just calculate the number of required identifiers - result_plat_spec = generate_platform_specific_pc_id(NULL, &plat_spec_id); - if (result_plat_spec == FUNC_RET_OK) { - required_id_size += 1; - } - result_adapterInfos = getAdapterInfos(NULL, &adapter_num); - result_diskinfos = getDiskInfos(NULL, &disk_num); - if (result_diskinfos == FUNC_RET_OK && result_adapterInfos == FUNC_RET_OK) { - required_id_size += disk_num * adapter_num; - } else if (result_adapterInfos == FUNC_RET_OK) { - required_id_size += adapter_num; - } else if (result_diskinfos == FUNC_RET_OK) { - required_id_size += disk_num; - } - int defined_identifiers = *num_identifiers; - if (identifiers == NULL) { - *num_identifiers = required_id_size; - return FUNC_RET_OK; - } else if (required_id_size > defined_identifiers) { - return FUNC_RET_BUFFER_TOO_SMALL; - } - - //calculate the identifiers - current_identifier = 0; - if (result_plat_spec == FUNC_RET_OK) { - generate_platform_specific_pc_id(identifiers, 1); - current_identifier += 1; - } - if (result_diskinfos == FUNC_RET_OK && result_adapterInfos == FUNC_RET_OK) { - diskInfos = (DiskInfo*) malloc(disk_num * sizeof(DiskInfo)); - result_diskinfos = getDiskInfos(diskInfos, &disk_num); - adapterInfos = (AdapterInfo*) malloc(adapter_num * sizeof(AdapterInfo)); - result_adapterInfos = getAdapterInfos(adapterInfos, &adapter_num); - for (i = 0; i < disk_num; i++) { - for (j = 0; j < adapter_num; j++) { - if (current_identifier > defined_identifiers) { - break; - } - for (k = 0; k < 6; k++) { - identifiers[current_identifier][k] = diskInfos[i].disk_sn[k - + 2] ^ adapterInfos[j].mac_address[k + 2]; - } - encodeStrategy(&identifiers[current_identifier], DEFAULT); - current_identifier++; - } - } - free(diskInfos); - free(adapterInfos); - } else if (result_adapterInfos == FUNC_RET_OK) { - i=defined_identifiers-current_identifier; - return generate_ethernet_pc_id(&identifiers[current_identifier], - &i, true); - } else if (result_diskinfos == FUNC_RET_OK) { - i=defined_identifiers-current_identifier; - return generate_disk_pc_id(&identifiers[current_identifier], - &i, false); - } - - return FUNC_RET_OK; -} - -static void encodeStrategy(PcIdentifier * identifier, - IDENTIFICATION_STRATEGY strategy) { - unsigned char strategy_num = strategy << 5; - identifier[0][0] = (identifier[0][0] & 15) - - ++ | strategy_num; - -} - -static FUNCTION_RETURN generate_platform_specific_pc_id( - * identifiers, unsigned int * num_identifiers) { - -} - -static FUNCTION_RETURN generate_ethernet_pc_id(PcIdentifier * identifiers, - unsigned int * num_identifiers, bool use_mac) { - size_t adapters; - FUNCTION_RETURN result_adapterInfos; - unsigned int j, k; - AdapterInfo *adapterInfos; - - result_adapterInfos = getAdapterInfos(NULL, &adapters); - if (result_adapterInfos != FUNC_RET_OK) { - return result_adapterInfos; - } - - int defined_adapters = *num_identifiers; - *num_identifiers = adapters; - if (identifiers == NULL) { - return FUNC_RET_OK; - } else if (adapters > defined_adapters) { - return FUNC_RET_BUFFER_TOO_SMALL; - } - - adapterInfos = (AdapterInfo*) malloc(adapters * sizeof(AdapterInfo)); - result_adapterInfos = getAdapterInfos(adapterInfos, &adapters); - for (j = 0; j < adapters; j++) { - for (k = 0; k < 6; k++) - if (use_mac) { - identifiers[j][k] = adapterInfos[j].mac_address[k + 2]; - } else { - //use ip - if (k < 4) { - identifiers[j][k] = adapterInfos[j].ipv4_address[k]; - } else { - //padding - identifiers[j][k] = 42; - } - } - } - free(adapterInfos); - return FUNC_RET_OK; -} - -static FUNCTION_RETURN generate_disk_pc_id(PcIdentifier * identifiers, - unsigned int * num_identifiers, bool use_label) { - size_t disk_num, available_disk_info = 0; - FUNCTION_RETURN result_diskinfos; - unsigned int i, j; - char firstChar; - DiskInfo * diskInfos; - - result_diskinfos = getDiskInfos(NULL, &disk_num); - if (result_diskinfos != FUNC_RET_OK) { - return result_diskinfos; - } - diskInfos = (DiskInfo*) malloc(disk_num * sizeof(DiskInfo)); -//memset(diskInfos,0,disk_num * sizeof(DiskInfo)); - result_diskinfos = getDiskInfos(diskInfos, &disk_num); - if (result_diskinfos != FUNC_RET_OK) { - free(diskInfos); - return result_diskinfos; - } - for (i = 0; i < disk_num; i++) { - firstChar = use_label ? diskInfos[i].label[0] : diskInfos[i].disk_sn[0]; - available_disk_info += firstChar == 0 ? 0 : 1; - } - - int defined_identifiers = *num_identifiers; - *num_identifiers = available_disk_info; - if (identifiers == NULL) { - free(diskInfos); - return FUNC_RET_OK; - } else if (available_disk_info > defined_identifiers) { - free(diskInfos); - return FUNC_RET_BUFFER_TOO_SMALL; - } - - j = 0; - for (i = 0; i < disk_num; i++) { - if (use_label) { - if (diskInfos[i].label[0] != 0) { - memset(identifiers[j], 0, sizeof(PcIdentifier)); //!!!!!!! - strncpy(identifiers[j], diskInfos[i].label, - sizeof(PcIdentifier)); - j++; - } - } else { - if (diskInfos[i].disk_sn[0] != 0) { - memcpy(identifiers[j], &diskInfos[i].disk_sn[2], - sizeof(PcIdentifier)); - j++; - } - } - } - free(diskInfos); - return FUNC_RET_OK; -} - -/** - * - * Calculates all the possible identifiers for the current machine, for the - * given calculation strategy requested. Pc identifiers are more than one, - * for instance a machine with more than one disk and one network interface has - * usually multiple identifiers. - * - * First 4 bit of each pc identifier are reserved 3 for the type of strategy - * used in calculation and 1 for parity checks (not implemented here) - * - * @param identifiers - * @param array_size - * @param - * @return - */ -FUNCTION_RETURN generate_pc_id(PcIdentifier * identifiers, - unsigned int * array_size, IDENTIFICATION_STRATEGY strategy) { - FUNCTION_RETURN result; - unsigned int i, j; - const unsigned int original_array_size = *array_size; - unsigned char strategy_num; - switch (strategy) { - case DEFAULT: - result = generate_default_pc_id(identifiers, array_size); - break; - case ETHERNET: - result = generate_ethernet_pc_id(identifiers, array_size, true); - break; - case IP_ADDRESS: - result = generate_ethernet_pc_id(identifiers, array_size, false); - break; - case DISK_NUM: - result = generate_disk_pc_id(identifiers, array_size, false); - break; - case PLATFORM_SPECIFIC: - result = generate_platform_specific_pc_id(identifiers, array_size); - break; - default: - return FUNC_RET_ERROR; - } - - if (result == FUNC_RET_OK && identifiers != NULL) { - //fill array if larger - for (i = *array_size; i < original_array_size; i++) { - identifiers[i][0] = STRATEGY_UNKNOWN << 5; - for (j = 1; j < sizeof(PcIdentifier); j++) { - identifiers[i][j] = 42; //padding - } - } - } - return result; -} - -char *MakeCRC(char *BitString) { - static char Res[3]; // CRC Result - char CRC[2]; - int i; - char DoInvert; - - for (i = 0; i < 2; ++i) - CRC[i] = 0; // Init before calculation - - for (i = 0; i < strlen(BitString); ++i) { - DoInvert = ('1' == BitString[i]) ^ CRC[1]; // XOR required? - - CRC[1] = CRC[0]; - CRC[0] = DoInvert; - } - - for (i = 0; i < 2; ++i) - Res[1 - i] = CRC[i] ? '1' : '0'; // Convert binary to ASCII - Res[2] = 0; // Set string terminator - - return (Res); -} - -FUNCTION_RETURN encode_pc_id(PcIdentifier identifier1, PcIdentifier identifier2, - PcSignature pc_identifier_out) { -//TODO base62 encoding, now uses base64 - PcIdentifier concat_identifiers[2]; - int b64_size = 0; - size_t concatIdentifiersSize = sizeof(PcIdentifier) * 2; -//concat_identifiers = (PcIdentifier *) malloc(concatIdentifiersSize); - memcpy(&concat_identifiers[0], identifier1, sizeof(PcIdentifier)); - memcpy(&concat_identifiers[1], identifier2, sizeof(PcIdentifier)); - char* b64_data = base64(concat_identifiers, concatIdentifiersSize, - &b64_size); - if (b64_size > sizeof(PcSignature)) { - return FUNC_RET_BUFFER_TOO_SMALL; - } - sprintf(pc_identifier_out, "%.4s-%.4s-%.4s-%.4s", &b64_data[0], - &b64_data[4], &b64_data[8], &b64_data[12]); -//free(concat_identifiers); - free(b64_data); - return FUNC_RET_OK; -} - -FUNCTION_RETURN parity_check_id(PcSignature pc_identifier) { - return FUNC_RET_OK; -} - -FUNCTION_RETURN generate_user_pc_signature(PcSignature identifier_out, - IDENTIFICATION_STRATEGY strategy) { - FUNCTION_RETURN result; - PcIdentifier* identifiers; - unsigned int req_buffer_size = 0; - result = generate_pc_id(NULL, &req_buffer_size, strategy); - if (result != FUNC_RET_OK) { - return result; - } - if (req_buffer_size == 0) { - return FUNC_RET_ERROR; - } - req_buffer_size = req_buffer_size < 2 ? 2 : req_buffer_size; - identifiers = (PcIdentifier *) malloc( - sizeof(PcIdentifier) * req_buffer_size); - result = generate_pc_id(identifiers, &req_buffer_size, strategy); - if (result != FUNC_RET_OK) { - free(identifiers); - return result; - } - VALGRIND_CHECK_VALUE_IS_DEFINED(identifiers[0]); - VALGRIND_CHECK_VALUE_IS_DEFINED(identifiers[1]); - result = encode_pc_id(identifiers[0], identifiers[1], identifier_out); - VALGRIND_CHECK_VALUE_IS_DEFINED(identifier_out); - free(identifiers); - return result; -} - -/** - * Extract the two pc identifiers from the user provided code. - * @param identifier1_out - * @param identifier2_out - * @param str_code: the code in the string format XXXX-XXXX-XXXX-XXXX - * @return - */ -static FUNCTION_RETURN decode_pc_id(PcIdentifier identifier1_out, - PcIdentifier identifier2_out, PcSignature pc_signature_in) { -//TODO base62 encoding, now uses base64 - - unsigned char * concat_identifiers; - char base64ids[17]; - int identifiers_size; - - sscanf(pc_signature_in, "%4s-%4s-%4s-%4s", &base64ids[0], &base64ids[4], - &base64ids[8], &base64ids[12]); - concat_identifiers = unbase64(base64ids, 16, &identifiers_size); - if (identifiers_size > sizeof(PcIdentifier) * 2) { - return FUNC_RET_BUFFER_TOO_SMALL; - } - memcpy(identifier1_out, concat_identifiers, sizeof(PcIdentifier)); - memcpy(identifier2_out, concat_identifiers + sizeof(PcIdentifier), - sizeof(PcIdentifier)); - free(concat_identifiers); - return FUNC_RET_OK; -} - -static IDENTIFICATION_STRATEGY strategy_from_pc_id(PcIdentifier identifier) { - return (IDENTIFICATION_STRATEGY) identifier[0] >> 5; -} - -EVENT_TYPE validate_pc_signature(PcSignature str_code) { - PcIdentifier user_identifiers[2]; - FUNCTION_RETURN result; - IDENTIFICATION_STRATEGY previous_strategy_id, current_strategy_id; - PcIdentifier* calculated_identifiers = NULL; - unsigned int calc_identifiers_size = 0; - int i = 0, j = 0; -//bool found; -#ifdef _DEBUG - printf("Comparing pc identifiers: \n"); -#endif - result = decode_pc_id(user_identifiers[0], user_identifiers[1], str_code); - if (result != FUNC_RET_OK) { - return result; - } - previous_strategy_id = STRATEGY_UNKNOWN; -//found = false; - for (i = 0; i < 2; i++) { - current_strategy_id = strategy_from_pc_id(user_identifiers[i]); - if (current_strategy_id == STRATEGY_UNKNOWN) { - return LICENSE_MALFORMED; - } - if (current_strategy_id != previous_strategy_id) { - if (calculated_identifiers != NULL) { - free(calculated_identifiers); - } - previous_strategy_id = current_strategy_id; - generate_pc_id(NULL, &calc_identifiers_size, current_strategy_id); - calculated_identifiers = (PcIdentifier *) malloc( - sizeof(PcIdentifier) * calc_identifiers_size); - generate_pc_id(calculated_identifiers, &calc_identifiers_size, - current_strategy_id); - } - //maybe skip the byte 0 - for (j = 0; j < calc_identifiers_size; j++) { -#ifdef _DEBUG - printf("generated id: %02x%02x%02x%02x%02x%02x index %d, user_supplied id %02x%02x%02x%02x%02x%02x idx: %d\n", - calculated_identifiers[j][0],calculated_identifiers[j][1],calculated_identifiers[j][2], - calculated_identifiers[j][3],calculated_identifiers[j][4],calculated_identifiers[j][5],j, - user_identifiers[i][0],user_identifiers[i][1],user_identifiers[i][2],user_identifiers[i][3],user_identifiers[i][4],user_identifiers[i][5],i); - -#endif - if (!memcmp(user_identifiers[i], calculated_identifiers[j], - sizeof(PcIdentifier))) { - free(calculated_identifiers); - return LICENSE_OK; - } - } - } - free(calculated_identifiers); - return IDENTIFIERS_MISMATCH; -} diff --git a/test/scratch/stackoverflow.cpp b/test/scratch/stackoverflow.cpp deleted file mode 100644 index 198bfc8..0000000 --- a/test/scratch/stackoverflow.cpp +++ /dev/null @@ -1,187 +0,0 @@ -//http://stackoverflow.com/questions/16858782/how-to-obtain-almost-unique-system-identifier-in-a-cross-platform-way -#include <stdio.h> -#include <string.h> -#include <unistd.h> -#include <errno.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <sys/ioctl.h> -#include <sys/resource.h> -#include <sys/utsname.h> -#include <netdb.h> -#include <netinet/in.h> -#include <netinet/in_systm.h> -#include <netinet/ip.h> -#include <netinet/ip_icmp.h> -#include <assert.h> -#include <stdbool.h> - -#ifdef DARWIN -#include <net/if_dl.h> -#include <ifaddrs.h> -#include <net/if_types.h> -#else //!DARWIN -#include <linux/if.h> -#include <linux/sockios.h> -#endif //!DARWIN - -const char* getMachineName() { - static struct utsname u; - - if (uname(&u) < 0) { - assert(0); - return "unknown"; - } - - return u.nodename; -} - -//---------------------------------get MAC addresses ------------------------------------unsigned short-unsigned short---------- -// we just need this for purposes of unique machine id. So any one or two mac's is fine. -unsigned short hashMacAddress(unsigned char* mac) { - unsigned short hash = 0; - - for (unsigned int i = 0; i < 6; i++) { - hash += (mac[i] << ((i & 1) * 8)); - } - return hash; -} - -void getMacHash(unsigned short *mac1, unsigned short *mac2) { - *mac1 = 0; - *mac2 = 0; - -#ifdef DARWIN - - struct ifaddrs* ifaphead; - if ( getifaddrs( &ifaphead ) != 0 ) - return; - - // iterate over the net interfaces - bool foundMac1 = false; - struct ifaddrs* ifap; - for ( ifap = ifaphead; ifap; ifap = ifap->ifa_next ) - { - struct sockaddr_dl* sdl = (struct sockaddr_dl*)ifap->ifa_addr; - if ( sdl && ( sdl->sdl_family == AF_LINK ) && ( sdl->sdl_type == IFT_ETHER )) - { - if ( !foundMac1 ) - { - foundMac1 = true; - mac1 = hashMacAddress( (unsigned char*)(LLADDR(sdl))); //sdl->sdl_data) + sdl->sdl_nlen) ); - } else { - mac2 = hashMacAddress( (unsigned char*)(LLADDR(sdl))); //sdl->sdl_data) + sdl->sdl_nlen) ); - break; - } - } - } - - freeifaddrs( ifaphead ); - -#else // !DARWIN - - int sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP); - if (sock < 0) - return; - - // enumerate all IP addresses of the system - struct ifconf conf; - char ifconfbuf[128 * sizeof(struct ifreq)]; - memset(ifconfbuf, 0, sizeof(ifconfbuf)); - conf.ifc_buf = ifconfbuf; - conf.ifc_len = sizeof(ifconfbuf); - if (ioctl(sock, SIOCGIFCONF, &conf)) { - assert(0); - return; - } - - // get MAC address - bool foundMac1 = false; - struct ifreq* ifr; - for (ifr = conf.ifc_req; (char*) ifr < (char*) conf.ifc_req + conf.ifc_len; - ifr++) { - if (ifr->ifr_addr.sa_data == (ifr + 1)->ifr_addr.sa_data) - continue; // duplicate, skip it - - if (ioctl(sock, SIOCGIFFLAGS, ifr)) - continue; // failed to get flags, skip it - if (ioctl(sock, SIOCGIFHWADDR, ifr) == 0) { - if (!foundMac1) { - foundMac1 = true; - *mac1 = hashMacAddress( - (unsigned char*) &(ifr->ifr_addr.sa_data)); - } else { - *mac2 = hashMacAddress( - (unsigned char*) &(ifr->ifr_addr.sa_data)); - break; - } - } - } - - close(sock); - -#endif // !DARWIN - - // sort the mac addresses. We don't want to invalidate - // both macs if they just change order. - if (*mac1 > *mac2) { - unsigned short tmp = *mac2; - *mac2 = *mac1; - *mac1 = tmp; - } -} - -unsigned short getVolumeHash() { - // we don't have a 'volume serial number' like on windows. Lets hash the system name instead. - unsigned char* sysname = (unsigned char*) getMachineName(); - unsigned short hash = 0; - - for (unsigned int i = 0; sysname[i]; i++) - hash += (sysname[i] << ((i & 1) * 8)); - - return hash; -} - -#ifdef DARWIN -#include <mach-o/arch.h> -unsigned short getCpuHash() -{ - const NXArchInfo* info = NXGetLocalArchInfo(); - unsigned short val = 0; - val += (unsigned short)info->cputype; - val += (unsigned short)info->cpusubtype; - return val; -} - -#else // !DARWIN - -static void getCpuid(unsigned int* p, unsigned int ax) { - __asm __volatile - ( "movl %%ebx, %%esi\n\t" - "cpuid\n\t" - "xchgl %%ebx, %%esi" - : "=a" (p[0]), "=S" (p[1]), - "=c" (p[2]), "=d" (p[3]) - : "0" (ax) - ); -} - -unsigned short getCpuHash() { - unsigned int cpuinfo[4] = { 0, 0, 0, 0 }; - getCpuid(cpuinfo, 0); - unsigned short hash = 0; - unsigned int* ptr = (&cpuinfo[0]); - for (unsigned int i = 0; i < 4; i++) - hash += (ptr[i] & 0xFFFF) + (ptr[i] >> 16); - - return hash; -} -#endif // !DARWIN - -int main() { - - printf("Machine: %s\n", getMachineName()); - printf("CPU: %d\n", getCpuHash()); - printf("Volume: %d\n", getVolumeHash()); - return 0; -} -- Gitblit v1.9.1