Cleanup cmake build system to use transitive dependency management from cmake (#2321)

* Some cleanup in the root CMakeLists.txt

* Cleanup cmake targets

* Add find openssl modul for older cmake version

* Set proper scope

* Change crypto default to off

* Fix openssl default to on

* Remove global setting of C99 standard

* Set from C11 to C99

* Fix for NetSSL win build

* Set C99 compile features

* Fix Windows build

* Fix windows build

* Cleanup poco unbundle definition

* Fix PDF build

* Remove unused set affinity

* Add _CRT_SECURE_NO_WARNINGS as target compile definitions

* Add _AFXDLL as target compile definitions

* Remove commented out line

* Refactor add_definitions to target_compile_definitons in Util

* Refactor add_definitions to target_compile_definitons in XML

* Remove THREADSAFE in data sql cmake build

* Refactor add_definitions to target_compile_definition in cmake mysql

* Refactor add_definitions to target_compile_definition in cmake odbc

* Refactor add_definitions to target_compile_definition in cmake sqlite

* Refactor add_definitions to target_compile_definitions in platform specific cmake

* Add _DEBUG as compile definition

* Add build dependencies between Foundation-testrunner and TestApp, TestLibrary in cmake build

* Use cmake property to build shared libs

* Cleanup POCO_NO_AUTOMATIC_LIBS. Set only for Windows in cmake build system

* cleanup LIB_MODE_DEFINITIONS in cmake buld system

* Add POCO_STATIC for CppUnit

* Cleanup target link libraries and add option dependencies.

* Add dependencies management in cmake

* Update cmake documentation

* Squashed commit of the following:

commit 38c233f93fc8e9ad6e24d686c905eb18c86e19a7

    Fix "invalid new-expression of abstract class type ApacheServerRequest" (#2231)

    - abstract method "bool secure() const" defined in HTTPServerRequest was implemented in ApacheServerRequest, one of its derived classes
     - a ap_log_error had one of its parameters changed for fixing a warning "passing NULL to non-pointer argument"
     - minor indentation problems corrected

commit 4cbdfbe828943871618172f9e042176f115d61d8

    Fix build dependencies

* Improve database cmake build dependencies

* Update doc

* Update doc

* Update cmake build commands

* Set public on target link libraries in cmake build system

* Fix PostgreSQL build

* Fix PostgreSQL build in cmake

* Fix PostgreSQL from SQL to Data

* Squashed commit of the following:

commit 1ba7d5dcbfb8d07860dd4efda33b31bedf6184c4

    Add missing cmake file

* Set path to PostgresSQL in AppVoyer

* Try to fix AppVeyor build

* show dir in appvoyer

* Disable PostgreSQL build on Appvoyer

* Refactor add_definitions to target_compile_definitions
This commit is contained in:
Joerg-Christian Boehme
2018-06-03 18:17:50 +02:00
committed by Aleksandar Fabijanic
parent 4542a15b86
commit 612f092235
128 changed files with 1693 additions and 1357 deletions

View File

@@ -131,6 +131,12 @@ int ApacheRequestRec::sendFile(const std::string& path, unsigned int fileSize, c
}
bool ApacheRequestRec::secure()
{
return DEFAULT_HTTPS_PORT == ap_default_port(_pRec) && ap_http_scheme(_pRec) == "https";
}
void ApacheRequestRec::copyHeaders(ApacheServerRequest& request)
{
const apr_array_header_t* arr = apr_table_elts(_pRec->headers_in);
@@ -149,7 +155,13 @@ void ApacheRequestRec::copyHeaders(ApacheServerRequest& request)
void ApacheConnector::log(const char* file, int line, int level, int status, const char *text)
{
ap_log_error(file, line, level, 0, NULL, "%s", text);
// ap_log_error() has undergone significant changes in Apache 2.4.
// Validate Apache version for using a proper ap_log_error() version.
#if AP_SERVER_MAJORVERSION_NUMBER == 2 && AP_SERVER_MINORVERSION_NUMBER < 4
ap_log_error(file, line, level, 0, NULL, "%s", text);
#else
ap_log_error(file, line, level, 0, 0, 0, text);
#endif
}
@@ -172,24 +184,33 @@ extern "C" int ApacheConnector_handler(request_rec *r)
if ((rv = ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK)))
return rv;
#ifndef POCO_ENABLE_CPP11
std::auto_ptr<ApacheServerRequest> pRequest(new ApacheServerRequest(
&rec,
r->connection->local_ip,
r->connection->local_addr->port,
r->connection->remote_ip,
r->connection->remote_addr->port));
std::auto_ptr<ApacheServerResponse> pResponse(new ApacheServerResponse(pRequest.get()));
// The properties conn_rec->remote_ip and conn_rec->remote_addr have undergone significant changes in Apache 2.4.
// Validate Apache version for using conn_rec->remote_ip and conn_rec->remote_addr proper versions.
#if AP_SERVER_MAJORVERSION_NUMBER == 2 && AP_SERVER_MINORVERSION_NUMBER < 4
const char* clientIp = r->connection->remote_ip;
apr_port_t clientPort = r->connection->remote_addr->port;
#else
std::unique_ptr<ApacheServerRequest> pRequest(new ApacheServerRequest(
&rec,
r->connection->local_ip,
r->connection->local_addr->port,
r->connection->remote_ip,
r->connection->remote_addr->port));
const char* clientIp = r->connection->client_ip;
apr_port_t clientPort = r->connection->client_addr->port;
#endif
#ifndef POCO_ENABLE_CPP11
std::auto_ptr<ApacheServerRequest> pRequest(new ApacheServerRequest(
&rec,
r->connection->local_ip,
r->connection->local_addr->port,
clientIp,
clientPort));
std::unique_ptr<ApacheServerResponse> pResponse(new ApacheServerResponse(pRequest.get()));
std::auto_ptr<ApacheServerResponse> pResponse(new ApacheServerResponse(pRequest.get()));
#else
std::unique_ptr<ApacheServerRequest> pRequest(new ApacheServerRequest(
&rec,
r->connection->local_ip,
r->connection->local_addr->port,
clientIp,
clientPort));
std::unique_ptr<ApacheServerResponse> pResponse(new ApacheServerResponse(pRequest.get()));
#endif // POCO_ENABLE_CPP11
// add header information to request

View File

@@ -35,7 +35,7 @@ ApacheServerRequest::~ApacheServerRequest()
delete _pStream;
}
const Poco::Net::HTTPServerParams& ApacheServerRequest::serverParams() const
{
throw Poco::NotImplementedException("No HTTPServerParams available in Apache modules.");
@@ -58,3 +58,9 @@ bool ApacheServerRequest::expectContinue() const
{
return false;
}
bool ApacheServerRequest::secure() const
{
return _pApacheRequest->secure();
}