diff options
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Modules/CodeCoverage.cmake | 7 | ||||
-rw-r--r-- | cmake/Modules/FindBOTAN.cmake | 45 | ||||
-rw-r--r-- | cmake/Modules/FindGCRYPT.cmake | 41 | ||||
-rw-r--r-- | cmake/Modules/FindICONV.cmake | 60 | ||||
-rw-r--r-- | cmake/Modules/FindLIBIDN.cmake | 44 | ||||
-rw-r--r-- | cmake/Modules/FindLIBUUID.cmake | 44 | ||||
-rw-r--r-- | cmake/Modules/FindLITESQL.cmake | 76 | ||||
-rw-r--r-- | cmake/Modules/FindSQLITE3.cmake | 43 | ||||
-rw-r--r-- | cmake/Modules/FindSYSTEMD.cmake | 42 | ||||
-rw-r--r-- | cmake/Modules/FindUDNS.cmake | 38 |
10 files changed, 359 insertions, 81 deletions
diff --git a/cmake/Modules/CodeCoverage.cmake b/cmake/Modules/CodeCoverage.cmake index c07a3df..77586ab 100644 --- a/cmake/Modules/CodeCoverage.cmake +++ b/cmake/Modules/CodeCoverage.cmake @@ -157,13 +157,10 @@ FUNCTION(SETUP_TARGET_FOR_COVERAGE _targetname _testrunner _outputname) # Remove information about source files that are not part of # the test (system file, external libraries, etc) - COMMAND ${LCOV_PATH} --remove ${_outputname}.info 'tests/*' '/usr/*' 'external/*' 'build/*' --output-file ${_outputname}.info.cleaned -q + COMMAND ${LCOV_PATH} --remove ${_outputname}.info 'tests/*' '/usr/*' 'external/*' 'build/*' --output-file ${_outputname}.info -q # Generate the report - COMMAND ${GENHTML_PATH} -o ${_outputname} ${_outputname}.info.cleaned - - # Clean the temporary files we created - COMMAND ${CMAKE_COMMAND} -E remove ${_outputname}.info ${_outputname}.info.cleaned + COMMAND ${GENHTML_PATH} -o ${_outputname} ${_outputname}.info WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report." diff --git a/cmake/Modules/FindBOTAN.cmake b/cmake/Modules/FindBOTAN.cmake new file mode 100644 index 0000000..9eb76c4 --- /dev/null +++ b/cmake/Modules/FindBOTAN.cmake @@ -0,0 +1,45 @@ +# - Find botan +# Find the botan cryptographic library +# +# This module defines the following variables: +# BOTAN_FOUND - True if library and include directory are found +# If set to TRUE, the following are also defined: +# BOTAN_INCLUDE_DIRS - The directory where to find the header file +# BOTAN_LIBRARIES - Where to find the library file +# +# For conveniance, these variables are also set. They have the same values +# than the variables above. The user can thus choose his/her prefered way +# to write them. +# BOTAN_LIBRARY +# BOTAN_INCLUDE_DIR +# +# This file is in the public domain + +include(FindPkgConfig) + +if(NOT BOTAN_FOUND) + pkg_check_modules(BOTAN botan-2) + pkg_check_modules(BOTAN botan-1.11) +endif() + +if(NOT BOTAN_FOUND) + find_path(BOTAN_INCLUDE_DIRS NAMES botan/botan.h + PATH_SUFFIXES botan-2 botan-1.11 + DOC "The botan include directory") + + find_library(BOTAN_LIBRARIES NAMES botan botan-2 botan-1.11 + DOC "The botan library") + + # Use some standard module to handle the QUIETLY and REQUIRED arguments, and + # set BOTAN_FOUND to TRUE if these two variables are set. + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(BOTAN REQUIRED_VARS BOTAN_LIBRARIES BOTAN_INCLUDE_DIRS) + + if(BOTAN_FOUND) + set(BOTAN_LIBRARY ${BOTAN_LIBRARIES} CACHE INTERNAL "") + set(BOTAN_INCLUDE_DIR ${BOTAN_INCLUDE_DIRS} CACHE INTERNAL "") + set(BOTAN_FOUND ${BOTAN_FOUND} CACHE INTERNAL "") + endif() +endif() + +mark_as_advanced(BOTAN_INCLUDE_DIRS BOTAN_LIBRARIES) diff --git a/cmake/Modules/FindGCRYPT.cmake b/cmake/Modules/FindGCRYPT.cmake new file mode 100644 index 0000000..b73bfd0 --- /dev/null +++ b/cmake/Modules/FindGCRYPT.cmake @@ -0,0 +1,41 @@ +# - Find gcrypt +# Find the gcrypt cryptographic library +# +# This module defines the following variables: +# GCRYPT_FOUND - True if library and include directory are found +# If set to TRUE, the following are also defined: +# GCRYPT_INCLUDE_DIRS - The directory where to find the header file +# GCRYPT_LIBRARIES - Where to find the library file +# +# For conveniance, these variables are also set. They have the same values +# than the variables above. The user can thus choose his/her prefered way +# to write them. +# GCRYPT_LIBRARY +# GCRYPT_INCLUDE_DIR +# +# This file is in the public domain + +include(FindPkgConfig) +pkg_check_modules(GCRYPT gcrypt) + +if(NOT GCRYPT_FOUND) + find_path(GCRYPT_INCLUDE_DIRS NAMES gcrypt.h + PATH_SUFFIXES gcrypt + DOC "The gcrypt include directory") + + find_library(GCRYPT_LIBRARIES NAMES gcrypt + DOC "The gcrypt library") + + # Use some standard module to handle the QUIETLY and REQUIRED arguments, and + # set GCRYPT_FOUND to TRUE if these two variables are set. + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(GCRYPT REQUIRED_VARS GCRYPT_LIBRARIES GCRYPT_INCLUDE_DIRS) + + if(GCRYPT_FOUND) + set(GCRYPT_LIBRARY ${GCRYPT_LIBRARIES} CACHE INTERNAL "") + set(GCRYPT_INCLUDE_DIR ${GCRYPT_INCLUDE_DIRS} CACHE INTERNAL "") + set(GCRYPT_FOUND ${GCRYPT_FOUND} CACHE INTERNAL "") + endif() +endif() + +mark_as_advanced(GCRYPT_INCLUDE_DIRS GCRYPT_LIBRARIES) diff --git a/cmake/Modules/FindICONV.cmake b/cmake/Modules/FindICONV.cmake new file mode 100644 index 0000000..fb78ac7 --- /dev/null +++ b/cmake/Modules/FindICONV.cmake @@ -0,0 +1,60 @@ +# - Find iconv +# Find the iconv (character set conversion) library +# +# This module defines the following variables: +# ICONV_FOUND - True if library and include directory are found +# If set to TRUE, the following are also defined: +# ICONV_INCLUDE_DIRS - The directory where to find the header file +# ICONV_LIBRARIES - Where to find the library file +# ICONV_SECOND_ARGUMENT_IS_CONST - The second argument for iconv() is const +# +# For conveniance, these variables are also set. They have the same values +# than the variables above. The user can thus choose his/her prefered way +# to write them. +# ICONV_LIBRARY +# ICONV_INCLUDE_DIR +# +# This file is in the public domain + +find_path(ICONV_INCLUDE_DIRS NAMES iconv.h + DOC "The iconv include directory") + +find_library(ICONV_LIBRARIES NAMES iconv libiconv libiconv-2 c + DOC "The iconv library") + +# Use some standard module to handle the QUIETLY and REQUIRED arguments, and +# set ICONV_FOUND to TRUE if these two variables are set. +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Iconv REQUIRED_VARS ICONV_LIBRARIES ICONV_INCLUDE_DIRS) + +# Check if the prototype is +# size_t iconv(iconv_t cd, char** inbuf, size_t* inbytesleft, +# char** outbuf, size_t* outbytesleft); +# or +# size_t iconv (iconv_t cd, const char** inbuf, size_t* inbytesleft, +# char** outbuf, size_t* outbytesleft); +if(ICONV_FOUND) + include(CheckCXXSourceCompiles) + + # Set the parameters needed to compile the following code. + set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIRS}) + set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES}) + + check_cxx_source_compiles(" + #include <iconv.h> + int main(){ + iconv_t conv = 0; + const char* in = 0; + size_t ilen = 0; + char* out = 0; + size_t olen = 0; + iconv(conv, &in, &ilen, &out, &olen); + return 0;}" + ICONV_SECOND_ARGUMENT_IS_CONST) + + # Compatibility for all the ways of writing these variables + set(ICONV_LIBRARY ${ICONV_LIBRARIES}) + set(ICONV_INCLUDE_DIR ${ICONV_INCLUDE_DIRS}) +endif() + +mark_as_advanced(ICONV_INCLUDE_DIRS ICONV_LIBRARIES ICONV_SECOND_ARGUMENT_IS_CONST) diff --git a/cmake/Modules/FindLIBIDN.cmake b/cmake/Modules/FindLIBIDN.cmake new file mode 100644 index 0000000..c769d06 --- /dev/null +++ b/cmake/Modules/FindLIBIDN.cmake @@ -0,0 +1,44 @@ +# - Find libidn +# Find the libidn library, and more particularly the stringprep header. +# +# This module defines the following variables: +# LIBIDN_FOUND - True if library and include directory are found +# If set to TRUE, the following are also defined: +# LIBIDN_INCLUDE_DIRS - The directory where to find the header file +# LIBIDN_LIBRARIES - Where to find the library file +# +# For conveniance, these variables are also set. They have the same values +# than the variables above. The user can thus choose his/her prefered way +# to write them. +# LIBIDN_INCLUDE_DIR +# LIBIDN_LIBRARY +# +# This file is in the public domain + +include(FindPkgConfig) +if(NOT LIBIDN_FOUND) + pkg_check_modules(LIBIDN libidn) +endif() + +if(NOT LIBIDN_FOUND) + find_path(LIBIDN_INCLUDE_DIRS NAMES stringprep.h + DOC "The libidn include directory") + + # The library containing the stringprep module is libidn + find_library(LIBIDN_LIBRARIES NAMES idn + DOC "The libidn library") + + # Use some standard module to handle the QUIETLY and REQUIRED arguments, and + # set LIBIDN_FOUND to TRUE if these two variables are set. + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(LIBIDN REQUIRED_VARS LIBIDN_LIBRARIES LIBIDN_INCLUDE_DIRS) + + # Compatibility for all the ways of writing these variables + if(LIBIDN_FOUND) + set(LIBIDN_INCLUDE_DIR ${LIBIDN_INCLUDE_DIRS} CACHE INTERNAL "") + set(LIBIDN_LIBRARY ${LIBIDN_LIBRARIES} CACHE INTERNAL "") + set(LIBIDN_FOUN ${LIBIDN_FOUND} CACHE INTERNAL "") + endif() +endif() + +mark_as_advanced(LIBIDN_INCLUDE_DIRS LIBIDN_LIBRARIES) diff --git a/cmake/Modules/FindLIBUUID.cmake b/cmake/Modules/FindLIBUUID.cmake new file mode 100644 index 0000000..67352ab --- /dev/null +++ b/cmake/Modules/FindLIBUUID.cmake @@ -0,0 +1,44 @@ +# - Find libuuid +# Find the libuuid library +# +# This module defines the following variables: +# LIBUUID_FOUND - True if library and include directory are found +# If set to TRUE, the following are also defined: +# LIBUUID_INCLUDE_DIRS - The directory where to find the header file +# LIBUUID_LIBRARIES - Where to find the library file +# +# For conveniance, these variables are also set. They have the same values +# than the variables above. The user can thus choose his/her prefered way +# to write them. +# LIBUUID_INCLUDE_DIR +# LIBUUID_LIBRARY +# +# This file is in the public domain + +include(FindPkgConfig) +if(NOT LIBUUID_FOUND) + pkg_check_modules(LIBUUID uuid) +endif() + +if(NOT LIBUUID_FOUND) + find_path(LIBUUID_INCLUDE_DIRS NAMES uuid/uuid.h + PATH_SUFFIXES uuid + DOC "The libuuid include directory") + + find_library(LIBUUID_LIBRARIES NAMES uuid + DOC "The libuuid library") + + # Use some standard module to handle the QUIETLY and REQUIRED arguments, and + # set LIBUUID_FOUND to TRUE if these two variables are set. + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(LIBUUID REQUIRED_VARS LIBUUID_LIBRARIES LIBUUID_INCLUDE_DIRS) + + # Compatibility for all the ways of writing these variables + if(LIBUUID_FOUND) + set(LIBUUID_INCLUDE_DIR ${LIBUUID_INCLUDE_DIRS} CACHE INTERNAL "") + set(LIBUUID_LIBRARY ${LIBUUID_LIBRARIES} CACHE INTERNAL "") + set(LIBUUID_FOUND ${LIBUUID_FOUND} CACHE INTERNAL "") + endif() +endif() + +mark_as_advanced(LIBUUID_INCLUDE_DIRS LIBUUID_LIBRARIES) diff --git a/cmake/Modules/FindLITESQL.cmake b/cmake/Modules/FindLITESQL.cmake deleted file mode 100644 index 91155bb..0000000 --- a/cmake/Modules/FindLITESQL.cmake +++ /dev/null @@ -1,76 +0,0 @@ -# - Find LiteSQL -# -# Find the LiteSQL library, and defines a function to generate C++ files -# from the database xml file using litesql-gen fro -# -# This module defines the following variables: -# LITESQL_FOUND - True if library and include directory are found -# If set to TRUE, the following are also defined: -# LITESQL_INCLUDE_DIRS - The directory where to find the header file -# LITESQL_LIBRARIES - Where to find the library file -# LITESQL_GENERATE_CPP - A function, to be used like this: -# LITESQL_GENERATE_CPP("db/database.xml" # The file defining the db schemas -# "database" # The name of the C++ “module” -# # that will be generated -# LITESQL_GENERATED_SOURCES # Variable containing the -# resulting C++ files to compile -# -# For conveniance, these variables are also set. They have the same values -# than the variables above. The user can thus choose his/her prefered way -# to write them. -# LITESQL_INCLUDE_DIR -# LITESQL_LIBRARY -# -# This file is in the public domain - -find_path(LITESQL_INCLUDE_DIRS NAMES litesql.hpp - DOC "The LiteSQL include directory") - -find_library(LITESQL_LIBRARIES NAMES litesql - DOC "The LiteSQL library") - -foreach(DB_TYPE sqlite postgresql mysql ocilib) - string(TOUPPER ${DB_TYPE} DB_TYPE_UPPER) - find_library(LITESQL_${DB_TYPE_UPPER}_LIB_PATH NAMES litesql_${DB_TYPE} - DOC "The ${DB_TYPE} backend for LiteSQL") - if(LITESQL_${DB_TYPE_UPPER}_LIB_PATH) - list(APPEND LITESQL_LIBRARIES ${LITESQL_${DB_TYPE_UPPER}_LIB_PATH}) - endif() - mark_as_advanced(LITESQL_${DB_TYPE_UPPER}_LIB_PATH) -endforeach() - -find_program(LITESQLGEN_EXECUTABLE NAMES litesql-gen - DOC "The utility that creates .h and .cpp files from a xml database description") - -# Use some standard module to handle the QUIETLY and REQUIRED arguments, and -# set LITESQL_FOUND to TRUE if these two variables are set. -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(LITESQL REQUIRED_VARS LITESQL_LIBRARIES LITESQL_INCLUDE_DIRS - LITESQLGEN_EXECUTABLE) - -# Compatibility for all the ways of writing these variables -if(LITESQL_FOUND) - set(LITESQL_INCLUDE_DIR ${LITESQL_INCLUDE_DIRS}) - set(LITESQL_LIBRARY ${LITESQL_LIBRARIES}) -endif() - -mark_as_advanced(LITESQL_INCLUDE_DIRS LITESQL_LIBRARIES LITESQLGEN_EXECUTABLE) - - -# LITESQL_GENERATE_CPP function - -function(LITESQL_GENERATE_CPP - SOURCE_FILE OUTPUT_NAME OUTPUT_SOURCES) - set(${OUTPUT_SOURCES}) - add_custom_command( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_NAME}.cpp" - "${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_NAME}.hpp" - COMMAND ${LITESQLGEN_EXECUTABLE} - ARGS -t c++ --output-dir=${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_FILE} - DEPENDS ${SOURCE_FILE} - COMMENT "Running litesql-gen on ${SOURCE_FILE}" - VERBATIM) - list(APPEND ${OUTPUT_SOURCES} "${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_NAME}.cpp") - set_source_files_properties(${${OUTPUT_SOURCES}} PROPERTIES GENERATED TRUE) - set(${OUTPUT_SOURCES} ${${OUTPUT_SOURCES}} PARENT_SCOPE) -endfunction() diff --git a/cmake/Modules/FindSQLITE3.cmake b/cmake/Modules/FindSQLITE3.cmake new file mode 100644 index 0000000..2861b37 --- /dev/null +++ b/cmake/Modules/FindSQLITE3.cmake @@ -0,0 +1,43 @@ +# - Find sqlite3 +# Find the sqlite3 cryptographic library +# +# This module defines the following variables: +# SQLITE3_FOUND - True if library and include directory are found +# If set to TRUE, the following are also defined: +# SQLITE3_INCLUDE_DIRS - The directory where to find the header file +# SQLITE3_LIBRARIES - Where to find the library file +# +# For conveniance, these variables are also set. They have the same values +# than the variables above. The user can thus choose his/her prefered way +# to write them. +# SQLITE3_LIBRARY +# SQLITE3_INCLUDE_DIR +# +# This file is in the public domain + +include(FindPkgConfig) + +if(NOT SQLITE3_FOUND) + pkg_check_modules(SQLITE3 sqlite3) +endif() + +if(NOT SQLITE3_FOUND) + find_path(SQLITE3_INCLUDE_DIRS NAMES sqlite3.h + DOC "The sqlite3 include directory") + + find_library(SQLITE3_LIBRARIES NAMES sqlite3 + DOC "The sqlite3 library") + + # Use some standard module to handle the QUIETLY and REQUIRED arguments, and + # set SQLITE3_FOUND to TRUE if these two variables are set. + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(SQLITE3 REQUIRED_VARS SQLITE3_LIBRARIES SQLITE3_INCLUDE_DIRS) + + if(SQLITE3_FOUND) + set(SQLITE3_LIBRARY ${SQLITE3_LIBRARIES} CACHE INTERNAL "") + set(SQLITE3_INCLUDE_DIR ${SQLITE3_INCLUDE_DIRS} CACHE INTERNAL "") + set(SQLITE3_FOUND ${SQLITE3_FOUND} CACHE INTERNAL "") + endif() +endif() + +mark_as_advanced(SQLITE3_INCLUDE_DIRS SQLITE3_LIBRARIES)
\ No newline at end of file diff --git a/cmake/Modules/FindSYSTEMD.cmake b/cmake/Modules/FindSYSTEMD.cmake new file mode 100644 index 0000000..2d3f063 --- /dev/null +++ b/cmake/Modules/FindSYSTEMD.cmake @@ -0,0 +1,42 @@ +# - Find SystemdDaemon +# Find the systemd daemon library +# +# This module defines the following variables: +# SYSTEMD_FOUND - True if library and include directory are found +# If set to TRUE, the following are also defined: +# SYSTEMD_INCLUDE_DIRS - The directory where to find the header file +# SYSTEMD_LIBRARIES - Where to find the library file +# +# For conveniance, these variables are also set. They have the same values +# than the variables above. The user can thus choose his/her prefered way +# to write them. +# SYSTEMD_LIBRARY +# SYSTEMD_INCLUDE_DIR +# +# This file is in the public domain + +include(FindPkgConfig) +if(NOT SYSTEMD_FOUND) + pkg_check_modules(SYSTEMD libsystemd) +endif() + +if(NOT SYSTEMD_FOUND) + find_path(SYSTEMD_INCLUDE_DIRS NAMES systemd/sd-daemon.h + DOC "The Systemd include directory") + + find_library(SYSTEMD_LIBRARIES NAMES systemd + DOC "The Systemd library") + + # Use some standard module to handle the QUIETLY and REQUIRED arguments, and + # set SYSTEMD_FOUND to TRUE if these two variables are set. + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(SYSTEMD REQUIRED_VARS SYSTEMD_LIBRARIES SYSTEMD_INCLUDE_DIRS) + + if(SYSTEMD_FOUND) + set(SYSTEMD_LIBRARY ${SYSTEMD_LIBRARIES} CACHE INTERNAL "") + set(SYSTEMD_INCLUDE_DIR ${SYSTEMD_INCLUDE_DIRS} CACHE INTERNAL "") + set(SYSTEMD_FOUND ${SYSTEMD_FOUND} CACHE INTERNAL "") + endif() +endif() + +mark_as_advanced(SYSTEMD_INCLUDE_DIRS SYSTEMD_LIBRARIES) diff --git a/cmake/Modules/FindUDNS.cmake b/cmake/Modules/FindUDNS.cmake new file mode 100644 index 0000000..9576b2a --- /dev/null +++ b/cmake/Modules/FindUDNS.cmake @@ -0,0 +1,38 @@ +# - Find udns +# Find the udns library +# +# This module defines the following variables: +# UDNS_FOUND - True if library and include directory are found +# If set to TRUE, the following are also defined: +# UDNS_INCLUDE_DIRS - The directory where to find the header file +# UDNS_LIBRARIES - Where to find the library file +# +# For conveniance, these variables are also set. They have the same values +# as the variables above. The user can thus choose his/her prefered way +# to write them. +# UDNS_INCLUDE_DIR +# UDNS_LIBRARY +# +# This file is in the public domain + +if(NOT UDNS_FOUND) + find_path(UDNS_INCLUDE_DIRS NAMES udns.h + DOC "The udns include directory") + + find_library(UDNS_LIBRARIES NAMES udns + DOC "The udns library") + + # Use some standard module to handle the QUIETLY and REQUIRED arguments, and + # set UDNS_FOUND to TRUE if these two variables are set. + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(UDNS REQUIRED_VARS UDNS_LIBRARIES UDNS_INCLUDE_DIRS) + + # Compatibility for all the ways of writing these variables + if(UDNS_FOUND) + set(UDNS_INCLUDE_DIR ${UDNS_INCLUDE_DIRS} CACHE INTERNAL "") + set(UDNS_LIBRARY ${UDNS_LIBRARIES} CACHE INTERNAL "") + set(UDNS_FOUND ${UDNS_FOUND} CACHE INTERNAL "") + endif() +endif() + +mark_as_advanced(UDNS_INCLUDE_DIRS UDNS_LIBRARIES) |