mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-06-16 23:27:15 +02:00
Major plugin refactor and cleanup.
Switched to POCO library for unified platform/library interface. Deprecated the external module API. It was creating more problems than solving. Removed most built-in libraries in favor of system libraries for easier maintenance. Cleaned and secured code with help from static analyzers.
This commit is contained in:
67
vendor/POCO/cmake/CXX1x.cmake
vendored
Normal file
67
vendor/POCO/cmake/CXX1x.cmake
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
# Copyright (c) 2013 Nathan Osman
|
||||
|
||||
# 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.
|
||||
|
||||
# Determines whether the compiler supports C++11
|
||||
macro(check_for_cxx11_compiler _VAR)
|
||||
message(STATUS "Checking for C++11 compiler")
|
||||
set(${_VAR})
|
||||
try_compile(_COMPILER_TEST_RESULT ${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR}/cmake/test_compiler.cpp CMAKE_FLAGS -DCMAKE_CXX_STANDARD=11 -DCMAKE_CXX_STANDARD_REQUIRED=ON)
|
||||
if(NOT _COMPILER_TEST_RESULT AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
try_compile(_COMPILER_TEST_RESULT ${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR}/cmake/test_compiler.cpp CMAKE_FLAGS -DCMAKE_CXX_FLAGS="-stdlib=libc++" -DCMAKE_CXX_STANDARD=11 -DCMAKE_CXX_STANDARD_REQUIRED=ON)
|
||||
if(_COMPILER_TEST_RESULT)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
||||
else()
|
||||
message(STATUS "To enable C++11 install libc++ standard library from https://libcxx.llvm.org/")
|
||||
endif()
|
||||
endif()
|
||||
if(_COMPILER_TEST_RESULT AND ((MSVC AND (MSVC10 OR MSVC11 OR MSVC12 OR MSVC14)) OR
|
||||
(CMAKE_COMPILER_IS_GNUCXX AND NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.8.1) OR
|
||||
(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 3.3) OR
|
||||
(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")))
|
||||
set(${_VAR} 1)
|
||||
message(STATUS "Checking for C++11 compiler - available")
|
||||
else()
|
||||
message(STATUS "Checking for C++11 compiler - unavailable")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# Determines whether the compiler supports C++14
|
||||
macro(check_for_cxx14_compiler _VAR)
|
||||
message(STATUS "Checking for C++14 compiler")
|
||||
set(${_VAR})
|
||||
try_compile(_COMPILER_TEST_RESULT ${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR}/cmake/test_compiler.cpp CMAKE_FLAGS -DCMAKE_CXX_STANDARD=14 -DCMAKE_CXX_STANDARD_REQUIRED=ON)
|
||||
if(NOT _COMPILER_TEST_RESULT AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
try_compile(_COMPILER_TEST_RESULT ${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR}/cmake/test_compiler.cpp CMAKE_FLAGS -DCMAKE_CXX_FLAGS="-stdlib=libc++" -DCMAKE_CXX_STANDARD=14 -DCMAKE_CXX_STANDARD_REQUIRED=ON)
|
||||
if(_COMPILER_TEST_RESULT)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
||||
else()
|
||||
message(STATUS "To enable C++14 install libc++ standard library from https://libcxx.llvm.org/")
|
||||
endif()
|
||||
endif()
|
||||
if(_COMPILER_TEST_RESULT AND ((MSVC AND (MSVC14)) OR
|
||||
(CMAKE_COMPILER_IS_GNUCXX AND NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.9.2) OR
|
||||
(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 3.4) OR
|
||||
(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")))
|
||||
set(${_VAR} 1)
|
||||
message(STATUS "Checking for C++14 compiler - available")
|
||||
else()
|
||||
message(STATUS "Checking for C++14 compiler - unavailable")
|
||||
endif()
|
||||
endmacro()
|
66
vendor/POCO/cmake/DefinePlatformSpecifc.cmake
vendored
Normal file
66
vendor/POCO/cmake/DefinePlatformSpecifc.cmake
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
# http://www.cmake.org/Wiki/CMake_Useful_Variables :
|
||||
# CMAKE_BUILD_TYPE
|
||||
# Choose the type of build. CMake has default flags for these:
|
||||
#
|
||||
# * None (CMAKE_C_FLAGS or CMAKE_CXX_FLAGS used)
|
||||
# * Debug (CMAKE_C_FLAGS_DEBUG or CMAKE_CXX_FLAGS_DEBUG)
|
||||
# * Release (CMAKE_C_FLAGS_RELEASE or CMAKE_CXX_FLAGS_RELEASE)
|
||||
# * RelWithDebInfo (CMAKE_C_FLAGS_RELWITHDEBINFO or CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
||||
# * MinSizeRel (CMAKE_C_FLAGS_MINSIZEREL or CMAKE_CXX_FLAGS_MINSIZEREL)
|
||||
|
||||
# Setting CXX Flag /MD or /MT and POSTFIX values i.e MDd / MD / MTd / MT / d
|
||||
#
|
||||
# For visual studio the library naming is as following:
|
||||
# Dynamic libraries:
|
||||
# - PocoX.dll for release library
|
||||
# - PocoXd.dll for debug library
|
||||
#
|
||||
# Static libraries:
|
||||
# - PocoXmd.lib for /MD release build
|
||||
# - PocoXtmt.lib for /MT release build
|
||||
#
|
||||
# - PocoXmdd.lib for /MD debug build
|
||||
# - PocoXmtd.lib for /MT debug build
|
||||
|
||||
if(MSVC)
|
||||
if(POCO_MT)
|
||||
set(CompilerFlags
|
||||
CMAKE_CXX_FLAGS
|
||||
CMAKE_CXX_FLAGS_DEBUG
|
||||
CMAKE_CXX_FLAGS_RELEASE
|
||||
CMAKE_C_FLAGS
|
||||
CMAKE_C_FLAGS_DEBUG
|
||||
CMAKE_C_FLAGS_RELEASE
|
||||
)
|
||||
foreach(CompilerFlag ${CompilerFlags})
|
||||
string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
|
||||
endforeach()
|
||||
|
||||
set(STATIC_POSTFIX "mt" CACHE STRING "Set static library postfix" FORCE)
|
||||
else(POCO_MT)
|
||||
set(STATIC_POSTFIX "md" CACHE STRING "Set static library postfix" FORCE)
|
||||
endif(POCO_MT)
|
||||
else(MSVC)
|
||||
# Other compilers then MSVC don't have a static STATIC_POSTFIX at the moment
|
||||
set(STATIC_POSTFIX "" CACHE STRING "Set static library postfix" FORCE)
|
||||
endif(MSVC)
|
||||
|
||||
|
||||
|
||||
# Add a d postfix to the debug libraries
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Set Debug library postfix" FORCE)
|
||||
set(CMAKE_RELEASE_POSTFIX "" CACHE STRING "Set Release library postfix" FORCE)
|
||||
set(CMAKE_MINSIZEREL_POSTFIX "" CACHE STRING "Set MinSizeRel library postfix" FORCE)
|
||||
set(CMAKE_RELWITHDEBINFO_POSTFIX "" CACHE STRING "Set RelWithDebInfo library postfix" FORCE)
|
||||
else(BUILD_SHARED_LIBS)
|
||||
set(CMAKE_DEBUG_POSTFIX "${STATIC_POSTFIX}d" CACHE STRING "Set Debug library postfix" FORCE)
|
||||
set(CMAKE_RELEASE_POSTFIX "${STATIC_POSTFIX}" CACHE STRING "Set Release library postfix" FORCE)
|
||||
set(CMAKE_MINSIZEREL_POSTFIX "${STATIC_POSTFIX}" CACHE STRING "Set MinSizeRel library postfix" FORCE)
|
||||
set(CMAKE_RELWITHDEBINFO_POSTFIX "${STATIC_POSTFIX}" CACHE STRING "Set RelWithDebInfo library postfix" FORCE)
|
||||
endif()
|
||||
|
||||
|
||||
# OS Detection
|
||||
include(CheckTypeSize)
|
||||
find_package(Cygwin)
|
41
vendor/POCO/cmake/ExecuteOnAndroid.cmake
vendored
Normal file
41
vendor/POCO/cmake/ExecuteOnAndroid.cmake
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
|
||||
if(EXISTS "$ENV{ANDROID_HOME}")
|
||||
set(ANDROID_SDK "$ENV{ANDROID_HOME}")
|
||||
else()
|
||||
set(ANDROID_SDK "${ANDROID_NDK}/..")
|
||||
endif()
|
||||
message(STATUS "ANDROID_SDK path .... ${ANDROID_SDK}")
|
||||
get_filename_component(UNITTEST_FILENAME ${UNITTEST} NAME)
|
||||
message(STATUS "Cleanup /data/local/tmp ...")
|
||||
execute_process(COMMAND ${ANDROID_SDK}/platform-tools/adb shell "rm -r /data/local/tmp/*" OUTPUT_QUIET)
|
||||
foreach(_TEST_DATA IN ITEMS ${TEST_FILES})
|
||||
message(STATUS "Push ${_TEST_DATA} to android ...")
|
||||
execute_process(COMMAND ${ANDROID_SDK}/platform-tools/adb push ${_TEST_DATA} /data/local/tmp/ OUTPUT_QUIET)
|
||||
endforeach()
|
||||
message(STATUS "Push ignored.sh to android ...")
|
||||
execute_process(COMMAND ${ANDROID_SDK}/platform-tools/adb push ${CMAKE_CURRENT_LIST_DIR}/../travis/ignored.sh /data/local/tmp/ OUTPUT_QUIET)
|
||||
message(STATUS "Push ${LIBRARY_DIR} to android ...")
|
||||
execute_process(COMMAND ${ANDROID_SDK}/platform-tools/adb push ${LIBRARY_DIR} /data/local/tmp/ OUTPUT_QUIET)
|
||||
message(STATUS "Push ${UNITTEST} to android ...")
|
||||
execute_process(COMMAND ${ANDROID_SDK}/platform-tools/adb push ${UNITTEST} /data/local/tmp/ OUTPUT_QUIET)
|
||||
message(STATUS "Execute ${UNITTEST_FILENAME} ${TEST_PARAMETER} on android ...")
|
||||
execute_process(
|
||||
COMMAND ${ANDROID_SDK}/platform-tools/adb shell "cd /data/local/tmp;su root sh -c '. /data/local/tmp/ignored.sh;LD_LIBRARY_PATH=/data/local/tmp:/data/local/tmp/lib:/data/local/tmp/data TMPDIR=/data/local/tmp HOME=/data/local/tmp ./${UNITTEST_FILENAME} ${TEST_PARAMETER};echo exit code $?'"
|
||||
RESULT_VARIABLE _RESULT
|
||||
OUTPUT_VARIABLE _OUT
|
||||
ERROR_VARIABLE _ERR
|
||||
)
|
||||
|
||||
if(_RESULT)
|
||||
execute_process(COMMAND ls -l ${UNITTEST})
|
||||
execute_process(COMMAND ${ANDROID_SDK}/platform-tools/adb shell "ls -R /data/local/tmp")
|
||||
message(FATAL_ERROR "Execution of ${UNITTEST_FILENAME} failed")
|
||||
else()
|
||||
string(REGEX MATCH "exit code ([0-9]+)" _EXIT_CODE ${_OUT})
|
||||
if(NOT "${CMAKE_MATCH_1}" EQUAL 0)
|
||||
execute_process(COMMAND ls -l ${UNITTEST})
|
||||
execute_process(COMMAND ${ANDROID_SDK}/platform-tools/adb shell "ls -R /data/local/tmp")
|
||||
string(REGEX REPLACE "exit code [0-9]+" "" _PRINT_OUT ${_OUT})
|
||||
message(FATAL_ERROR "${UNITTEST_FILENAME} execution error: ${_PRINT_OUT} ${_ERR}")
|
||||
endif()
|
||||
endif()
|
85
vendor/POCO/cmake/FindAPR.cmake
vendored
Normal file
85
vendor/POCO/cmake/FindAPR.cmake
vendored
Normal file
@ -0,0 +1,85 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#.rst:
|
||||
# FindAPR
|
||||
# -------
|
||||
#
|
||||
# Find Apache Portable Runtime
|
||||
#
|
||||
# This will define the following variables::
|
||||
#
|
||||
# APR_FOUND - True if the system has the libraries
|
||||
# APR_INCLUDE_DIRS - where to find the headers
|
||||
# APR_LIBRARIES - where to find the libraries
|
||||
# APR_DEFINITIONS - compile definitions
|
||||
#
|
||||
# and the following imported targets::
|
||||
#
|
||||
# Apache::Apr - The library
|
||||
#
|
||||
# Hints:
|
||||
# Set ``APR_ROOT_DIR`` to the root directory of an installation.
|
||||
#
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_APR QUIET apr-1)
|
||||
|
||||
find_path(APR_INCLUDE_DIR apr.h
|
||||
HINTS
|
||||
${APR_ROOT_DIR}/include
|
||||
${APR_ROOT_INCLUDE_DIRS}
|
||||
PATHS
|
||||
${PC_APR_INCLUDE_DIRS}
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
PATH_SUFFIXES
|
||||
apr-1
|
||||
apr-1.0
|
||||
)
|
||||
|
||||
find_library(APR_LIBRARY
|
||||
NAMES apr-1 ${APR_NAMES}
|
||||
HINTS
|
||||
${APR_ROOT_DIR}/lib
|
||||
${APR_ROOT_LIBRARY_DIRS}
|
||||
PATHS
|
||||
${PC_APR_LIBRARY_DIRS}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
)
|
||||
|
||||
set(APR_VERSION ${PC_APR_VERSION})
|
||||
|
||||
find_package_handle_standard_args(APR
|
||||
FOUND_VAR APR_FOUND
|
||||
REQUIRED_VARS
|
||||
APR_INCLUDE_DIR
|
||||
APR_LIBRARY
|
||||
VERSION_VAR APR_VERSION
|
||||
)
|
||||
|
||||
if(APR_FOUND)
|
||||
set(APR_LIBRARIES ${APR_LIBRARY})
|
||||
set(APR_INCLUDE_DIRS ${APR_INCLUDE_DIR})
|
||||
set(APR_DEFINITIONS ${PC_APR_CFLAGS_OTHER})
|
||||
|
||||
# Deprecated declarations.
|
||||
SET (NATIVE_APR_INCLUDE_PATH ${APR_INCLUDE_DIR} )
|
||||
GET_FILENAME_COMPONENT (NATIVE_APR_LIB_PATH ${APR_LIBRARY} PATH)
|
||||
endif()
|
||||
|
||||
if(APR_FOUND AND NOT TARGET Apache::Apr)
|
||||
add_library(Apache::Apr UNKNOWN IMPORTED)
|
||||
set_target_properties(Apache::Apr PROPERTIES
|
||||
IMPORTED_LOCATION "${APR_LIBRARY}"
|
||||
INTERFACE_COMPILE_OPTIONS "${PC_APR_CFLAGS_OTHER}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${APR_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(
|
||||
APR_LIBRARY
|
||||
APR_INCLUDE_DIR
|
||||
)
|
81
vendor/POCO/cmake/FindAPRUTIL.cmake
vendored
Normal file
81
vendor/POCO/cmake/FindAPRUTIL.cmake
vendored
Normal file
@ -0,0 +1,81 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#.rst:
|
||||
# FindAPRUTIL
|
||||
# -------
|
||||
#
|
||||
# Find Apache Portable Runtime
|
||||
#
|
||||
# This will define the following variables::
|
||||
#
|
||||
# APRUTIL_FOUND - True if the system has the libraries
|
||||
# APRUTIL_INCLUDE_DIRS - where to find the headers
|
||||
# APRUTIL_LIBRARIES - where to find the libraries
|
||||
# APRUTIL_DEFINITIONS - compile definitons
|
||||
#
|
||||
# Hints:
|
||||
# Set ``APRUTIL_ROOT_DIR`` to the root directory of an installation.
|
||||
#
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_APRUTIL QUIET apr-util-1)
|
||||
|
||||
find_path(APRUTIL_INCLUDE_DIR apu.h
|
||||
HINTS
|
||||
${APRUTIL_ROOT_DIR}/include
|
||||
${APRUTIL_ROOT_INCLUDE_DIRS}
|
||||
PATHS
|
||||
${PC_APRUTIL_INCLUDE_DIRS}
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
PATH_SUFFIXES
|
||||
apr-1
|
||||
apr-1.0
|
||||
)
|
||||
|
||||
find_library(APRUTIL_LIBRARY
|
||||
NAMES aprutil-1 ${APRUTIL_NAMES}
|
||||
HINTS
|
||||
${APRUTIL_ROOT_DIR}/lib
|
||||
${APRUTIL_ROOT_LIBRARY_DIRS}
|
||||
PATHS
|
||||
${PC_APRUTIL_LIBRARY_DIRS}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
)
|
||||
|
||||
set(APRUTIL_VERSION ${PC_APRUTIL_VERSION})
|
||||
|
||||
find_package_handle_standard_args(APRUTIL
|
||||
FOUND_VAR APRUTIL_FOUND
|
||||
REQUIRED_VARS
|
||||
APRUTIL_INCLUDE_DIR
|
||||
APRUTIL_LIBRARY
|
||||
VERSION_VAR APRUTIL_VERSION
|
||||
)
|
||||
|
||||
if(APRUTIL_FOUND)
|
||||
set(APRUTIL_LIBRARIES ${APRUTIL_LIBRARY})
|
||||
set(APRUTIL_INCLUDE_DIRS ${APRUTIL_INCLUDE_DIR})
|
||||
set(APRUTIL_DEFINITIONS ${PC_APRUTIL_CFLAGS_OTHER})
|
||||
|
||||
# Deprecated declarations.
|
||||
SET (NATIVE_APRUTIL_INCLUDE_PATH ${APRUTIL_INCLUDE_DIR} )
|
||||
GET_FILENAME_COMPONENT (NATIVE_APRUTIL_LIB_PATH ${APRUTIL_LIBRARY} PATH)
|
||||
endif()
|
||||
|
||||
if(APRUTIL_FOUND AND NOT TARGET Apache::Aprutil)
|
||||
add_library(Apache::Aprutil UNKNOWN IMPORTED)
|
||||
set_target_properties(Apache::Aprutil PROPERTIES
|
||||
IMPORTED_LOCATION "${APRUTIL_LIBRARY}"
|
||||
INTERFACE_COMPILE_OPTIONS "${PC_APRUTIL_CFLAGS_OTHER}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${APRUTIL_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(
|
||||
APRUTIL_LIBRARY
|
||||
APRUTIL_INCLUDE_DIR
|
||||
)
|
49
vendor/POCO/cmake/FindApache2.cmake
vendored
Normal file
49
vendor/POCO/cmake/FindApache2.cmake
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#.rst:
|
||||
# FindApache2
|
||||
# -------
|
||||
#
|
||||
# Find Apache2 Runtime
|
||||
#
|
||||
# This will define the following variables::
|
||||
#
|
||||
# APACHE2_FOUND - True if the system has the Apache2 library
|
||||
# APACHE2_INCLUDE_DIRS - where to find httpd.h, etc.
|
||||
#
|
||||
# Hints:
|
||||
# Set ``APACHE2_ROOT_DIR`` to the root directory of an Apache installation.
|
||||
#
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_APACHE2 QUIET apache2)
|
||||
|
||||
find_path(APACHE2_INCLUDE_DIR httpd.h
|
||||
HINTS
|
||||
${APACHE2_ROOT_DIR}/include/apache2
|
||||
${APACHE2_ROOT_INCLUDE_DIRS}
|
||||
PATHS
|
||||
${PC_APACHE2_INCLUDE_DIRS}
|
||||
/usr/local/include/apache2
|
||||
/usr/include/apache2
|
||||
)
|
||||
|
||||
set(APACHE2_VERSION ${PC_APACHE2_VERSION})
|
||||
|
||||
find_package_handle_standard_args(Apache2
|
||||
FOUND_VAR APACHE2_FOUND
|
||||
REQUIRED_VARS
|
||||
APACHE2_INCLUDE_DIR
|
||||
VERSION_VAR APACHE2_VERSION
|
||||
)
|
||||
|
||||
if(APACHE2_FOUND)
|
||||
set(APACHE2_INCLUDE_DIRS ${APACHE2_INCLUDE_DIR})
|
||||
set(APACHE2_DEFINITIONS ${PC_APACHE2_CFLAGS_OTHER})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(
|
||||
APACHE2_INCLUDE_DIR
|
||||
)
|
133
vendor/POCO/cmake/FindMySQL.cmake
vendored
Normal file
133
vendor/POCO/cmake/FindMySQL.cmake
vendored
Normal file
@ -0,0 +1,133 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#.rst:
|
||||
# FindMySQL
|
||||
# -------
|
||||
#
|
||||
# Find MySQL Runtime
|
||||
#
|
||||
# This will define the following variables::
|
||||
#
|
||||
# MYSQL_FOUND - True if the system has the libraries
|
||||
# MYSQL_INCLUDE_DIRS - where to find the headers
|
||||
# MYSQL_LIBRARIES - where to find the libraries
|
||||
# MYSQL_DEFINITIONS - compile definitons
|
||||
#
|
||||
# Hints:
|
||||
# Set ``MYSQL_ROOT_DIR`` to the root directory of an installation.
|
||||
#
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_MYSQL QUIET mysqlclient)
|
||||
pkg_check_modules(PC_MARIADB QUIET mariadb)
|
||||
|
||||
SET(BINDIR32_ENV_NAME "ProgramFiles(x86)")
|
||||
SET(BINDIR32 $ENV{${BINDIR32_ENV_NAME}})
|
||||
|
||||
find_path(MYSQL_INCLUDE_DIR mysql.h
|
||||
HINTS
|
||||
${MYSQL_ROOT_DIR}/include
|
||||
${MYSQL_ROOT_INCLUDE_DIRS}
|
||||
PATHS
|
||||
${PC_MYSQL_INCLUDE_DIRS}
|
||||
${PC_MARIADB_INCLUDE_DIRS}
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/opt/mysql/mysql/include
|
||||
/usr/local/mysql/include
|
||||
$ENV{MYSQL_INCLUDE_DIR}
|
||||
$ENV{MYSQL_DIR}/include
|
||||
$ENV{ProgramFiles}/MySQL/*/include
|
||||
${BINDIR32}/MySQL/*/include
|
||||
$ENV{SystemDrive}/MySQL/*/include
|
||||
$ENV{MARIADB_INCLUDE_DIR}
|
||||
$ENV{MARIADB_DIR}/include
|
||||
${MARIADB_INCLUDE_DIR}
|
||||
${MARIADB_DIR}/include
|
||||
PATH_SUFFIXES
|
||||
mysql
|
||||
mariadb
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
if (CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
set(libsuffixDist debug)
|
||||
set(libsuffixBuild Debug)
|
||||
else (CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
set(libsuffixDist opt)
|
||||
set(libsuffixBuild Release)
|
||||
set(WIN_MYSQL_DEFINITONS " -DDBUG_OFF")
|
||||
endif (CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
|
||||
find_library(MYSQL_LIBRARY NAMES mysqlclient
|
||||
HINTS
|
||||
${MYSQL_ROOT_DIR}/lib
|
||||
${MYSQL_ROOT_LIBRARY_DIRS}
|
||||
PATHS
|
||||
${PC_MYSQL_LIBRARY_DIRS}
|
||||
${PC_MARIADB_LIBRARY_DIRS}
|
||||
$ENV{MYSQL_DIR}/lib
|
||||
$ENV{MYSQL_DIR}/libmysql
|
||||
$ENV{MYSQL_DIR}/client
|
||||
$ENV{ProgramFiles}/MySQL/*/lib
|
||||
${BINDIR32}/MySQL/*/lib
|
||||
$ENV{SystemDrive}/MySQL/*/lib
|
||||
PATH_SUFFIXES
|
||||
vs12
|
||||
vs11
|
||||
vs10
|
||||
${libsuffixDist}
|
||||
${libsuffixBuild}
|
||||
)
|
||||
else()
|
||||
find_library(MYSQL_LIBRARY NAMES mysqlclient mysqlclient_r mariadbclient
|
||||
HINTS
|
||||
${MYSQL_ROOT_DIR}/lib
|
||||
${MYSQL_ROOT_LIBRARY_DIRS}
|
||||
PATHS
|
||||
${PC_MYSQL_LIBRARY_DIRS}
|
||||
${PC_MARIADB_LIBRARY_DIRS}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/usr/local/mysql/lib
|
||||
/opt/mysql/mysql/lib
|
||||
$ENV{MYSQL_DIR}/libmysql_r/.libs
|
||||
$ENV{MYSQL_DIR}/lib
|
||||
${MYSQL_DIR}/lib
|
||||
PATH_SUFFIXES
|
||||
mysql
|
||||
mariadb
|
||||
)
|
||||
endif()
|
||||
|
||||
set(MYSQL_VERSION ${PC_MYSQL_VERSION})
|
||||
|
||||
find_package_handle_standard_args(MySQL
|
||||
FOUND_VAR MYSQL_FOUND
|
||||
REQUIRED_VARS
|
||||
MYSQL_INCLUDE_DIR
|
||||
MYSQL_LIBRARY
|
||||
VERSION_VAR MYSQL_VERSION
|
||||
)
|
||||
|
||||
if(MYSQL_FOUND)
|
||||
set(MYSQL_LIBRARIES ${MYSQL_LIBRARY})
|
||||
set(MYSQL_INCLUDE_DIRS ${MYSQL_INCLUDE_DIR})
|
||||
set(MYSQL_DEFINITIONS "${PC_MYSQL_CFLAGS_OTHER}${WIN_MYSQL_DEFINITONS}")
|
||||
endif()
|
||||
|
||||
if(MYSQL_FOUND AND NOT TARGET MySQL::client)
|
||||
add_library(MySQL::client UNKNOWN IMPORTED)
|
||||
set_target_properties(MySQL::client PROPERTIES
|
||||
IMPORTED_LOCATION "${MYSQL_LIBRARY}"
|
||||
INTERFACE_COMPILE_OPTIONS "${PC_MYSQL_CFLAGS_OTHER}${WIN_MYSQL_DEFINITONS}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${MYSQL_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(
|
||||
MYSQL_LIBRARY
|
||||
MYSQL_INCLUDE_DIR
|
||||
)
|
147
vendor/POCO/cmake/FindODBC.cmake
vendored
Normal file
147
vendor/POCO/cmake/FindODBC.cmake
vendored
Normal file
@ -0,0 +1,147 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#.rst:
|
||||
# FindMySQL
|
||||
# -------
|
||||
#
|
||||
# Find ODBC Runtime
|
||||
#
|
||||
# This will define the following variables::
|
||||
#
|
||||
# ODBC_FOUND - True if the system has the libraries
|
||||
# ODBC_INCLUDE_DIRS - where to find the headers
|
||||
# ODBC_LIBRARIES - where to find the libraries
|
||||
# ODBC_DEFINITIONS - compile definitons
|
||||
#
|
||||
# Hints:
|
||||
# Set ``ODBC_ROOT_DIR`` to the root directory of an installation.
|
||||
#
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_ODBC QUIET odbc)
|
||||
|
||||
if(WIN32)
|
||||
get_filename_component(kit_dir "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot]" REALPATH)
|
||||
get_filename_component(kit81_dir "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot81]" REALPATH)
|
||||
endif()
|
||||
|
||||
find_path(ODBC_INCLUDE_DIR
|
||||
NAMES sql.h
|
||||
HINTS
|
||||
${ODBC_ROOT_DIR}/include
|
||||
${ODBC_ROOT_INCLUDE_DIRS}
|
||||
PATHS
|
||||
${PC_ODBC_INCLUDE_DIRS}
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/usr/local/odbc/include
|
||||
/usr/local/iodbc/include
|
||||
"C:/Program Files/ODBC/include"
|
||||
"C:/Program Files/Microsoft SDKs/Windows/v7.0/include"
|
||||
"C:/Program Files/Microsoft SDKs/Windows/v6.0a/include"
|
||||
"C:/ODBC/include"
|
||||
"${kit_dir}/Include/um"
|
||||
"${kit81_dir}/Include/um"
|
||||
PATH_SUFFIXES
|
||||
odbc
|
||||
iodbc
|
||||
DOC "Specify the directory containing sql.h."
|
||||
)
|
||||
|
||||
if(NOT ODBC_INCLUDE_DIR AND WIN32)
|
||||
set(ODBC_INCLUDE_DIR "")
|
||||
else()
|
||||
set(REQUIRED_INCLUDE_DIR ODBC_INCLUDE_DIR)
|
||||
endif()
|
||||
|
||||
if(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(WIN_ARCH x64)
|
||||
elseif(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
set(WIN_ARCH x86)
|
||||
endif()
|
||||
|
||||
find_library(ODBC_LIBRARY
|
||||
NAMES unixodbc iodbc odbc odbc32
|
||||
HINTS
|
||||
${ODBC_ROOT_DIR}/lib
|
||||
${ODBC_ROOT_LIBRARY_DIRS}
|
||||
PATHS
|
||||
${PC_ODBC_LIBRARY_DIRS}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/usr/local/odbc/lib
|
||||
/usr/local/iodbc/lib
|
||||
"C:/Program Files/ODBC/lib"
|
||||
"C:/ODBC/lib/debug"
|
||||
"C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib"
|
||||
"${kit81_dir}/Lib/winv6.3/um"
|
||||
"${kit_dir}/Lib/win8/um"
|
||||
PATH_SUFIXES
|
||||
odbc
|
||||
${WIN_ARCH}
|
||||
DOC "Specify the ODBC driver manager library here."
|
||||
)
|
||||
|
||||
if(NOT ODBC_LIBRARY AND WIN32)
|
||||
# List names of ODBC libraries on Windows
|
||||
set(ODBC_LIBRARY odbc32.lib)
|
||||
endif()
|
||||
|
||||
# List additional libraries required to use ODBC library
|
||||
if(WIN32 AND MSVC OR CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
||||
set(_odbc_required_libs_names odbccp32;ws2_32)
|
||||
endif()
|
||||
foreach(_lib_name IN LISTS _odbc_required_libs_names)
|
||||
find_library(_lib_path
|
||||
NAMES ${_lib_name}
|
||||
HINTS
|
||||
${ODBC_ROOT_DIR}/lib
|
||||
${ODBC_ROOT_LIBRARY_DIRS}
|
||||
PATHS
|
||||
${PC_ODBC_LIBRARY_DIRS}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/usr/local/odbc/lib
|
||||
/usr/local/iodbc/lib
|
||||
"C:/Program Files/ODBC/lib"
|
||||
"C:/ODBC/lib/debug"
|
||||
"C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib"
|
||||
PATH_SUFFIXES
|
||||
odbc
|
||||
)
|
||||
if (_lib_path)
|
||||
list(APPEND _odbc_required_libs_paths ${_lib_path})
|
||||
endif()
|
||||
unset(_lib_path CACHE)
|
||||
endforeach()
|
||||
unset(_odbc_lib_paths)
|
||||
unset(_odbc_required_libs_names)
|
||||
|
||||
|
||||
find_package_handle_standard_args(ODBC
|
||||
FOUND_VAR ODBC_FOUND
|
||||
REQUIRED_VARS
|
||||
ODBC_LIBRARY
|
||||
${REQUIRED_INCLUDE_DIR}
|
||||
VERSION_VAR ODBC_VERSION
|
||||
)
|
||||
|
||||
if(ODBC_FOUND)
|
||||
set(ODBC_LIBRARIES ${ODBC_LIBRARY} ${_odbc_required_libs_paths})
|
||||
set(ODBC_INCLUDE_DIRS ${ODBC_INCLUDE_DIR})
|
||||
set(ODBC_DEFINITIONS ${PC_ODBC_CFLAGS_OTHER})
|
||||
endif()
|
||||
|
||||
if(ODBC_FOUND AND NOT TARGET ODBC::ODBC)
|
||||
add_library(ODBC::ODBC UNKNOWN IMPORTED)
|
||||
set_target_properties(ODBC::ODBC PROPERTIES
|
||||
IMPORTED_LOCATION "${ODBC_LIBRARY}"
|
||||
INTERFACE_LINK_LIBRARIES "${_odbc_required_libs_paths}"
|
||||
INTERFACE_COMPILE_OPTIONS "${PC_ODBC_CFLAGS_OTHER}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${ODBC_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(ODBC_LIBRARY ODBC_INCLUDE_DIR)
|
107
vendor/POCO/cmake/FindPCRE.cmake
vendored
Normal file
107
vendor/POCO/cmake/FindPCRE.cmake
vendored
Normal file
@ -0,0 +1,107 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
FindPCRE
|
||||
-------
|
||||
|
||||
Finds the PCRE library.
|
||||
|
||||
Imported Targets
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
This module provides the following imported targets, if found:
|
||||
|
||||
``Pcre::Pcre``
|
||||
The PCRE library
|
||||
|
||||
Result Variables
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
This will define the following variables:
|
||||
|
||||
``PCRE_FOUND``
|
||||
True if the system has the PCRE library.
|
||||
``PCRE_VERSION``
|
||||
The version of the PCRE library which was found.
|
||||
``PCRE_INCLUDE_DIRS``
|
||||
Include directories needed to use PCRE.
|
||||
``PCRE_LIBRARIES``
|
||||
Libraries needed to link to PCRE.
|
||||
|
||||
Cache Variables
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
The following cache variables may also be set:
|
||||
|
||||
``PCRE_INCLUDE_DIR``
|
||||
The directory containing ``foo.h``.
|
||||
``PCRE_LIBRARY``
|
||||
The path to the PCRE library.
|
||||
|
||||
Hints
|
||||
^^^^^
|
||||
|
||||
``PCRE_ROOT_DIR``
|
||||
The path to the root directory of a PCRE installation.
|
||||
``PCRE_ROOT_INCLUDE_DIRS``
|
||||
The path to the include directory of a PCRE installation.
|
||||
``PCRE_ROOT_LIBRARY_DIRS``
|
||||
The path to the library directory of a PCRE installation.
|
||||
|
||||
#]=======================================================================]#
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_PCRE QUIET pcre)
|
||||
|
||||
find_path(PCRE_INCLUDE_DIR
|
||||
NAMES pcre.h
|
||||
HINTS
|
||||
${PCRE_ROOT_DIR}/include
|
||||
${PCRE_ROOT_INCLUDE_DIRS}
|
||||
PATHS
|
||||
${PC_PCRE_INCLUDE_DIRS}
|
||||
DOC "Specify the include directory containing pcre.h"
|
||||
)
|
||||
|
||||
find_library(PCRE_LIBRARY
|
||||
NAMES pcre
|
||||
HINTS
|
||||
${PCRE_ROOT_DIR}/lib
|
||||
${PCRE_ROOT_LIBRARY_DIRS}
|
||||
PATHS
|
||||
${PC_PCRE_LIBRARY_DIRS}
|
||||
DOC "Specify the lib directory containing pcre"
|
||||
)
|
||||
|
||||
set(PCRE_VERSION ${PC_PCRE_VERSION})
|
||||
|
||||
find_package_handle_standard_args(PCRE
|
||||
FOUND_VAR PCRE_FOUND
|
||||
REQUIRED_VARS
|
||||
PCRE_LIBRARY
|
||||
PCRE_INCLUDE_DIR
|
||||
VERSION_VAR PCRE_VERSION
|
||||
)
|
||||
|
||||
if(PCRE_FOUND)
|
||||
set(PCRE_LIBRARIES ${PCRE_LIBRARY})
|
||||
set(PCRE_INCLUDE_DIRS ${PCRE_INCLUDE_DIR})
|
||||
set(PCRE_DEFINITIONS ${PC_PCRE_CFLAGS_OTHER})
|
||||
endif()
|
||||
|
||||
if(PCRE_FOUND AND NOT TARGET Pcre::Pcre)
|
||||
add_library(Pcre::Pcre UNKNOWN IMPORTED)
|
||||
set_target_properties(Pcre::Pcre PROPERTIES
|
||||
IMPORTED_LOCATION "${PCRE_LIBRARY}"
|
||||
INTERFACE_COMPILE_OPTIONS "${PC_PCRE_CFLAGS_OTHER}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${PCRE_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(
|
||||
PCRE_INCLUDE_DIR
|
||||
PCRE_LIBRARY
|
||||
)
|
212
vendor/POCO/cmake/FindPostgreSQL.cmake
vendored
Normal file
212
vendor/POCO/cmake/FindPostgreSQL.cmake
vendored
Normal file
@ -0,0 +1,212 @@
|
||||
# TODO(Bjoe) This is taken from cmake 3.10. For poco we need some changes here. Maybe we create an issue on cmake project
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#.rst:
|
||||
# FindPostgreSQL
|
||||
# --------------
|
||||
#
|
||||
# Find the PostgreSQL installation.
|
||||
#
|
||||
# This module defines
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# PostgreSQL_LIBRARIES - the PostgreSQL libraries needed for linking
|
||||
# PostgreSQL_INCLUDE_DIRS - the directories of the PostgreSQL headers
|
||||
# PostgreSQL_LIBRARY_DIRS - the link directories for PostgreSQL libraries
|
||||
# PostgreSQL_VERSION - the version of PostgreSQL found (since CMake 2.8.8)
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# History:
|
||||
# This module is derived from the module originally found in the VTK source tree.
|
||||
#
|
||||
# ----------------------------------------------------------------------------
|
||||
# Note:
|
||||
# PostgreSQL_ADDITIONAL_VERSIONS is a variable that can be used to set the
|
||||
# version mumber of the implementation of PostgreSQL.
|
||||
# In Windows the default installation of PostgreSQL uses that as part of the path.
|
||||
# E.g C:\Program Files\PostgreSQL\8.4.
|
||||
# Currently, the following version numbers are known to this module:
|
||||
# "9.6" "9.5" "9.4" "9.3" "9.2" "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0"
|
||||
#
|
||||
# To use this variable just do something like this:
|
||||
# set(PostgreSQL_ADDITIONAL_VERSIONS "9.2" "8.4.4")
|
||||
# before calling find_package(PostgreSQL) in your CMakeLists.txt file.
|
||||
# This will mean that the versions you set here will be found first in the order
|
||||
# specified before the default ones are searched.
|
||||
#
|
||||
# ----------------------------------------------------------------------------
|
||||
# You may need to manually set:
|
||||
# PostgreSQL_ROOT_DIR - that points to the root of where you have installed PostgreSQL
|
||||
# PostgreSQL_INCLUDE_DIR - the path to where the PostgreSQL include files are.
|
||||
# PostgreSQL_LIBRARY_DIR - The path to where the PostgreSQL library files are.
|
||||
# If FindPostgreSQL.cmake cannot find the include files or the library files.
|
||||
#
|
||||
# ----------------------------------------------------------------------------
|
||||
# The following variables are set if PostgreSQL is found:
|
||||
# PostgreSQL_FOUND - Set to true when PostgreSQL is found.
|
||||
# PostgreSQL_INCLUDE_DIRS - Include directories for PostgreSQL
|
||||
# PostgreSQL_LIBRARY_DIRS - Link directories for PostgreSQL libraries
|
||||
# PostgreSQL_LIBRARIES - The PostgreSQL libraries.
|
||||
#
|
||||
# ----------------------------------------------------------------------------
|
||||
# If you have installed PostgreSQL in a non-standard location.
|
||||
# (Please note that in the following comments, it is assumed that <Your Path>
|
||||
# points to the root directory of the include directory of PostgreSQL.)
|
||||
# Then you have three options.
|
||||
# 1) After CMake runs, set PostgreSQL_INCLUDE_DIR to <Your Path>/include and
|
||||
# PostgreSQL_LIBRARY_DIR to wherever the library pq (or libpq in windows) is
|
||||
# 2) Use CMAKE_INCLUDE_PATH to set a path to <Your Path>/PostgreSQL<-version>. This will allow find_path()
|
||||
# to locate PostgreSQL_INCLUDE_DIR by utilizing the PATH_SUFFIXES option. e.g. In your CMakeLists.txt file
|
||||
# set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "<Your Path>/include")
|
||||
# 3) Set an environment variable called ${PostgreSQL_ROOT} / ${PostgreSQL_ROOT_DIR} that points to the root of where you have
|
||||
# installed PostgreSQL, e.g. <Your Path>.
|
||||
#
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
set(PostgreSQL_INCLUDE_PATH_DESCRIPTION "top-level directory containing the PostgreSQL include directories. E.g /usr/local/include/PostgreSQL/8.4 or C:/Program Files/PostgreSQL/8.4/include")
|
||||
set(PostgreSQL_INCLUDE_DIR_MESSAGE "Set the PostgreSQL_INCLUDE_DIR cmake cache entry to the ${PostgreSQL_INCLUDE_PATH_DESCRIPTION}")
|
||||
set(PostgreSQL_LIBRARY_PATH_DESCRIPTION "top-level directory containing the PostgreSQL libraries.")
|
||||
set(PostgreSQL_LIBRARY_DIR_MESSAGE "Set the PostgreSQL_LIBRARY_DIR cmake cache entry to the ${PostgreSQL_LIBRARY_PATH_DESCRIPTION}")
|
||||
set(PostgreSQL_ROOT_DIR_MESSAGE "Set the PostgreSQL_ROOT system variable to where PostgreSQL is found on the machine E.g C:/Program Files/PostgreSQL/8.4")
|
||||
|
||||
|
||||
set(PostgreSQL_KNOWN_VERSIONS ${PostgreSQL_ADDITIONAL_VERSIONS}
|
||||
"10" "9.6" "9.5" "9.4" "9.3" "9.2" "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0")
|
||||
|
||||
# Define additional search paths for root directories.
|
||||
set(PostgreSQL_ROOT_DIRECTORIES
|
||||
ENV PostgreSQL_ROOT
|
||||
${PostgreSQL_ROOT}
|
||||
${PostgreSQL_ROOT_DIR}
|
||||
)
|
||||
foreach(suffix ${PostgreSQL_KNOWN_VERSIONS})
|
||||
if(WIN32)
|
||||
list(APPEND PostgreSQL_LIBRARY_ADDITIONAL_SEARCH_SUFFIXES
|
||||
"PostgreSQL/${suffix}/lib")
|
||||
list(APPEND PostgreSQL_INCLUDE_ADDITIONAL_SEARCH_SUFFIXES
|
||||
"PostgreSQL/${suffix}/include")
|
||||
list(APPEND PostgreSQL_TYPE_ADDITIONAL_SEARCH_SUFFIXES
|
||||
"PostgreSQL/${suffix}/include/server")
|
||||
endif()
|
||||
if(UNIX)
|
||||
list(APPEND PostgreSQL_LIBRARY_ADDITIONAL_SEARCH_SUFFIXES
|
||||
"pgsql-${suffix}/lib")
|
||||
list(APPEND PostgreSQL_INCLUDE_ADDITIONAL_SEARCH_SUFFIXES
|
||||
"pgsql-${suffix}/include")
|
||||
list(APPEND PostgreSQL_TYPE_ADDITIONAL_SEARCH_SUFFIXES
|
||||
"postgresql/${suffix}/server"
|
||||
"pgsql-${suffix}/include/server")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(UNIX)
|
||||
list(APPEND PostgreSQL_ROOT_DIRECTORIES
|
||||
"/usr")
|
||||
list(APPEND PostgreSQL_INCLUDE_ADDITIONAL_SEARCH_SUFFIXES
|
||||
"include/postgresql")
|
||||
endif()
|
||||
|
||||
#
|
||||
# Look for an installation.
|
||||
#
|
||||
find_path(PostgreSQL_INCLUDE_DIR
|
||||
NAMES libpq-fe.h
|
||||
HINTS
|
||||
${PostgreSQL_ROOT_INCLUDE_DIRS}
|
||||
PATHS
|
||||
# Look in other places.
|
||||
${PostgreSQL_ROOT_DIRECTORIES}
|
||||
PATH_SUFFIXES
|
||||
pgsql
|
||||
postgresql
|
||||
include
|
||||
${PostgreSQL_INCLUDE_ADDITIONAL_SEARCH_SUFFIXES}
|
||||
# Help the user find it if we cannot.
|
||||
DOC "The ${PostgreSQL_INCLUDE_DIR_MESSAGE}"
|
||||
)
|
||||
|
||||
# TODO(Bjoe) It is not needed to build an PostgreSQL client. Maybe create an issue on cmake project
|
||||
# find_path(PostgreSQL_TYPE_INCLUDE_DIR
|
||||
# NAMES catalog/pg_type.h
|
||||
# PATHS
|
||||
# # Look in other places.
|
||||
# ${PostgreSQL_ROOT_DIRECTORIES}
|
||||
# PATH_SUFFIXES
|
||||
# postgresql
|
||||
# pgsql/server
|
||||
# postgresql/server
|
||||
# include/server
|
||||
# ${PostgreSQL_TYPE_ADDITIONAL_SEARCH_SUFFIXES}
|
||||
# # Help the user find it if we cannot.
|
||||
# DOC "The ${PostgreSQL_INCLUDE_DIR_MESSAGE}"
|
||||
# )
|
||||
|
||||
# The PostgreSQL library.
|
||||
set(PostgreSQL_LIBRARY_TO_FIND pq)
|
||||
# Setting some more prefixes for the library
|
||||
set(PostgreSQL_LIB_PREFIX "")
|
||||
if(WIN32)
|
||||
set(PostgreSQL_LIB_PREFIX ${PostgreSQL_LIB_PREFIX} "lib")
|
||||
set(PostgreSQL_LIBRARY_TO_FIND ${PostgreSQL_LIB_PREFIX}${PostgreSQL_LIBRARY_TO_FIND})
|
||||
endif()
|
||||
|
||||
find_library(PostgreSQL_LIBRARY
|
||||
NAMES ${PostgreSQL_LIBRARY_TO_FIND}
|
||||
HINTS
|
||||
${PostgreSQL_ROOT_LIBRARY_DIRS}
|
||||
PATHS
|
||||
${PostgreSQL_ROOT_DIRECTORIES}
|
||||
PATH_SUFFIXES
|
||||
lib
|
||||
${PostgreSQL_LIBRARY_ADDITIONAL_SEARCH_SUFFIXES}
|
||||
# Help the user find it if we cannot.
|
||||
DOC "The ${PostgreSQL_LIBRARY_DIR_MESSAGE}"
|
||||
)
|
||||
get_filename_component(PostgreSQL_LIBRARY_DIR ${PostgreSQL_LIBRARY} PATH)
|
||||
|
||||
if(PostgreSQL_INCLUDE_DIR)
|
||||
# Some platforms include multiple pg_config.hs for multi-lib configurations
|
||||
# This is a temporary workaround. A better solution would be to compile
|
||||
# a dummy c file and extract the value of the symbol.
|
||||
file(GLOB _PG_CONFIG_HEADERS "${PostgreSQL_INCLUDE_DIR}/pg_config*.h")
|
||||
foreach(_PG_CONFIG_HEADER ${_PG_CONFIG_HEADERS})
|
||||
if(EXISTS "${_PG_CONFIG_HEADER}")
|
||||
file(STRINGS "${_PG_CONFIG_HEADER}" pgsql_version_str
|
||||
REGEX "^#define[\t ]+PG_VERSION[\t ]+\".*\"")
|
||||
if(pgsql_version_str)
|
||||
string(REGEX REPLACE "^#define[\t ]+PG_VERSION[\t ]+\"([^\"]*)\".*"
|
||||
"\\1" PostgreSQL_VERSION "${pgsql_version_str}")
|
||||
break()
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
unset(pgsql_version_str)
|
||||
endif()
|
||||
|
||||
# Did we find anything?
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(
|
||||
PostgreSQL
|
||||
REQUIRED_VARS PostgreSQL_LIBRARY PostgreSQL_INCLUDE_DIR #PostgreSQL_TYPE_INCLUDE_DIR
|
||||
VERSION_VAR PostgreSQL_VERSION
|
||||
)
|
||||
set(PostgreSQL_FOUND ${POSTGRESQL_FOUND})
|
||||
|
||||
# Now try to get the include and library path.
|
||||
if(PostgreSQL_FOUND)
|
||||
set(PostgreSQL_INCLUDE_DIRS ${PostgreSQL_INCLUDE_DIR} ) #${PostgreSQL_TYPE_INCLUDE_DIR} )
|
||||
set(PostgreSQL_LIBRARY_DIRS ${PostgreSQL_LIBRARY_DIR} )
|
||||
set(PostgreSQL_LIBRARIES ${PostgreSQL_LIBRARY})
|
||||
endif()
|
||||
|
||||
if(PostgreSQL_FOUND AND NOT TARGET PostgreSQL::client)
|
||||
add_library(PostgreSQL::client UNKNOWN IMPORTED)
|
||||
set_target_properties(PostgreSQL::client PROPERTIES
|
||||
IMPORTED_LOCATION "${PostgreSQL_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${PostgreSQL_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(PostgreSQL_INCLUDE_DIR PostgreSQL_LIBRARY ) #PostgreSQL_TYPE_INCLUDE_DIR
|
53
vendor/POCO/cmake/PocoConfig.cmake.in
vendored
Normal file
53
vendor/POCO/cmake/PocoConfig.cmake.in
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
if (CMAKE_VERSION VERSION_LESS 2.8.9)
|
||||
message(FATAL_ERROR "Poco requires at least CMake version 2.8.9")
|
||||
endif()
|
||||
|
||||
if (NOT Poco_FIND_COMPONENTS)
|
||||
set(Poco_NOT_FOUND_MESSAGE "The Poco package requires at least one component")
|
||||
set(Poco_FOUND False)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(_Poco_FIND_PARTS_REQUIRED)
|
||||
if (Poco_FIND_REQUIRED)
|
||||
set(_Poco_FIND_PARTS_REQUIRED REQUIRED)
|
||||
endif()
|
||||
set(_Poco_FIND_PARTS_QUIET)
|
||||
if (Poco_FIND_QUIETLY)
|
||||
set(_Poco_FIND_PARTS_QUIET QUIET)
|
||||
endif()
|
||||
|
||||
get_filename_component(_Poco_install_prefix "${CMAKE_CURRENT_LIST_DIR}" ABSOLUTE)
|
||||
|
||||
set(_Poco_NOTFOUND_MESSAGE)
|
||||
|
||||
# Let components find each other, but don't overwrite CMAKE_PREFIX_PATH
|
||||
set(_Poco_CMAKE_PREFIX_PATH_old ${CMAKE_PREFIX_PATH})
|
||||
set(CMAKE_PREFIX_PATH ${_Poco_install_prefix})
|
||||
|
||||
foreach(module ${Poco_FIND_COMPONENTS})
|
||||
find_package(Poco${module}
|
||||
${_Poco_FIND_PARTS_QUIET}
|
||||
${_Poco_FIND_PARTS_REQUIRED}
|
||||
PATHS "${_Poco_install_prefix}" NO_DEFAULT_PATH
|
||||
)
|
||||
if (NOT Poco${module}_FOUND)
|
||||
if (Poco_FIND_REQUIRED_${module})
|
||||
set(_Poco_NOTFOUND_MESSAGE "${_Poco_NOTFOUND_MESSAGE}Failed to find Poco component \"${module}\" config file at \"${_Poco_install_prefix}/Poco${module}/Poco${module}Config.cmake\"\n")
|
||||
elseif(NOT Poco_FIND_QUIETLY)
|
||||
message(WARNING "Failed to find Poco component \"${module}\" config file at \"${_Poco_install_prefix}/Poco${module}/Poco${module}Config.cmake\"")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# For backward compatibility set the LIBRARIES variable
|
||||
list(APPEND Poco_LIBRARIES "Poco::${module}")
|
||||
endforeach()
|
||||
|
||||
# Restore the original CMAKE_PREFIX_PATH value
|
||||
set(CMAKE_PREFIX_PATH ${_Poco_CMAKE_PREFIX_PATH_old})
|
||||
|
||||
if (_Poco_NOTFOUND_MESSAGE)
|
||||
set(Poco_NOT_FOUND_MESSAGE "${_Poco_NOTFOUND_MESSAGE}")
|
||||
set(Poco_FOUND False)
|
||||
endif()
|
||||
|
11
vendor/POCO/cmake/PocoConfigVersion.cmake.in
vendored
Normal file
11
vendor/POCO/cmake/PocoConfigVersion.cmake.in
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
set(PACKAGE_VERSION @APPLICATION_VERSION@)
|
||||
|
||||
# Check whether the requested PACKAGE_FIND_VERSION is compatible
|
||||
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
|
||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
else()
|
||||
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||
if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
|
||||
set(PACKAGE_VERSION_EXACT TRUE)
|
||||
endif()
|
||||
endif()
|
311
vendor/POCO/cmake/PocoMacros.cmake
vendored
Normal file
311
vendor/POCO/cmake/PocoMacros.cmake
vendored
Normal file
@ -0,0 +1,311 @@
|
||||
# Copyright Siemens AG, 2014
|
||||
# Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
||||
# and Contributors.
|
||||
#
|
||||
# SPDX-License-Identifier: BSL-1.0
|
||||
#
|
||||
# Collection of common functionality for Poco CMake
|
||||
|
||||
# Find the Microsoft mc.exe message compiler
|
||||
#
|
||||
# CMAKE_MC_COMPILER - where to find mc.exe
|
||||
if(WIN32)
|
||||
# cmake has CMAKE_RC_COMPILER, but no message compiler
|
||||
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
|
||||
# this path is only present for 2008+, but we currently require PATH to
|
||||
# be set up anyway
|
||||
get_filename_component(sdk_dir "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" REALPATH)
|
||||
get_filename_component(kit_dir "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot]" REALPATH)
|
||||
get_filename_component(kit81_dir "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot81]" REALPATH)
|
||||
get_filename_component(kit10_dir "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot10]" REALPATH)
|
||||
get_filename_component(kit10wow_dir "[HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot10]" REALPATH)
|
||||
file(GLOB kit10_list ${kit10_dir}/bin/10.* ${kit10wow_dir}/bin/10.*)
|
||||
if(X64)
|
||||
set(sdk_bindir "${sdk_dir}/bin/x64")
|
||||
set(kit_bindir "${kit_dir}/bin/x64")
|
||||
set(kit81_bindir "${kit81_dir}/bin/x64")
|
||||
foreach(tmp_elem ${kit10_list})
|
||||
if(IS_DIRECTORY ${tmp_elem})
|
||||
list(APPEND kit10_bindir "${tmp_elem}/x64")
|
||||
endif()
|
||||
endforeach()
|
||||
else(X64)
|
||||
set(sdk_bindir "${sdk_dir}/bin")
|
||||
set(kit_bindir "${kit_dir}/bin/x86")
|
||||
set(kit81_bindir "${kit81_dir}/bin/x86")
|
||||
foreach(tmp_elem ${kit10_list})
|
||||
if(IS_DIRECTORY ${tmp_elem})
|
||||
list(APPEND kit10_bindir "${tmp_elem}/x86")
|
||||
endif()
|
||||
endforeach()
|
||||
endif(X64)
|
||||
find_program(CMAKE_MC_COMPILER mc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir}
|
||||
DOC "path to message compiler")
|
||||
elseif ("${CMAKE_GENERATOR}" MATCHES "MSYS" OR "${CMAKE_GENERATOR}" MATCHES "^(CodeBlocks)?.*(MinGW)?.*")
|
||||
get_filename_component(MINGW_BIN_PATH ${CMAKE_C_COMPILER} DIRECTORY REALPATH)
|
||||
if(NOT IS_DIRECTORY ${MINGW_BIN_PATH})
|
||||
get_filename_component(MINGW_BIN_PATH ${CMAKE_CXX_COMPILER} DIRECTORY REALPATH)
|
||||
endif()
|
||||
find_program(CMAKE_MC_COMPILER windmc.exe HINTS "${MINGW_BIN_PATH}"
|
||||
DOC "path to message compiler")
|
||||
endif()
|
||||
if(NOT CMAKE_MC_COMPILER)
|
||||
message(FATAL_ERROR "message compiler not found: required to build")
|
||||
endif(NOT CMAKE_MC_COMPILER)
|
||||
message(STATUS "Found message compiler: ${CMAKE_MC_COMPILER}")
|
||||
mark_as_advanced(CMAKE_MC_COMPILER)
|
||||
endif(WIN32)
|
||||
|
||||
#===============================================================================
|
||||
# Macros for Source file management
|
||||
#
|
||||
# POCO_SOURCES_PLAT - Adds a list of files to the sources of a components
|
||||
# Usage: POCO_SOURCES_PLAT( out name platform sources)
|
||||
# INPUT:
|
||||
# out the variable the sources are added to
|
||||
# name: the name of the components
|
||||
# platform: the platform this sources are for (ON = All, OFF = None, WIN32, UNIX ...)
|
||||
# sources: a list of files to add to ${out}
|
||||
# Example: POCO_SOURCES_PLAT( SRCS Foundation ON src/Foundation.cpp )
|
||||
#
|
||||
# POCO_SOURCES - Like POCO_SOURCES_PLAT with platform = ON (Built on all platforms)
|
||||
# Usage: POCO_SOURCES( out name sources)
|
||||
# Example: POCO_SOURCES( SRCS Foundation src/Foundation.cpp)
|
||||
#
|
||||
# POCO_SOURCES_AUTO - Like POCO_SOURCES but the name is read from the file header // Package: X
|
||||
# Usage: POCO_SOURCES_AUTO( out sources)
|
||||
# Example: POCO_SOURCES_AUTO( SRCS src/Foundation.cpp)
|
||||
#
|
||||
# POCO_SOURCES_AUTO_PLAT - Like POCO_SOURCES_PLAT but the name is read from the file header // Package: X
|
||||
# Usage: POCO_SOURCES_AUTO_PLAT(out platform sources)
|
||||
# Example: POCO_SOURCES_AUTO_PLAT( SRCS WIN32 src/Foundation.cpp)
|
||||
#
|
||||
#
|
||||
# POCO_HEADERS - Adds a list of files to the headers of a components
|
||||
# Usage: POCO_HEADERS( out name headers)
|
||||
# INPUT:
|
||||
# out the variable the headers are added to
|
||||
# name: the name of the components
|
||||
# headers: a list of files to add to HDRSt
|
||||
# Example: POCO_HEADERS( HDRS Foundation include/Poco/Foundation.h )
|
||||
#
|
||||
# POCO_HEADERS_AUTO - Like POCO_HEADERS but the name is read from the file header // Package: X
|
||||
# Usage: POCO_HEADERS_AUTO( out headers)
|
||||
# Example: POCO_HEADERS_AUTO( HDRS src/Foundation.cpp)
|
||||
#
|
||||
#
|
||||
# POCO_MESSAGES - Adds a list of files to the messages of a components
|
||||
# and adds the generated headers to the header list of the component.
|
||||
# On platforms other then Windows this does nothing
|
||||
# Usage: POCO_MESSAGES( out name messages)
|
||||
# INPUT:
|
||||
# out the variable the message and the resulting headers are added to
|
||||
# name: the name of the components
|
||||
# messages: a list of files to add to MSGS
|
||||
# Example: POCO_MESSAGES( HDRS Foundation include/Poco/Foundation.mc )
|
||||
#
|
||||
|
||||
macro(POCO_SOURCES_PLAT out name platform)
|
||||
source_group("${name}\\Source Files" FILES ${ARGN})
|
||||
list(APPEND ${out} ${ARGN})
|
||||
if(NOT(${platform}))
|
||||
set_source_files_properties(${ARGN} PROPERTIES HEADER_FILE_ONLY TRUE)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(POCO_SOURCES out name)
|
||||
POCO_SOURCES_PLAT( ${out} ${name} ON ${ARGN})
|
||||
endmacro()
|
||||
|
||||
macro(POCO_SOURCES_AUTO out)
|
||||
POCO_SOURCES_AUTO_PLAT( ${out} ON ${ARGN})
|
||||
endmacro()
|
||||
|
||||
macro(POCO_SOURCES_AUTO_PLAT out platform)
|
||||
foreach(f ${ARGN})
|
||||
get_filename_component(fname ${f} NAME)
|
||||
|
||||
# Read the package name from the source file
|
||||
file(STRINGS ${f} package REGEX "// Package: (.*)")
|
||||
if(package)
|
||||
string(REGEX REPLACE ".*: (.*)" "\\1" name ${package})
|
||||
|
||||
# Files of the Form X_UNIX.cpp are treated as headers
|
||||
if(${fname} MATCHES ".*_.*\\..*")
|
||||
#message(STATUS "Platform: ${name} ${f} ${platform}")
|
||||
POCO_SOURCES_PLAT( ${out} ${name} OFF ${f})
|
||||
else()
|
||||
#message(STATUS "Source: ${name} ${f} ${platform}")
|
||||
POCO_SOURCES_PLAT( ${out} ${name} ${platform} ${f})
|
||||
endif()
|
||||
else()
|
||||
#message(STATUS "Source: Unknown ${f} ${platform}")
|
||||
POCO_SOURCES_PLAT( ${out} Unknown ${platform} ${f})
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
macro(POCO_HEADERS_AUTO out)
|
||||
foreach(f ${ARGN})
|
||||
get_filename_component(fname ${f} NAME)
|
||||
|
||||
# Read the package name from the source file
|
||||
file(STRINGS ${f} package REGEX "// Package: (.*)")
|
||||
if(package)
|
||||
string(REGEX REPLACE ".*: (.*)" "\\1" name ${package})
|
||||
#message(STATUS "Header: ${name} ${f}")
|
||||
POCO_HEADERS( ${out} ${name} ${f})
|
||||
else()
|
||||
#message(STATUS "Header: Unknown ${f}")
|
||||
POCO_HEADERS( ${out} Unknown ${f})
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
macro(POCO_HEADERS out name)
|
||||
set_source_files_properties(${ARGN} PROPERTIES HEADER_FILE_ONLY TRUE)
|
||||
source_group("${name}\\Header Files" FILES ${ARGN})
|
||||
list(APPEND ${out} ${ARGN})
|
||||
endmacro()
|
||||
|
||||
macro(POCO_MESSAGES out name)
|
||||
if(WIN32)
|
||||
foreach(msg ${ARGN})
|
||||
get_filename_component(msg_name ${msg} NAME)
|
||||
get_filename_component(msg_path ${msg} ABSOLUTE)
|
||||
string(REPLACE ".mc" ".h" hdr ${msg_name})
|
||||
set_source_files_properties(${hdr} PROPERTIES GENERATED TRUE)
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${hdr}
|
||||
DEPENDS ${msg}
|
||||
COMMAND ${CMAKE_MC_COMPILER}
|
||||
ARGS
|
||||
-h ${CMAKE_CURRENT_BINARY_DIR}
|
||||
-r ${CMAKE_CURRENT_BINARY_DIR}
|
||||
${msg_path}
|
||||
VERBATIM # recommended: p260
|
||||
)
|
||||
|
||||
# Add the generated file to the include directory
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
# Add the generated headers to POCO_HEADERS of the component
|
||||
POCO_HEADERS( ${out} ${name} ${CMAKE_CURRENT_BINARY_DIR}/${hdr})
|
||||
|
||||
endforeach()
|
||||
|
||||
set_source_files_properties(${ARGN} PROPERTIES HEADER_FILE_ONLY TRUE)
|
||||
source_group("${name}\\Message Files" FILES ${ARGN})
|
||||
list(APPEND ${out} ${ARGN})
|
||||
|
||||
endif(WIN32)
|
||||
endmacro()
|
||||
|
||||
#===============================================================================
|
||||
# Macros for Package generation
|
||||
#
|
||||
# POCO_GENERATE_PACKAGE - Generates *Config.cmake
|
||||
# Usage: POCO_GENERATE_PACKAGE(target_name)
|
||||
# INPUT:
|
||||
# target_name the name of the target. e.g. Foundation for PocoFoundation
|
||||
# Example: POCO_GENERATE_PACKAGE(Foundation)
|
||||
macro(POCO_GENERATE_PACKAGE target_name)
|
||||
include(CMakePackageConfigHelpers)
|
||||
write_basic_package_version_file(
|
||||
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}${target_name}ConfigVersion.cmake"
|
||||
VERSION ${PROJECT_VERSION}
|
||||
COMPATIBILITY AnyNewerVersion
|
||||
)
|
||||
if("${CMAKE_VERSION}" VERSION_LESS "3.0.0")
|
||||
if(NOT EXISTS "${CMAKE_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}${target_name}Targets.cmake")
|
||||
export(TARGETS "${target_name}" APPEND
|
||||
FILE "${CMAKE_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}${target_name}Targets.cmake"
|
||||
NAMESPACE "${PROJECT_NAME}::"
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
export(EXPORT "${target_name}Targets"
|
||||
FILE "${CMAKE_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}${target_name}Targets.cmake"
|
||||
NAMESPACE "${PROJECT_NAME}::"
|
||||
)
|
||||
endif()
|
||||
configure_file("cmake/Poco${target_name}Config.cmake"
|
||||
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}${target_name}Config.cmake"
|
||||
@ONLY
|
||||
)
|
||||
|
||||
# Set config script install location in a location that find_package() will
|
||||
# look for, which is different on MS Windows than for UNIX
|
||||
# Note: also set in root CMakeLists.txt
|
||||
if(WIN32)
|
||||
set(PocoConfigPackageLocation "cmake")
|
||||
else()
|
||||
set(PocoConfigPackageLocation "lib${LIB_SUFFIX}/cmake/${PROJECT_NAME}")
|
||||
endif()
|
||||
|
||||
install(
|
||||
EXPORT "${target_name}Targets"
|
||||
FILE "${PROJECT_NAME}${target_name}Targets.cmake"
|
||||
NAMESPACE "${PROJECT_NAME}::"
|
||||
DESTINATION "${PocoConfigPackageLocation}"
|
||||
)
|
||||
|
||||
install(
|
||||
FILES
|
||||
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}${target_name}Config.cmake"
|
||||
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}${target_name}ConfigVersion.cmake"
|
||||
DESTINATION "${PocoConfigPackageLocation}"
|
||||
COMPONENT Devel
|
||||
)
|
||||
|
||||
endmacro()
|
||||
|
||||
#===============================================================================
|
||||
# Macros for simplified installation
|
||||
#
|
||||
# POCO_INSTALL - Install the given target
|
||||
# Usage: POCO_INSTALL(target_name)
|
||||
# INPUT:
|
||||
# target_name the name of the target. e.g. Foundation for PocoFoundation
|
||||
# Example: POCO_INSTALL(Foundation)
|
||||
macro(POCO_INSTALL target_name)
|
||||
install(
|
||||
DIRECTORY include/Poco
|
||||
DESTINATION include
|
||||
COMPONENT Devel
|
||||
PATTERN ".svn" EXCLUDE
|
||||
)
|
||||
|
||||
install(
|
||||
TARGETS "${target_name}" EXPORT "${target_name}Targets"
|
||||
LIBRARY DESTINATION lib${LIB_SUFFIX}
|
||||
ARCHIVE DESTINATION lib${LIB_SUFFIX}
|
||||
RUNTIME DESTINATION bin
|
||||
INCLUDES DESTINATION include
|
||||
)
|
||||
|
||||
if(MSVC)
|
||||
# install the targets pdb
|
||||
POCO_INSTALL_PDB(${target_name})
|
||||
endif()
|
||||
|
||||
endmacro()
|
||||
|
||||
# POCO_INSTALL_PDB - Install the given target's companion pdb file (if present)
|
||||
# Usage: POCO_INSTALL_PDB(target_name)
|
||||
# INPUT:
|
||||
# target_name the name of the target. e.g. Foundation for PocoFoundation
|
||||
# Example: POCO_INSTALL_PDB(Foundation)
|
||||
#
|
||||
# This is an internal macro meant only to be used by POCO_INSTALL.
|
||||
macro(POCO_INSTALL_PDB target_name)
|
||||
get_property(type TARGET ${target_name} PROPERTY TYPE)
|
||||
if("${type}" STREQUAL "SHARED_LIBRARY" OR "${type}" STREQUAL "EXECUTABLE")
|
||||
install(
|
||||
FILES $<TARGET_PDB_FILE:${target_name}>
|
||||
DESTINATION bin
|
||||
COMPONENT Devel
|
||||
OPTIONAL
|
||||
)
|
||||
endif()
|
||||
endmacro()
|
36
vendor/POCO/cmake/README
vendored
Normal file
36
vendor/POCO/cmake/README
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
CMAKE Files contributed by Andrew J. P. Maclean <a.maclean@optusnet.com.au>
|
||||
|
||||
|
||||
Put the following files in the directory where your source code is:
|
||||
CMakeLists.txt
|
||||
PocoConfig.cmake.
|
||||
|
||||
Edit CMakeLists.txt to include your source and header files. The sections of interest are:
|
||||
# Add any source files here.
|
||||
SET( EXE_SRCS
|
||||
"My File.cpp"
|
||||
)
|
||||
# Add any include files here.
|
||||
SET( EXE_INCS
|
||||
"My File.h"
|
||||
)
|
||||
|
||||
Then create a subdirectory called build.
|
||||
In Linux:
|
||||
cd build
|
||||
ccmake ..
|
||||
or
|
||||
ccmake -GKDevelop3 ..
|
||||
(This will set up everything so you can use KDevelop3).
|
||||
|
||||
In Windows:
|
||||
run CMakeSetup.exe and set the source code directory and where to build the libraries.
|
||||
|
||||
If CMake cannot find Poco, you will see that the variable Poco_INCLUDE_DIR has the value Poco_INCLUDE_DIR-NOTFOUND. Just set this value to the top level direcotry of where the Poco includes are.
|
||||
|
||||
If there is a different version of Poco, you may have to add edit the variables SUFFIX_FOR_INCLUDE_PATH, and SUFFIX_FOR_LIBRARY_PATH adding in the new Poco version in a similar manner to the existing ones in the file PocoConfig.cmake.
|
||||
|
||||
Finally:
|
||||
In Linux
|
||||
Either type "make" or if you are using KDevelop, click on the <ProjectName>.kdevelop file.
|
||||
In Windows just use your IDE or nmake if you use nmake.
|
79
vendor/POCO/cmake/UseEmbeddedOpenSSL.cmake
vendored
Normal file
79
vendor/POCO/cmake/UseEmbeddedOpenSSL.cmake
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
|
||||
macro(copy_shared_ossl_lib path)
|
||||
if(NOT EXISTS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||
endif()
|
||||
file(GLOB OSSL_LIB_LIST LIST_DIRECTORIES false "${path}/*")
|
||||
foreach(OSSL_LIB_FILE ${OSSL_LIB_LIST})
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${OSSL_LIB_FILE} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||
if(POCO_VERBOSE_MESSAGES)
|
||||
message(STATUS "Copying embedded OpenSSL library from ${OSSL_LIB_FILE} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
macro(copy_static_ossl_lib path)
|
||||
if(NOT EXISTS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
|
||||
endif()
|
||||
file(GLOB OSSL_LIB_LIST LIST_DIRECTORIES false "${path}/*")
|
||||
foreach(OSSL_LIB_FILE ${OSSL_LIB_LIST})
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${OSSL_LIB_FILE} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
|
||||
if(POCO_VERBOSE_MESSAGES)
|
||||
message(STATUS "Copying embedded OpenSSL library from ${OSSL_LIB_FILE} to ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/openssl/build")
|
||||
message(STATUS "Use internal OpenSSL binaries but ${PROJECT_SOURCE_DIR}/openssl/build doesn't exists. Try to checkout ...")
|
||||
find_package(Git REQUIRED)
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive --remote openssl
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
RESULT_VARIABLE EXITCODE)
|
||||
if(NOT "${EXITCODE}" STREQUAL "0")
|
||||
message(FATAL_ERROR "Checkout ${PROJECT_SOURCE_DIR}/openssl FAILED!")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if( "${CMAKE_SIZEOF_VOID_P}" STREQUAL "8" )
|
||||
set(_OPENSSL_MSVC_ARCH_SUFFIX "64")
|
||||
else()
|
||||
set(_OPENSSL_MSVC_ARCH_SUFFIX "32")
|
||||
endif()
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
option(OPENSSL_MSVC_STATIC_RT "Set ON to choose the MT version of the openssl lib" OFF)
|
||||
option(OPENSSL_USE_STATIC_LIBS "Set ON to look for static openssl libraries" OFF)
|
||||
else()
|
||||
option(OPENSSL_MSVC_STATIC_RT "Set ON to choose the MT version of the openssl lib" ON)
|
||||
option(OPENSSL_USE_STATIC_LIBS "Set ON to look for static openssl libraries" ON)
|
||||
endif()
|
||||
|
||||
set(OPENSSL_ROOT_DIR "${PROJECT_SOURCE_DIR}/openssl/build")
|
||||
|
||||
if(OPENSSL_USE_STATIC_LIBS)
|
||||
if(POCO_VERBOSE_MESSAGES)
|
||||
message(STATUS "Use internal OpenSSL static binaries from ${OPENSSL_ROOT_DIR}/win${_OPENSSL_MSVC_ARCH_SUFFIX}/lib")
|
||||
endif()
|
||||
list(APPEND CMAKE_LIBRARY_PATH
|
||||
"${OPENSSL_ROOT_DIR}/win${_OPENSSL_MSVC_ARCH_SUFFIX}/lib/debug"
|
||||
"${OPENSSL_ROOT_DIR}/win${_OPENSSL_MSVC_ARCH_SUFFIX}/lib/release")
|
||||
copy_static_ossl_lib("${OPENSSL_ROOT_DIR}/win${_OPENSSL_MSVC_ARCH_SUFFIX}/lib/debug")
|
||||
copy_static_ossl_lib("${OPENSSL_ROOT_DIR}/win${_OPENSSL_MSVC_ARCH_SUFFIX}/lib/release")
|
||||
else()
|
||||
if(POCO_VERBOSE_MESSAGES)
|
||||
message(STATUS "Use internal OpenSSL shared binaries from ${OPENSSL_ROOT_DIR}/win${_OPENSSL_MSVC_ARCH_SUFFIX}/bin")
|
||||
endif()
|
||||
list(APPEND CMAKE_LIBRARY_PATH
|
||||
"${OPENSSL_ROOT_DIR}/win${_OPENSSL_MSVC_ARCH_SUFFIX}/bin/debug"
|
||||
"${OPENSSL_ROOT_DIR}/win${_OPENSSL_MSVC_ARCH_SUFFIX}/bin/release")
|
||||
copy_shared_ossl_lib("${OPENSSL_ROOT_DIR}/win${_OPENSSL_MSVC_ARCH_SUFFIX}/bin/debug")
|
||||
copy_shared_ossl_lib("${OPENSSL_ROOT_DIR}/win${_OPENSSL_MSVC_ARCH_SUFFIX}/bin/release")
|
||||
foreach(_OSSL_PATH "${OPENSSL_ROOT_DIR}/win${_OPENSSL_MSVC_ARCH_SUFFIX}/bin/debug" "${OPENSSL_ROOT_DIR}/win${_OPENSSL_MSVC_ARCH_SUFFIX}/bin/release")
|
||||
string(REPLACE "/" "\\" _OSSL_WIN_PATH ${_OSSL_PATH})
|
||||
string(APPEND OPENSSL_PATH ${_OSSL_WIN_PATH} "\;")
|
||||
endforeach()
|
||||
set(INTERNAL_OPENSSL_PATH "PATH=%PATH%\;${OPENSSL_PATH}")
|
||||
endif()
|
66
vendor/POCO/cmake/V313/FindSQLite3.cmake
vendored
Normal file
66
vendor/POCO/cmake/V313/FindSQLite3.cmake
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
FindSQLite3
|
||||
-----------
|
||||
|
||||
Find the SQLite libraries, v3
|
||||
|
||||
IMPORTED targets
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
This module defines the following :prop_tgt:`IMPORTED` target:
|
||||
|
||||
``SQLite::SQLite3``
|
||||
|
||||
Result variables
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
This module will set the following variables if found:
|
||||
|
||||
``SQLite3_INCLUDE_DIRS``
|
||||
where to find sqlite3.h, etc.
|
||||
``SQLite3_LIBRARIES``
|
||||
the libraries to link against to use SQLite3.
|
||||
``SQLite3_VERSION``
|
||||
version of the SQLite3 library found
|
||||
``SQLite3_FOUND``
|
||||
TRUE if found
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
# Look for the necessary header
|
||||
find_path(SQLite3_INCLUDE_DIR NAMES sqlite3.h)
|
||||
mark_as_advanced(SQLite3_INCLUDE_DIR)
|
||||
|
||||
# Look for the necessary library
|
||||
find_library(SQLite3_LIBRARY NAMES sqlite3 sqlite)
|
||||
mark_as_advanced(SQLite3_LIBRARY)
|
||||
|
||||
# Extract version information from the header file
|
||||
if(SQLite3_INCLUDE_DIR)
|
||||
file(STRINGS ${SQLite3_INCLUDE_DIR}/sqlite3.h _ver_line
|
||||
REGEX "^#define SQLITE_VERSION *\"[0-9]+\\.[0-9]+\\.[0-9]+\""
|
||||
LIMIT_COUNT 1)
|
||||
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+"
|
||||
SQLite3_VERSION "${_ver_line}")
|
||||
unset(_ver_line)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(SQLite3
|
||||
REQUIRED_VARS SQLite3_INCLUDE_DIR SQLite3_LIBRARY
|
||||
VERSION_VAR SQLite3_VERSION)
|
||||
|
||||
# Create the imported target
|
||||
if(SQLite3_FOUND)
|
||||
set(SQLite3_INCLUDE_DIRS ${SQLite3_INCLUDE_DIR})
|
||||
set(SQLite3_LIBRARIES ${SQLite3_LIBRARY})
|
||||
if(NOT TARGET SQLite::SQLite3)
|
||||
add_library(SQLite::SQLite3 UNKNOWN IMPORTED)
|
||||
set_target_properties(SQLite::SQLite3 PROPERTIES
|
||||
IMPORTED_LOCATION "${SQLite3_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${SQLite3_INCLUDE_DIR}")
|
||||
endif()
|
||||
endif()
|
463
vendor/POCO/cmake/V33/FindOpenSSL.cmake
vendored
Normal file
463
vendor/POCO/cmake/V33/FindOpenSSL.cmake
vendored
Normal file
@ -0,0 +1,463 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#.rst:
|
||||
# FindOpenSSL
|
||||
# -----------
|
||||
#
|
||||
# Find the OpenSSL encryption library.
|
||||
#
|
||||
# Imported Targets
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# This module defines the following :prop_tgt:`IMPORTED` targets:
|
||||
#
|
||||
# ``OpenSSL::SSL``
|
||||
# The OpenSSL ``ssl`` library, if found.
|
||||
# ``OpenSSL::Crypto``
|
||||
# The OpenSSL ``crypto`` library, if found.
|
||||
#
|
||||
# Result Variables
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# This module will set the following variables in your project:
|
||||
#
|
||||
# ``OPENSSL_FOUND``
|
||||
# System has the OpenSSL library.
|
||||
# ``OPENSSL_INCLUDE_DIR``
|
||||
# The OpenSSL include directory.
|
||||
# ``OPENSSL_CRYPTO_LIBRARY``
|
||||
# The OpenSSL crypto library.
|
||||
# ``OPENSSL_SSL_LIBRARY``
|
||||
# The OpenSSL SSL library.
|
||||
# ``OPENSSL_LIBRARIES``
|
||||
# All OpenSSL libraries.
|
||||
# ``OPENSSL_VERSION``
|
||||
# This is set to ``$major.$minor.$revision$patch`` (e.g. ``0.9.8s``).
|
||||
#
|
||||
# Hints
|
||||
# ^^^^^
|
||||
#
|
||||
# Set ``OPENSSL_ROOT_DIR`` to the root directory of an OpenSSL installation.
|
||||
# Set ``OPENSSL_USE_STATIC_LIBS`` to ``TRUE`` to look for static libraries.
|
||||
# Set ``OPENSSL_MSVC_STATIC_RT`` set ``TRUE`` to choose the MT version of the lib.
|
||||
|
||||
if (UNIX)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(_OPENSSL QUIET openssl)
|
||||
endif ()
|
||||
|
||||
# Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES
|
||||
if(OPENSSL_USE_STATIC_LIBS)
|
||||
set(_openssl_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
if(WIN32)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
else()
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES .a )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
# http://www.slproweb.com/products/Win32OpenSSL.html
|
||||
set(_OPENSSL_ROOT_HINTS
|
||||
${OPENSSL_ROOT_DIR}
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;Inno Setup: App Path]"
|
||||
ENV OPENSSL_ROOT_DIR
|
||||
)
|
||||
file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles)
|
||||
set(_OPENSSL_ROOT_PATHS
|
||||
"${_programfiles}/OpenSSL"
|
||||
"${_programfiles}/OpenSSL-Win32"
|
||||
"${_programfiles}/OpenSSL-Win64"
|
||||
"C:/OpenSSL/"
|
||||
"C:/OpenSSL-Win32/"
|
||||
"C:/OpenSSL-Win64/"
|
||||
)
|
||||
unset(_programfiles)
|
||||
else ()
|
||||
set(_OPENSSL_ROOT_HINTS
|
||||
${OPENSSL_ROOT_DIR}
|
||||
ENV OPENSSL_ROOT_DIR
|
||||
)
|
||||
endif ()
|
||||
|
||||
set(_OPENSSL_ROOT_HINTS_AND_PATHS
|
||||
HINTS ${_OPENSSL_ROOT_HINTS}
|
||||
PATHS ${_OPENSSL_ROOT_PATHS}
|
||||
)
|
||||
|
||||
find_path(OPENSSL_INCLUDE_DIR
|
||||
NAMES
|
||||
openssl/ssl.h
|
||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
||||
HINTS
|
||||
${_OPENSSL_INCLUDEDIR}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
)
|
||||
|
||||
if(WIN32 AND NOT CYGWIN)
|
||||
if(MSVC)
|
||||
# /MD and /MDd are the standard values - if someone wants to use
|
||||
# others, the libnames have to change here too
|
||||
# use also ssl and ssleay32 in debug as fallback for openssl < 0.9.8b
|
||||
# enable OPENSSL_MSVC_STATIC_RT to get the libs build /MT (Multithreaded no-DLL)
|
||||
# In Visual C++ naming convention each of these four kinds of Windows libraries has it's standard suffix:
|
||||
# * MD for dynamic-release
|
||||
# * MDd for dynamic-debug
|
||||
# * MT for static-release
|
||||
# * MTd for static-debug
|
||||
|
||||
# Implementation details:
|
||||
# We are using the libraries located in the VC subdir instead of the parent directory eventhough :
|
||||
# libeay32MD.lib is identical to ../libeay32.lib, and
|
||||
# ssleay32MD.lib is identical to ../ssleay32.lib
|
||||
# enable OPENSSL_USE_STATIC_LIBS to use the static libs located in lib/VC/static
|
||||
|
||||
if (OPENSSL_MSVC_STATIC_RT)
|
||||
set(_OPENSSL_MSVC_RT_MODE "MT")
|
||||
else ()
|
||||
set(_OPENSSL_MSVC_RT_MODE "MD")
|
||||
endif ()
|
||||
|
||||
# Since OpenSSL 1.1, lib names are like libcrypto32MTd.lib and libssl32MTd.lib
|
||||
if( "${CMAKE_SIZEOF_VOID_P}" STREQUAL "8" )
|
||||
set(_OPENSSL_MSVC_ARCH_SUFFIX "64")
|
||||
else()
|
||||
set(_OPENSSL_MSVC_ARCH_SUFFIX "32")
|
||||
endif()
|
||||
|
||||
if(OPENSSL_USE_STATIC_LIBS)
|
||||
set(_OPENSSL_PATH_SUFFIXES
|
||||
"lib/VC/static"
|
||||
"VC/static"
|
||||
"lib"
|
||||
)
|
||||
else()
|
||||
set(_OPENSSL_PATH_SUFFIXES
|
||||
"lib/VC"
|
||||
"VC"
|
||||
"lib"
|
||||
)
|
||||
endif ()
|
||||
|
||||
find_library(LIB_EAY_DEBUG
|
||||
NAMES
|
||||
libcrypto${_OPENSSL_MSVC_ARCH_SUFFIX}${_OPENSSL_MSVC_RT_MODE}d
|
||||
libcrypto${_OPENSSL_MSVC_RT_MODE}d
|
||||
libcryptod
|
||||
libeay32${_OPENSSL_MSVC_RT_MODE}d
|
||||
libeay32d
|
||||
NAMES_PER_DIR
|
||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
||||
PATH_SUFFIXES
|
||||
${_OPENSSL_PATH_SUFFIXES}
|
||||
)
|
||||
|
||||
find_library(LIB_EAY_RELEASE
|
||||
NAMES
|
||||
libcrypto${_OPENSSL_MSVC_ARCH_SUFFIX}${_OPENSSL_MSVC_RT_MODE}
|
||||
libcrypto${_OPENSSL_MSVC_RT_MODE}
|
||||
libcrypto
|
||||
libeay32${_OPENSSL_MSVC_RT_MODE}
|
||||
libeay32
|
||||
crypto
|
||||
NAMES_PER_DIR
|
||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
||||
PATH_SUFFIXES
|
||||
${_OPENSSL_PATH_SUFFIXES}
|
||||
)
|
||||
|
||||
find_library(SSL_EAY_DEBUG
|
||||
NAMES
|
||||
libssl${_OPENSSL_MSVC_ARCH_SUFFIX}${_OPENSSL_MSVC_RT_MODE}d
|
||||
libssl${_OPENSSL_MSVC_RT_MODE}d
|
||||
libssld
|
||||
ssleay32${_OPENSSL_MSVC_RT_MODE}d
|
||||
ssleay32d
|
||||
NAMES_PER_DIR
|
||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
||||
PATH_SUFFIXES
|
||||
${_OPENSSL_PATH_SUFFIXES}
|
||||
)
|
||||
|
||||
find_library(SSL_EAY_RELEASE
|
||||
NAMES
|
||||
libssl${_OPENSSL_MSVC_ARCH_SUFFIX}${_OPENSSL_MSVC_RT_MODE}
|
||||
libssl${_OPENSSL_MSVC_RT_MODE}
|
||||
libssl
|
||||
ssleay32${_OPENSSL_MSVC_RT_MODE}
|
||||
ssleay32
|
||||
ssl
|
||||
NAMES_PER_DIR
|
||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
||||
PATH_SUFFIXES
|
||||
${_OPENSSL_PATH_SUFFIXES}
|
||||
)
|
||||
|
||||
set(LIB_EAY_LIBRARY_DEBUG "${LIB_EAY_DEBUG}")
|
||||
set(LIB_EAY_LIBRARY_RELEASE "${LIB_EAY_RELEASE}")
|
||||
set(SSL_EAY_LIBRARY_DEBUG "${SSL_EAY_DEBUG}")
|
||||
set(SSL_EAY_LIBRARY_RELEASE "${SSL_EAY_RELEASE}")
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
|
||||
select_library_configurations(LIB_EAY)
|
||||
select_library_configurations(SSL_EAY)
|
||||
|
||||
mark_as_advanced(LIB_EAY_LIBRARY_DEBUG LIB_EAY_LIBRARY_RELEASE
|
||||
SSL_EAY_LIBRARY_DEBUG SSL_EAY_LIBRARY_RELEASE)
|
||||
set(OPENSSL_SSL_LIBRARY ${SSL_EAY_LIBRARY} )
|
||||
set(OPENSSL_CRYPTO_LIBRARY ${LIB_EAY_LIBRARY} )
|
||||
elseif(MINGW)
|
||||
# same player, for MinGW
|
||||
set(LIB_EAY_NAMES crypto libeay32)
|
||||
set(SSL_EAY_NAMES ssl ssleay32)
|
||||
find_library(LIB_EAY
|
||||
NAMES
|
||||
${LIB_EAY_NAMES}
|
||||
NAMES_PER_DIR
|
||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
||||
PATH_SUFFIXES
|
||||
"lib/MinGW"
|
||||
"lib"
|
||||
)
|
||||
|
||||
find_library(SSL_EAY
|
||||
NAMES
|
||||
${SSL_EAY_NAMES}
|
||||
NAMES_PER_DIR
|
||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
||||
PATH_SUFFIXES
|
||||
"lib/MinGW"
|
||||
"lib"
|
||||
)
|
||||
|
||||
mark_as_advanced(SSL_EAY LIB_EAY)
|
||||
set(OPENSSL_SSL_LIBRARY ${SSL_EAY} )
|
||||
set(OPENSSL_CRYPTO_LIBRARY ${LIB_EAY} )
|
||||
unset(LIB_EAY_NAMES)
|
||||
unset(SSL_EAY_NAMES)
|
||||
else()
|
||||
# Not sure what to pick for -say- intel, let's use the toplevel ones and hope someone report issues:
|
||||
find_library(LIB_EAY
|
||||
NAMES
|
||||
libcrypto
|
||||
libeay32
|
||||
NAMES_PER_DIR
|
||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
||||
HINTS
|
||||
${_OPENSSL_LIBDIR}
|
||||
PATH_SUFFIXES
|
||||
lib
|
||||
)
|
||||
|
||||
find_library(SSL_EAY
|
||||
NAMES
|
||||
libssl
|
||||
ssleay32
|
||||
NAMES_PER_DIR
|
||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
||||
HINTS
|
||||
${_OPENSSL_LIBDIR}
|
||||
PATH_SUFFIXES
|
||||
lib
|
||||
)
|
||||
|
||||
mark_as_advanced(SSL_EAY LIB_EAY)
|
||||
set(OPENSSL_SSL_LIBRARY ${SSL_EAY} )
|
||||
set(OPENSSL_CRYPTO_LIBRARY ${LIB_EAY} )
|
||||
endif()
|
||||
else()
|
||||
|
||||
find_library(OPENSSL_SSL_LIBRARY
|
||||
NAMES
|
||||
ssl
|
||||
ssleay32
|
||||
ssleay32MD
|
||||
NAMES_PER_DIR
|
||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
||||
HINTS
|
||||
${_OPENSSL_LIBDIR}
|
||||
PATH_SUFFIXES
|
||||
lib
|
||||
)
|
||||
|
||||
find_library(OPENSSL_CRYPTO_LIBRARY
|
||||
NAMES
|
||||
crypto
|
||||
NAMES_PER_DIR
|
||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
||||
HINTS
|
||||
${_OPENSSL_LIBDIR}
|
||||
PATH_SUFFIXES
|
||||
lib
|
||||
)
|
||||
|
||||
mark_as_advanced(OPENSSL_CRYPTO_LIBRARY OPENSSL_SSL_LIBRARY)
|
||||
|
||||
# compat defines
|
||||
set(OPENSSL_SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY})
|
||||
set(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})
|
||||
|
||||
endif()
|
||||
|
||||
function(from_hex HEX DEC)
|
||||
string(TOUPPER "${HEX}" HEX)
|
||||
set(_res 0)
|
||||
string(LENGTH "${HEX}" _strlen)
|
||||
|
||||
while (_strlen GREATER 0)
|
||||
math(EXPR _res "${_res} * 16")
|
||||
string(SUBSTRING "${HEX}" 0 1 NIBBLE)
|
||||
string(SUBSTRING "${HEX}" 1 -1 HEX)
|
||||
if (NIBBLE STREQUAL "A")
|
||||
math(EXPR _res "${_res} + 10")
|
||||
elseif (NIBBLE STREQUAL "B")
|
||||
math(EXPR _res "${_res} + 11")
|
||||
elseif (NIBBLE STREQUAL "C")
|
||||
math(EXPR _res "${_res} + 12")
|
||||
elseif (NIBBLE STREQUAL "D")
|
||||
math(EXPR _res "${_res} + 13")
|
||||
elseif (NIBBLE STREQUAL "E")
|
||||
math(EXPR _res "${_res} + 14")
|
||||
elseif (NIBBLE STREQUAL "F")
|
||||
math(EXPR _res "${_res} + 15")
|
||||
else()
|
||||
math(EXPR _res "${_res} + ${NIBBLE}")
|
||||
endif()
|
||||
|
||||
string(LENGTH "${HEX}" _strlen)
|
||||
endwhile()
|
||||
|
||||
set(${DEC} ${_res} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h")
|
||||
file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str
|
||||
REGEX "^#[\t ]*define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*")
|
||||
|
||||
if(openssl_version_str)
|
||||
# The version number is encoded as 0xMNNFFPPS: major minor fix patch status
|
||||
# The status gives if this is a developer or prerelease and is ignored here.
|
||||
# Major, minor, and fix directly translate into the version numbers shown in
|
||||
# the string. The patch field translates to the single character suffix that
|
||||
# indicates the bug fix state, which 00 -> nothing, 01 -> a, 02 -> b and so
|
||||
# on.
|
||||
|
||||
string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F]).*$"
|
||||
"\\1;\\2;\\3;\\4;\\5" OPENSSL_VERSION_LIST "${openssl_version_str}")
|
||||
list(GET OPENSSL_VERSION_LIST 0 OPENSSL_VERSION_MAJOR)
|
||||
list(GET OPENSSL_VERSION_LIST 1 OPENSSL_VERSION_MINOR)
|
||||
from_hex("${OPENSSL_VERSION_MINOR}" OPENSSL_VERSION_MINOR)
|
||||
list(GET OPENSSL_VERSION_LIST 2 OPENSSL_VERSION_FIX)
|
||||
from_hex("${OPENSSL_VERSION_FIX}" OPENSSL_VERSION_FIX)
|
||||
list(GET OPENSSL_VERSION_LIST 3 OPENSSL_VERSION_PATCH)
|
||||
|
||||
if (NOT OPENSSL_VERSION_PATCH STREQUAL "00")
|
||||
from_hex("${OPENSSL_VERSION_PATCH}" _tmp)
|
||||
# 96 is the ASCII code of 'a' minus 1
|
||||
math(EXPR OPENSSL_VERSION_PATCH_ASCII "${_tmp} + 96")
|
||||
unset(_tmp)
|
||||
# Once anyone knows how OpenSSL would call the patch versions beyond 'z'
|
||||
# this should be updated to handle that, too. This has not happened yet
|
||||
# so it is simply ignored here for now.
|
||||
string(ASCII "${OPENSSL_VERSION_PATCH_ASCII}" OPENSSL_VERSION_PATCH_STRING)
|
||||
endif ()
|
||||
|
||||
set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_FIX}${OPENSSL_VERSION_PATCH_STRING}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} )
|
||||
|
||||
if (OPENSSL_VERSION)
|
||||
find_package_handle_standard_args(OpenSSL
|
||||
REQUIRED_VARS
|
||||
#OPENSSL_SSL_LIBRARY # FIXME: require based on a component request?
|
||||
OPENSSL_CRYPTO_LIBRARY
|
||||
OPENSSL_INCLUDE_DIR
|
||||
VERSION_VAR
|
||||
OPENSSL_VERSION
|
||||
FAIL_MESSAGE
|
||||
"Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
|
||||
)
|
||||
else ()
|
||||
find_package_handle_standard_args(OpenSSL "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
|
||||
#OPENSSL_SSL_LIBRARY # FIXME: require based on a component request?
|
||||
OPENSSL_CRYPTO_LIBRARY
|
||||
OPENSSL_INCLUDE_DIR
|
||||
)
|
||||
endif ()
|
||||
|
||||
mark_as_advanced(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES)
|
||||
|
||||
if(OPENSSL_FOUND)
|
||||
if(NOT TARGET OpenSSL::Crypto AND
|
||||
(EXISTS "${OPENSSL_CRYPTO_LIBRARY}" OR
|
||||
EXISTS "${LIB_EAY_LIBRARY_DEBUG}" OR
|
||||
EXISTS "${LIB_EAY_LIBRARY_RELEASE}")
|
||||
)
|
||||
add_library(OpenSSL::Crypto UNKNOWN IMPORTED)
|
||||
set_target_properties(OpenSSL::Crypto PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${OPENSSL_INCLUDE_DIR}")
|
||||
if(EXISTS "${OPENSSL_CRYPTO_LIBRARY}")
|
||||
set_target_properties(OpenSSL::Crypto PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
||||
IMPORTED_LOCATION "${OPENSSL_CRYPTO_LIBRARY}")
|
||||
endif()
|
||||
if(EXISTS "${LIB_EAY_LIBRARY_RELEASE}")
|
||||
set_property(TARGET OpenSSL::Crypto APPEND PROPERTY
|
||||
IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_target_properties(OpenSSL::Crypto PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
|
||||
IMPORTED_LOCATION_RELEASE "${LIB_EAY_LIBRARY_RELEASE}")
|
||||
endif()
|
||||
if(EXISTS "${LIB_EAY_LIBRARY_DEBUG}")
|
||||
set_property(TARGET OpenSSL::Crypto APPEND PROPERTY
|
||||
IMPORTED_CONFIGURATIONS DEBUG)
|
||||
set_target_properties(OpenSSL::Crypto PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C"
|
||||
IMPORTED_LOCATION_DEBUG "${LIB_EAY_LIBRARY_DEBUG}")
|
||||
endif()
|
||||
endif()
|
||||
if(NOT TARGET OpenSSL::SSL AND
|
||||
(EXISTS "${OPENSSL_SSL_LIBRARY}" OR
|
||||
EXISTS "${SSL_EAY_LIBRARY_DEBUG}" OR
|
||||
EXISTS "${SSL_EAY_LIBRARY_RELEASE}")
|
||||
)
|
||||
add_library(OpenSSL::SSL UNKNOWN IMPORTED)
|
||||
set_target_properties(OpenSSL::SSL PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${OPENSSL_INCLUDE_DIR}")
|
||||
if(EXISTS "${OPENSSL_SSL_LIBRARY}")
|
||||
set_target_properties(OpenSSL::SSL PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
||||
IMPORTED_LOCATION "${OPENSSL_SSL_LIBRARY}")
|
||||
endif()
|
||||
if(EXISTS "${SSL_EAY_LIBRARY_RELEASE}")
|
||||
set_property(TARGET OpenSSL::SSL APPEND PROPERTY
|
||||
IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_target_properties(OpenSSL::SSL PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
|
||||
IMPORTED_LOCATION_RELEASE "${SSL_EAY_LIBRARY_RELEASE}")
|
||||
endif()
|
||||
if(EXISTS "${SSL_EAY_LIBRARY_DEBUG}")
|
||||
set_property(TARGET OpenSSL::SSL APPEND PROPERTY
|
||||
IMPORTED_CONFIGURATIONS DEBUG)
|
||||
set_target_properties(OpenSSL::SSL PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C"
|
||||
IMPORTED_LOCATION_DEBUG "${SSL_EAY_LIBRARY_DEBUG}")
|
||||
endif()
|
||||
if(TARGET OpenSSL::Crypto)
|
||||
set_target_properties(OpenSSL::SSL PROPERTIES
|
||||
INTERFACE_LINK_LIBRARIES OpenSSL::Crypto)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Restore the original find library ordering
|
||||
if(OPENSSL_USE_STATIC_LIBS)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_openssl_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
endif()
|
79
vendor/POCO/cmake/V39/FindEXPAT.cmake
vendored
Normal file
79
vendor/POCO/cmake/V39/FindEXPAT.cmake
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#.rst:
|
||||
# FindEXPAT
|
||||
# ---------
|
||||
#
|
||||
# Find the native Expat headers and library.
|
||||
#
|
||||
# Imported Targets
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# This module defines the following :prop_tgt:`IMPORTED` targets:
|
||||
#
|
||||
# ``EXPAT::EXPAT``
|
||||
# The Expat ``expat`` library, if found.
|
||||
#
|
||||
# Result Variables
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# This module will set the following variables in your project:
|
||||
#
|
||||
# ``EXPAT_INCLUDE_DIRS``
|
||||
# where to find expat.h, etc.
|
||||
# ``EXPAT_LIBRARIES``
|
||||
# the libraries to link against to use Expat.
|
||||
# ``EXPAT_FOUND``
|
||||
# true if the Expat headers and libraries were found.
|
||||
#
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
|
||||
pkg_check_modules(PC_EXPAT QUIET expat)
|
||||
|
||||
# Look for the header file.
|
||||
find_path(EXPAT_INCLUDE_DIR NAMES expat.h HINTS ${PC_EXPAT_INCLUDE_DIRS})
|
||||
|
||||
# Look for the library.
|
||||
find_library(EXPAT_LIBRARY NAMES expat libexpat HINTS ${PC_EXPAT_LIBRARY_DIRS})
|
||||
|
||||
if (EXPAT_INCLUDE_DIR AND EXISTS "${EXPAT_INCLUDE_DIR}/expat.h")
|
||||
file(STRINGS "${EXPAT_INCLUDE_DIR}/expat.h" expat_version_str
|
||||
REGEX "^#[\t ]*define[\t ]+XML_(MAJOR|MINOR|MICRO)_VERSION[\t ]+[0-9]+$")
|
||||
|
||||
unset(EXPAT_VERSION_STRING)
|
||||
foreach(VPART MAJOR MINOR MICRO)
|
||||
foreach(VLINE ${expat_version_str})
|
||||
if(VLINE MATCHES "^#[\t ]*define[\t ]+XML_${VPART}_VERSION[\t ]+([0-9]+)$")
|
||||
set(EXPAT_VERSION_PART "${CMAKE_MATCH_1}")
|
||||
if(EXPAT_VERSION_STRING)
|
||||
string(APPEND EXPAT_VERSION_STRING ".${EXPAT_VERSION_PART}")
|
||||
else()
|
||||
set(EXPAT_VERSION_STRING "${EXPAT_VERSION_PART}")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
endif ()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(EXPAT
|
||||
REQUIRED_VARS EXPAT_LIBRARY EXPAT_INCLUDE_DIR
|
||||
VERSION_VAR EXPAT_VERSION_STRING)
|
||||
|
||||
# Copy the results to the output variables and target.
|
||||
if(EXPAT_FOUND)
|
||||
set(EXPAT_LIBRARIES ${EXPAT_LIBRARY})
|
||||
set(EXPAT_INCLUDE_DIRS ${EXPAT_INCLUDE_DIR})
|
||||
|
||||
if(NOT TARGET EXPAT::EXPAT)
|
||||
add_library(EXPAT::EXPAT UNKNOWN IMPORTED)
|
||||
set_target_properties(EXPAT::EXPAT PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
||||
IMPORTED_LOCATION "${EXPAT_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${EXPAT_INCLUDE_DIRS}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
mark_as_advanced(EXPAT_INCLUDE_DIR EXPAT_LIBRARY)
|
9
vendor/POCO/cmake/test_compiler.cpp
vendored
Normal file
9
vendor/POCO/cmake/test_compiler.cpp
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::string str = "Try to compile";
|
||||
std::cout << str << '\n';
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user