mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-08-08 00:51:47 +02:00
Update libraries and make it build on windows.
Still gets some warnings because compilers have changed. But should work.
This commit is contained in:
176
vendor/POCO/CMakeLists.txt
vendored
176
vendor/POCO/CMakeLists.txt
vendored
@@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 3.5.0)
|
||||
cmake_minimum_required(VERSION 3.15.0)
|
||||
|
||||
project(Poco)
|
||||
|
||||
@@ -16,42 +16,36 @@ set(RELEASE_NAME "Unstable-trunk")
|
||||
# top of the build tree rather than in hard-to-find leaf
|
||||
# directories. This simplifies manual testing and the use of the build
|
||||
# tree rather than installed Boost libraries.
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib CACHE PATH "Library output")
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib CACHE PATH "Archive output")
|
||||
# Windows DLLs are "runtime" for CMake. Output them to "bin" like the Visual Studio projects do.
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin CACHE PATH "Runtime output")
|
||||
|
||||
# Reset output dirs for multi-config builds
|
||||
foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
|
||||
string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/bin)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/lib)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/lib)
|
||||
string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/bin CACHE PATH "Runtime output for ${OUTPUTCONFIG}")
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/lib CACHE PATH "Library output for ${OUTPUTCONFIG}")
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/lib CACHE PATH "Archive output for ${OUTPUTCONFIG}")
|
||||
endforeach(OUTPUTCONFIG)
|
||||
|
||||
# Append our module directory to CMake
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS "3.10")
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/V39)
|
||||
endif()
|
||||
if(CMAKE_VERSION VERSION_LESS "3.14")
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/V313)
|
||||
endif()
|
||||
#################################################################################
|
||||
# Setup C/C++ compiler options
|
||||
#################################################################################
|
||||
|
||||
# C++11/14 compiler flags
|
||||
# C++17 compiler flags
|
||||
include(CXX1x)
|
||||
check_for_cxx14_compiler(CXX14_COMPILER)
|
||||
check_for_cxx17_compiler(CXX17_COMPILER)
|
||||
|
||||
# If a C++14 compiler is available, then set the appropriate flags
|
||||
if(CXX14_COMPILER)
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
# If a C++17 compiler is available, then set the appropriate flags
|
||||
if(CXX17_COMPILER)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
else()
|
||||
message(FATAL_ERROR "Compiler does not support C++14.")
|
||||
message(FATAL_ERROR "Compiler does not support C++17.")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
@@ -64,37 +58,25 @@ include(GNUInstallDirs)
|
||||
# Include some common macros to simpilfy the Poco CMake files
|
||||
include(PocoMacros)
|
||||
|
||||
if(POCO_STATIC)
|
||||
message(WARNING "POCO_STATIC has been deprecated. Please use BUILD_SHARED_LIBS=NO to build static libraries.")
|
||||
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
|
||||
else()
|
||||
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
|
||||
endif()
|
||||
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
|
||||
|
||||
set(POCO_SANITIZEFLAGS CACHE STRING "Compiler-dependent sanitizer flags (like -fsanitize=address or /fsanitize=address")
|
||||
|
||||
if(MSVC)
|
||||
option(POCO_MT "Set to OFF|ON (default is OFF) to control build of POCO as /MT instead of /MD" OFF)
|
||||
option(POCO_MT "Set to OFF|ON (default is OFF) to control static build of POCO as /MT instead of /MD" OFF)
|
||||
|
||||
if(BUILD_SHARED_LIBS AND POCO_MT)
|
||||
message(FATAL_ERROR "Cannot have both BUILD_SHARED_LIBS and POCO_MT")
|
||||
endif()
|
||||
|
||||
# allow disabling of internally built OpenSSL# (see below for details)
|
||||
# if POCO pre-built OpenSSL directory is found, and POCO_DISABLE_INTERNAL_OPENSSL=OFF,
|
||||
# the internal OpenSSL build will be used
|
||||
option(POCO_DISABLE_INTERNAL_OPENSSL "Disable internal OpensSSL binaries use" ON)
|
||||
|
||||
if((NOT POCO_DISABLE_INTERNAL_OPENSSL) AND (ENABLE_NETSSL OR ENABLE_CRYPTO OR (ENABLE_DATA_MYSQL AND MINGW)))
|
||||
include(UseEmbeddedOpenSSL)
|
||||
endif()
|
||||
|
||||
if(POCO_SANITIZE_ASAN)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fsanitize=address")
|
||||
endif()
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus")
|
||||
endif()
|
||||
|
||||
option(ENABLE_NETSSL_WIN "Enable NetSSL Windows" OFF)
|
||||
option(FORCE_OPENSSL "Force usage of OpenSSL even under windows" OFF)
|
||||
|
||||
#
|
||||
# Path to OpenSSL installation root can be provided by setting a variable
|
||||
# OPENSSL_ROOT_DIR.
|
||||
#
|
||||
|
||||
if(ENABLE_CRYPTO OR ENABLE_NETSSL OR ENABLE_JWT)
|
||||
find_package(OpenSSL REQUIRED)
|
||||
@@ -166,13 +148,15 @@ endif()
|
||||
if(ODBC_FOUND)
|
||||
option(ENABLE_DATA "Enable Data" ON)
|
||||
option(ENABLE_DATA_ODBC "Enable Data ODBC" ON)
|
||||
option(ENABLE_DATA_SQL_SERVER_BIG_STRINGS "Enable MS SQL Server big strings" ON)
|
||||
else()
|
||||
option(ENABLE_DATA "Enable Data" OFF)
|
||||
option(ENABLE_DATA_ODBC "Enable Data ODBC" OFF)
|
||||
option(ENABLE_DATA_SQL_SERVER_BIG_STRINGS "Enable MS SQL Server big strings" OFF)
|
||||
endif()
|
||||
|
||||
# Allow enabling and disabling components
|
||||
option(ENABLE_FOUNDATION "Enable Foundation, required by all components except CppUnit" ON)
|
||||
option(ENABLE_FOUNDATION "Enable Foundation" ON)
|
||||
option(ENABLE_ENCODINGS "Enable Encodings" ON)
|
||||
option(ENABLE_ENCODINGS_COMPILER "Enable Encodings Compiler" OFF)
|
||||
option(ENABLE_XML "Enable XML" ON)
|
||||
@@ -180,6 +164,12 @@ option(ENABLE_JSON "Enable JSON" ON)
|
||||
option(ENABLE_MONGODB "Enable MongoDB" ON)
|
||||
option(ENABLE_DATA_SQLITE "Enable Data SQlite" ON)
|
||||
option(ENABLE_REDIS "Enable Redis" ON)
|
||||
option(ENABLE_DNSSD "Enable DNSSD" OFF)
|
||||
option(ENABLE_DNSSD_DEFAULT "Enable DNSSD Default" OFF)
|
||||
|
||||
option(ENABLE_DNSSD_AVAHI "Enable DNSSD Avahi" OFF)
|
||||
option(ENABLE_DNSSD_BONJOUR "Enable DNSSD Bonjour" OFF)
|
||||
|
||||
option(ENABLE_PROMETHEUS "Enable Prometheus" ON)
|
||||
option(ENABLE_PDF "Enable PDF" OFF)
|
||||
option(ENABLE_UTIL "Enable Util" ON)
|
||||
@@ -195,12 +185,30 @@ option(ENABLE_PAGECOMPILER_FILE2PAGE "Enable File2Page" ON)
|
||||
option(ENABLE_ACTIVERECORD "Enable ActiveRecord" ON)
|
||||
option(ENABLE_ACTIVERECORD_COMPILER "Enable ActiveRecord Compiler" ON)
|
||||
|
||||
option(ENABLE_TRACE "Enable stack tracing" OFF)
|
||||
|
||||
if(ENABLE_ACTIVERECORD AND NOT ENABLE_DATA)
|
||||
set(ENABLE_DATA ON CACHE BOOL "Enable Data" FORCE)
|
||||
set(ENABLE_DATA ON CACHE BOOL "Enable Data" FORCE)
|
||||
endif()
|
||||
|
||||
if(ENABLE_ACTIVERECORD AND NOT ENABLE_XML)
|
||||
set(ENABLE_XML ON CACHE BOOL "Enable XML" FORCE)
|
||||
endif()
|
||||
|
||||
option(ENABLE_TESTS
|
||||
"Set to OFF|ON (default is OFF) to control build of POCO tests & samples" OFF)
|
||||
"Set to OFF|ON (default is OFF) to control build of POCO tests" OFF)
|
||||
|
||||
option(ENABLE_TEST_DEPRECATED
|
||||
"Set to OFF|ON (default is OFF) to enable build of tests for deprecated functionality" OFF)
|
||||
|
||||
option(ENABLE_COMPILER_WARNINGS
|
||||
"Set to OFF|ON (default is OFF) to enable additional compiler warnings. Intended primarily for maintainers." OFF)
|
||||
|
||||
option(ENABLE_SAMPLES
|
||||
"Set to OFF|ON (default is OFF) to control build of POCO samples" OFF)
|
||||
|
||||
option(ENABLE_FUZZING
|
||||
"Set to OFF|ON (default is OFF) to control build of fuzzing targets for oss-fuzz (Clang compiler is required)" OFF)
|
||||
|
||||
option(POCO_UNBUNDLED
|
||||
"Set to OFF|ON (default is OFF) to control linking dependencies as external" OFF)
|
||||
@@ -208,25 +216,52 @@ option(POCO_UNBUNDLED
|
||||
if(ENABLE_TESTS)
|
||||
include(CTest)
|
||||
enable_testing()
|
||||
message(STATUS "Building with unittests & samples")
|
||||
message(STATUS "Building with unit tests")
|
||||
if(ENABLE_TEST_DEPRECATED)
|
||||
add_compile_definitions(POCO_TEST_DEPRECATED)
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "Building without tests & samples")
|
||||
message(STATUS "Building without unit tests")
|
||||
endif()
|
||||
|
||||
if(ENABLE_SAMPLES)
|
||||
message(STATUS "Building with samples")
|
||||
else()
|
||||
message(STATUS "Building without samples")
|
||||
endif()
|
||||
|
||||
if(ENABLE_FUZZING)
|
||||
if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
message(FATAL_ERROR "ENABLE_FUZZING flag requires using Clang compiler")
|
||||
else()
|
||||
message(STATUS "Building fuzzing test targets with engine $ENV{LIB_FUZZING_ENGINE}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(POCO_UNBUNDLED)
|
||||
message(STATUS "Using external sqlite, zlib, pcre2, expat, ...")
|
||||
message(STATUS "Using external sqlite, zlib, pcre2, expat, libpng, ...")
|
||||
else()
|
||||
message(STATUS "Using internal sqlite, zlib, pcre2, expat, ...")
|
||||
message(STATUS "Using internal sqlite, zlib, pcre2, expat, libpng, ...")
|
||||
endif()
|
||||
|
||||
# Disable fork exec
|
||||
option(POCO_NO_FORK_EXEC "Set to OFF|ON (default is OFF) to disable use of fork() and exec*() which are not allowed on some Apple platforms (iOS, watchOS, iPadOS, tvOS)." OFF)
|
||||
|
||||
if(POCO_NO_FORK_EXEC)
|
||||
add_definitions(-DPOCO_NO_FORK_EXEC=1)
|
||||
add_definitions(-DPOCO_NO_FORK_EXEC=1)
|
||||
endif()
|
||||
|
||||
include(DefinePlatformSpecifc)
|
||||
option(POCO_ENABLE_STD_MUTEX "Set to OFF|NO using mutex from standard library (default OFF)" OFF)
|
||||
|
||||
if (POCO_ENABLE_STD_MUTEX)
|
||||
add_compile_definitions(POCO_ENABLE_STD_MUTEX)
|
||||
endif ()
|
||||
|
||||
if(ENABLE_TRACE)
|
||||
add_compile_definitions(POCO_ENABLE_TRACE)
|
||||
endif()
|
||||
|
||||
include(DefinePlatformSpecific)
|
||||
|
||||
# Collect the built libraries and include dirs, the will be used to create the PocoConfig.cmake file
|
||||
set(Poco_COMPONENTS "")
|
||||
@@ -273,9 +308,6 @@ endif()
|
||||
|
||||
if(ENABLE_NETSSL_WIN)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
if(ENABLE_TESTS)
|
||||
set(ENABLE_CRYPTO ON CACHE BOOL "Enable Crypto" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ENABLE_NETSSL)
|
||||
@@ -303,6 +335,8 @@ if(ENABLE_POCODOC)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
set(ENABLE_XML ON CACHE BOOL "Enable XML" FORCE)
|
||||
set(ENABLE_CPPPARSER ON CACHE BOOL "Enable C++ parser" FORCE)
|
||||
set(ENABLE_DATA ON CACHE BOOL "Enable Data" FORCE)
|
||||
set(ENABLE_DATA_SQLITE ON CACHE BOOL "Enable Data SQLite" FORCE)
|
||||
endif()
|
||||
|
||||
if(ENABLE_UTIL AND ENABLE_TESTS)
|
||||
@@ -354,6 +388,11 @@ if(EXISTS ${PROJECT_SOURCE_DIR}/Redis AND ENABLE_REDIS)
|
||||
list(APPEND Poco_COMPONENTS "Redis")
|
||||
endif()
|
||||
|
||||
if(ENABLE_DNSSD)
|
||||
add_subdirectory(DNSSD)
|
||||
list(APPEND Poco_COMPONENTS "DNSSD")
|
||||
endif()
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/Prometheus AND ENABLE_PROMETHEUS)
|
||||
add_subdirectory(Prometheus)
|
||||
list(APPEND Poco_COMPONENTS "Prometheus")
|
||||
@@ -387,7 +426,13 @@ if(OPENSSL_FOUND)
|
||||
endif()
|
||||
endif(OPENSSL_FOUND)
|
||||
|
||||
|
||||
option(POCO_DATA_NO_SQL_PARSER "Disable SQL parser" OFF)
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/Data AND ENABLE_DATA)
|
||||
if(POCO_DATA_NO_SQL_PARSER)
|
||||
add_compile_definitions(POCO_DATA_NO_SQL_PARSER=1)
|
||||
endif()
|
||||
add_subdirectory(Data)
|
||||
list(APPEND Poco_COMPONENTS "Data")
|
||||
endif()
|
||||
@@ -400,8 +445,8 @@ if(EXISTS ${PROJECT_SOURCE_DIR}/Data/MySQL AND ENABLE_DATA_MYSQL)
|
||||
list(APPEND Poco_COMPONENTS "Data/MySQL")
|
||||
endif()
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/Data/PostgresSQL AND ENABLE_DATA_POSTGRESQL)
|
||||
list(APPEND Poco_COMPONENTS "Data/PostgresSQL")
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/Data/PostgreSQL AND ENABLE_DATA_POSTGRESQL)
|
||||
list(APPEND Poco_COMPONENTS "Data/PostgreSQL")
|
||||
endif()
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/ActiveRecord AND ENABLE_ACTIVERECORD)
|
||||
@@ -455,6 +500,11 @@ if(EXISTS ${PROJECT_SOURCE_DIR}/Encodings/Compiler AND ENABLE_ENCODINGS_COMPILER
|
||||
list(APPEND Poco_COMPONENTS "EncodingsCompiler")
|
||||
endif()
|
||||
|
||||
if(ENABLE_TRACE)
|
||||
add_subdirectory(Trace)
|
||||
list(APPEND Poco_COMPONENTS "Trace")
|
||||
endif()
|
||||
|
||||
|
||||
#############################################################
|
||||
# Uninstall stuff see: http://www.vtk.org/Wiki/CMake_FAQ
|
||||
@@ -512,15 +562,6 @@ install(
|
||||
Devel
|
||||
)
|
||||
|
||||
if(POCO_UNBUNDLED)
|
||||
install(FILES cmake/FindPCRE2.cmake
|
||||
DESTINATION "${PocoConfigPackageLocation}")
|
||||
install(FILES cmake/V39/FindEXPAT.cmake
|
||||
DESTINATION "${PocoConfigPackageLocation}/V39")
|
||||
install(FILES cmake/V313/FindSQLite3.cmake
|
||||
DESTINATION "${PocoConfigPackageLocation}/V313")
|
||||
endif()
|
||||
|
||||
message(STATUS "CMake ${CMAKE_VERSION} successfully configured ${PROJECT_NAME} using ${CMAKE_GENERATOR} generator")
|
||||
message(STATUS "${PROJECT_NAME} package version: ${PROJECT_VERSION}")
|
||||
if(BUILD_SHARED_LIBS)
|
||||
@@ -537,8 +578,9 @@ message(STATUS "[cmake] Build for OS version: ${CMAKE_SYSTEM_VERSION}")
|
||||
message(STATUS "[cmake] Build for CPU type: ${CMAKE_SYSTEM_PROCESSOR}")
|
||||
message(STATUS "[cmake] Build type: ${CMAKE_BUILD_TYPE}")
|
||||
string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE)
|
||||
message(STATUS "[cmake] Build with cxx flags: ${CMAKE_CXX_FLAGS_${BUILD_TYPE}} ${CMAKE_CXX_FLAGS}")
|
||||
message(STATUS "[cmake] Build with c flags: ${CMAKE_C_FLAGS_${BUILD_TYPE}} ${CMAKE_C_FLAGS}")
|
||||
message(STATUS "[cmake] Build with C++ flags: ${CMAKE_CXX_FLAGS_${BUILD_TYPE}} ${CMAKE_CXX_FLAGS}")
|
||||
message(STATUS "[cmake] Build with C flags: ${CMAKE_C_FLAGS_${BUILD_TYPE}} ${CMAKE_C_FLAGS}")
|
||||
message(STATUS "[cmake] C++ symbol visibility: ${CMAKE_CXX_VISIBILITY_PRESET}")
|
||||
|
||||
foreach(component ${Poco_COMPONENTS})
|
||||
message(STATUS "Building: ${component}")
|
||||
|
Reference in New Issue
Block a user