mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-12 10:13:51 +01:00
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:
parent
4542a15b86
commit
612f092235
16
.travis.yml
16
.travis.yml
@ -10,7 +10,7 @@ before_install:
|
||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then tar -xzvf cmake-3.2.3-Linux-x86_64.tar.gz; fi
|
||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then export PATH=$PWD/cmake-3.2.3-Linux-x86_64/bin:$PATH; fi
|
||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update -qq; fi
|
||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq -y unixodbc-dev libmysqlclient-dev g++-arm-linux-gnueabi g++-arm-linux-gnueabihf clang-3.5 libc++-dev sloccount cppcheck; fi
|
||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq -y unixodbc-dev libmysqlclient-dev g++-arm-linux-gnueabi g++-arm-linux-gnueabihf clang-3.5 libc++-dev ninja-build sloccount cppcheck; fi
|
||||
|
||||
services:
|
||||
- mongodb
|
||||
@ -81,7 +81,7 @@ matrix:
|
||||
# See also in /usr/local/android-sdk/ndk-bundle/build/cmake/android.toolchain.cmake
|
||||
|
||||
# Using the ninja build command. Is much faster then make build command.
|
||||
- mkdir cmake-build && cd cmake-build && /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake -G'Android Gradle - Ninja' -DANDROID_ABI=armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/usr/local/android-sdk/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-19 -DCMAKE_MAKE_PROGRAM=/usr/local/android-sdk/cmake/3.6.4111459/bin/ninja -DANDROID_STL="c++_static" -DANDROID_CPP_FEATURES="exceptions rtti" -DENABLE_TESTS=ON -DENABLE_LONG_RUNNING_TESTS=OFF -DOLD_REDIS_VERSION=ON .. && /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake --build . --target all && travis_wait 30 /usr/local/android-sdk/cmake/3.6.4111459/bin/ctest -E Foundation --output-on-failure
|
||||
- /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake -H. -Bcmake-build -G'Android Gradle - Ninja' -DANDROID_ABI=armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/usr/local/android-sdk/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-19 -DCMAKE_MAKE_PROGRAM=/usr/local/android-sdk/cmake/3.6.4111459/bin/ninja -DANDROID_STL="c++_static" -DANDROID_CPP_FEATURES="exceptions rtti" -DENABLE_TESTS=ON -DENABLE_LONG_RUNNING_TESTS=OFF -DOLD_REDIS_VERSION=ON && /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake --build cmake-build --target all && cd cmake-build && travis_wait 30 /usr/local/android-sdk/cmake/3.6.4111459/bin/ctest -E Foundation --output-on-failure
|
||||
|
||||
- env: TEST_NAME="android API level 24"
|
||||
language: android
|
||||
@ -128,7 +128,7 @@ matrix:
|
||||
# See also in /usr/local/android-sdk/ndk-bundle/build/cmake/android.toolchain.cmake
|
||||
|
||||
# Using the ninja build command. Is much faster then make build command.
|
||||
- mkdir cmake-build && cd cmake-build && /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake -G'Android Gradle - Ninja' -DANDROID_ABI=armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/usr/local/android-sdk/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-24 -DCMAKE_MAKE_PROGRAM=/usr/local/android-sdk/cmake/3.6.4111459/bin/ninja -DANDROID_STL="c++_static" -DANDROID_CPP_FEATURES="exceptions rtti" -DENABLE_TESTS=ON -DENABLE_LONG_RUNNING_TESTS=OFF -DOLD_REDIS_VERSION=ON .. && /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake --build . --target all && travis_wait 30 /usr/local/android-sdk/cmake/3.6.4111459/bin/ctest -E Foundation --output-on-failure
|
||||
- /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake -H. -Bcmake-build -G'Android Gradle - Ninja' -DANDROID_ABI=armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/usr/local/android-sdk/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-24 -DCMAKE_MAKE_PROGRAM=/usr/local/android-sdk/cmake/3.6.4111459/bin/ninja -DANDROID_STL="c++_static" -DANDROID_CPP_FEATURES="exceptions rtti" -DENABLE_TESTS=ON -DENABLE_LONG_RUNNING_TESTS=OFF -DOLD_REDIS_VERSION=ON && /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake --build cmake-build --target all && cd cmake-build && travis_wait 30 /usr/local/android-sdk/cmake/3.6.4111459/bin/ctest -E Foundation --output-on-failure
|
||||
|
||||
- env: TEST_NAME="gcc (make)"
|
||||
compiler: gcc
|
||||
@ -150,7 +150,7 @@ matrix:
|
||||
compiler: gcc
|
||||
script:
|
||||
# disable tests, gcc-4.6 gets an internal compiler error
|
||||
- mkdir cmake-build && cd cmake-build && cmake -DENABLE_PDF=OFF -DENABLE_TESTS=OFF .. && make all -j2 && cd ..
|
||||
- cmake -H. -Bcmake-build -GNinja -DENABLE_PDF=OFF -DENABLE_TESTS=OFF && cmake --build cmake-build --target all
|
||||
|
||||
- env: TEST_NAME="gcc-4.8 (CMake)"
|
||||
compiler: gcc
|
||||
@ -160,24 +160,24 @@ matrix:
|
||||
- sudo apt-get install -qq -y g++-4.8
|
||||
- export CC="gcc-4.8"
|
||||
- export CXX="g++-4.8"
|
||||
- mkdir cmake-build && cd cmake-build && cmake -DENABLE_PDF=OFF -DENABLE_TESTS=ON .. && make all -j2 && cd ..
|
||||
- cmake -H. -Bcmake-build -GNinja -DENABLE_PDF=OFF -DENABLE_TESTS=ON && cmake --build cmake-build --target all
|
||||
|
||||
- env: TEST_NAME="clang (CMake)"
|
||||
compiler: clang
|
||||
script:
|
||||
- mkdir cmake-build && cd cmake-build && cmake -DENABLE_PDF=OFF -DENABLE_TESTS=ON .. && make all -j2 && cd ..
|
||||
- cmake -H. -Bcmake-build -GNinja -DENABLE_PDF=OFF -DENABLE_TESTS=ON && cmake --build cmake-build --target all
|
||||
|
||||
- env: TEST_NAME="arm-linux-gnueabi-g++ (CMake)"
|
||||
script:
|
||||
- export CC="arm-linux-gnueabi-gcc"
|
||||
- export CXX="arm-linux-gnueabi-g++"
|
||||
- mkdir cmake-build && cd cmake-build && cmake -DENABLE_PDF=OFF -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_TESTS=ON .. && make all -j2 && cd ..
|
||||
- cmake -H. -Bcmake-build -GNinja -DENABLE_PDF=OFF -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_TESTS=ON && cmake --build cmake-build --target all
|
||||
|
||||
- env: TEST_NAME="arm-linux-gnueabihf-g++ (CMake)"
|
||||
script:
|
||||
- export CC="arm-linux-gnueabihf-gcc"
|
||||
- export CXX="arm-linux-gnueabihf-g++"
|
||||
- mkdir cmake-build && cd cmake-build && cmake -DENABLE_PDF=OFF -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_TESTS=ON .. && make all -j2 && cd ..
|
||||
- cmake -H. -Bcmake-build -GNinja -DENABLE_PDF=OFF -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_TESTS=ON && cmake --build cmake-build --target all
|
||||
|
||||
# TODO osx build
|
||||
# TODO run test suite
|
||||
|
@ -1,5 +1,3 @@
|
||||
set(LIBNAME "mod_poco")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
@ -8,19 +6,19 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
file(GLOB_RECURSE HDRS_G "include/*.h" )
|
||||
POCO_HEADERS_AUTO( SRCS ${HDRS_G})
|
||||
|
||||
add_library( "${LIBNAME}" SHARED ${SRCS} )
|
||||
set_target_properties( "${LIBNAME}"
|
||||
add_library(mod_poco SHARED ${SRCS})
|
||||
set_target_properties(mod_poco
|
||||
PROPERTIES
|
||||
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
|
||||
DEFINE_SYMBOL ApacheHandlers_EXPORTS)
|
||||
target_link_libraries( "${LIBNAME}" )
|
||||
target_include_directories( "${LIBNAME}"
|
||||
target_include_directories(mod_poco
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
target_link_libraries(mod_poco PUBLIC Poco::Util Poco::Net)
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
add_subdirectory(samples)
|
||||
endif ()
|
||||
endif ()
|
||||
|
@ -48,14 +48,20 @@ public:
|
||||
|
||||
void sendErrorResponse(int status);
|
||||
/// Sends an error response with the given HTTP status code.
|
||||
|
||||
|
||||
int sendFile(const std::string& path, unsigned int fileSize, const std::string& mediaType);
|
||||
/// Sends the file given by fileName as response.
|
||||
|
||||
void copyHeaders(ApacheServerRequest& request);
|
||||
/// Copies the request uri and header fields from the Apache request
|
||||
/// to the ApacheServerRequest.
|
||||
|
||||
|
||||
bool secure();
|
||||
/// Returns true if the request is using a secure
|
||||
/// connection. Returns false if no secure connection
|
||||
/// is used, or if it is not known whether a secure
|
||||
/// connection is used.
|
||||
|
||||
private:
|
||||
request_rec* _pRec;
|
||||
};
|
||||
|
@ -58,6 +58,12 @@ public:
|
||||
Poco::Net::HTTPServerResponse& response() const;
|
||||
/// Returns a reference to the associated response
|
||||
|
||||
bool secure() const;
|
||||
/// Returns true if the request is using a secure
|
||||
/// connection. Returns false if no secure connection
|
||||
/// is used, or if it is not known whether a secure
|
||||
/// connection is used.
|
||||
|
||||
protected:
|
||||
void setResponse(ApacheServerResponse* pResponse);
|
||||
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "FormServer")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_library( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoNet PocoFoundation )
|
||||
add_library(FormServer src/FormServer.cpp)
|
||||
target_link_libraries(FormServer PUBLIC Poco::Net)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "TimeServer-apache")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_library( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoNet PocoFoundation )
|
||||
add_library(TimeServer-apache src/TimeServer.cpp)
|
||||
target_link_libraries(TimeServer-apache PUBLIC Poco::Net)
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
}
|
||||
|
321
CMakeLists.txt
321
CMakeLists.txt
@ -1,30 +1,18 @@
|
||||
# POCO_BUILD_TYPE
|
||||
# POCO_STATIC
|
||||
# POCO_UNBUNDLED
|
||||
# POCO_NO_LOCALE
|
||||
#
|
||||
# ENABLE_{COMPONENT}
|
||||
# ENABLE_TESTS
|
||||
|
||||
cmake_minimum_required(VERSION 3.2.0)
|
||||
|
||||
project(Poco)
|
||||
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
|
||||
file(STRINGS "${PROJECT_SOURCE_DIR}/libversion" SHARED_LIBRARY_VERSION)
|
||||
|
||||
# Read the version information from the VERSION file
|
||||
file(STRINGS "${PROJECT_SOURCE_DIR}/VERSION" PACKAGE_VERSION)
|
||||
message(STATUS "Poco package version: ${PACKAGE_VERSION}")
|
||||
file (STRINGS "${PROJECT_SOURCE_DIR}/VERSION" PACKAGE_VERSION )
|
||||
string(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" CPACK_PACKAGE_VERSION_MAJOR ${PACKAGE_VERSION})
|
||||
string(REGEX REPLACE "[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" CPACK_PACKAGE_VERSION_MINOR ${PACKAGE_VERSION})
|
||||
string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" CPACK_PACKAGE_VERSION_PATCH ${PACKAGE_VERSION})
|
||||
|
||||
set(COMPLETE_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
|
||||
set(PROJECT_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
|
||||
set(RELEASE_NAME "Unstable-trunk")
|
||||
set(PROJECT_VERSION ${COMPLETE_VERSION})
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
|
||||
message(STATUS "Poco package version: ${PROJECT_VERSION}")
|
||||
|
||||
# Put the libaries and binaries that get built into directories at the
|
||||
# top of the build tree rather than in hard-to-find leaf
|
||||
@ -36,14 +24,14 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
|
||||
# Append our module directory to CMake
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
|
||||
# COMMENT REPLACED BY BIICODE
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
|
||||
if(${CMAKE_VERSION} VERSION_LESS "3.4")
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/V33)
|
||||
endif()
|
||||
#################################################################################
|
||||
# Setup C/C++ compiler options
|
||||
#################################################################################
|
||||
|
||||
option(DISABLE_CPP11 "Disable C++11 if available" OFF)
|
||||
option(DISABLE_CPP14 "Disable C++14 if available" OFF)
|
||||
|
||||
@ -70,42 +58,99 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT MSVC_IDE)
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
|
||||
"Choose the type of build, options are: None Debug Release" FORCE)
|
||||
endif()
|
||||
message(STATUS "Setting Poco build type - ${CMAKE_BUILD_TYPE}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "")
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
|
||||
endif()
|
||||
message(STATUS "Setting Poco build type - ${CMAKE_BUILD_TYPE}")
|
||||
|
||||
# Include some common macros to simpilfy the Poco CMake files
|
||||
include(PocoMacros)
|
||||
|
||||
if(ENABLE_CRYPTO OR ENABLE_NETSSL)
|
||||
find_package(OpenSSL REQUIRED)
|
||||
else()
|
||||
find_package(OpenSSL)
|
||||
endif()
|
||||
|
||||
if(OPENSSL_FOUND)
|
||||
option(ENABLE_NETSSL "Enable NetSSL" ON)
|
||||
option(ENABLE_CRYPTO "Enable Crypto" ON)
|
||||
else()
|
||||
option(ENABLE_NETSSL "Enable NetSSL" OFF)
|
||||
option(ENABLE_CRYPTO "Enable Crypto" OFF)
|
||||
endif()
|
||||
|
||||
if(ENABLE_APACHECONNECTOR)
|
||||
find_package(APR REQUIRED)
|
||||
find_package(Apache2 REQUIRED)
|
||||
else()
|
||||
find_package(APR)
|
||||
find_package(Apache2)
|
||||
endif()
|
||||
|
||||
if(APRUTIL_FOUND AND APACHE_FOUND AND
|
||||
EXISTS ${PROJECT_SOURCE_DIR}/ApacheConnector AND ENABLE_APACHECONNECTOR)
|
||||
option(ENABLE_APACHECONNECTOR "Enable ApacheConnector" ON)
|
||||
else()
|
||||
option(ENABLE_APACHECONNECTOR "Enable ApacheConnector" OFF)
|
||||
endif()
|
||||
|
||||
if(ENABLE_DATA_MYSQL)
|
||||
find_package(MySQL REQUIRED)
|
||||
else()
|
||||
find_package(MySQL)
|
||||
endif()
|
||||
|
||||
if(MYSQL_FOUND)
|
||||
option(ENABLE_DATA "Enable Data" ON)
|
||||
option(ENABLE_DATA_MYSQL "Enable Data MySQL" ON)
|
||||
else()
|
||||
option(ENABLE_DATA "Enable Data" OFF)
|
||||
option(ENABLE_DATA_MYSQL "Enable Data MySQL" OFF)
|
||||
endif()
|
||||
|
||||
if(ENABLE_DATA_POSTGRESQL)
|
||||
find_package(PostgreSQL REQUIRED)
|
||||
else()
|
||||
find_package(PostgreSQL QUIET)
|
||||
endif()
|
||||
|
||||
if(POSTGRESQL_FOUND)
|
||||
option(ENABLE_DATA "Enable SQL" ON)
|
||||
option(ENABLE_DATA_POSTGRESQL "Enable SQL PosgreSQL" ON)
|
||||
else()
|
||||
option(ENABLE_DATA "Enable SQL" OFF)
|
||||
option(ENABLE_DATA_POSTGRESQL "Enable SQL PosgreSQL" OFF)
|
||||
endif()
|
||||
|
||||
if(ENABLE_DATA_ODBC)
|
||||
find_package(ODBC REQUIRED)
|
||||
else()
|
||||
find_package(ODBC)
|
||||
endif()
|
||||
|
||||
if(ODBC_FOUND)
|
||||
option(ENABLE_DATA "Enable Data" ON)
|
||||
option(ENABLE_DATA_ODBC "Enable Data ODBC" ON)
|
||||
else()
|
||||
option(ENABLE_DATA "Enable Data" OFF)
|
||||
option(ENABLE_DATA_ODBC "Enable Data ODBC" OFF)
|
||||
endif()
|
||||
|
||||
# Allow enabling and disabling components
|
||||
option(ENABLE_ENCODINGS "Enable Encodings" ON)
|
||||
option(ENABLE_ENCODINGS_COMPILER "Enable Encodings Compiler" OFF)
|
||||
option(ENABLE_XML "Enable XML" ON)
|
||||
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_PDF "Enable PDF" OFF)
|
||||
option(ENABLE_UTIL "Enable Util" ON)
|
||||
option(ENABLE_NET "Enable Net" ON)
|
||||
option(ENABLE_NETSSL "Enable NetSSL" ON)
|
||||
option(ENABLE_NETSSL_WIN "Enable NetSSL Windows" OFF)
|
||||
option(ENABLE_CRYPTO "Enable Crypto" ON)
|
||||
option(ENABLE_DATA "Enable Data" ON)
|
||||
option(ENABLE_DATA_SQLITE "Enable Data SQlite" ON)
|
||||
option(ENABLE_DATA_MYSQL "Enable Data MySQL" ON)
|
||||
option(ENABLE_DATA_POSTGRESQL "Enable Data PostgreSQL" ON)
|
||||
option(ENABLE_DATA_ODBC "Enable Data ODBC" ON)
|
||||
option(ENABLE_SEVENZIP "Enable SevenZip" OFF)
|
||||
option(ENABLE_ZIP "Enable Zip" ON)
|
||||
option(ENABLE_APACHECONNECTOR "Enable ApacheConnector" OFF)
|
||||
option(ENABLE_CPPPARSER "Enable C++ parser" OFF)
|
||||
option(ENABLE_POCODOC "Enable Poco Documentation Generator" OFF)
|
||||
option(ENABLE_PAGECOMPILER "Enable PageCompiler" ON)
|
||||
@ -118,6 +163,13 @@ option(ENABLE_TESTS
|
||||
|
||||
option(POCO_STATIC
|
||||
"Set to OFF|ON (default is OFF) to control build of POCO as STATIC library" OFF)
|
||||
if(POCO_STATIC)
|
||||
message(STATUS "Building static libraries")
|
||||
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
|
||||
else()
|
||||
message(STATUS "Building dynamic libraries")
|
||||
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
|
||||
endif()
|
||||
|
||||
option(POCO_UNBUNDLED
|
||||
"Set to OFF|ON (default is OFF) to control linking dependencies as external" OFF)
|
||||
@ -130,16 +182,6 @@ if(MSVC)
|
||||
"Set to OFF|ON (default is OFF) to control parallel build of POCO with MSVC" OFF)
|
||||
endif()
|
||||
|
||||
# Uncomment from next two lines to force static or dynamic library, default is autodetection
|
||||
if(POCO_STATIC)
|
||||
set(LIB_MODE_DEFINITIONS -DPOCO_STATIC -DPOCO_NO_AUTOMATIC_LIBS)
|
||||
set(LIB_MODE STATIC)
|
||||
message(STATUS "Building static libraries")
|
||||
else(POCO_STATIC)
|
||||
set(LIB_MODE SHARED)
|
||||
set(LIB_MODE_DEFINITIONS -DPOCO_NO_AUTOMATIC_LIBS)
|
||||
message(STATUS "Building dynamic libraries")
|
||||
endif(POCO_STATIC)
|
||||
|
||||
if(ENABLE_TESTS)
|
||||
option(ENABLE_LONG_RUNNING_TESTS "Enable long running test" ON)
|
||||
@ -151,7 +193,6 @@ else()
|
||||
endif()
|
||||
|
||||
if(POCO_UNBUNDLED)
|
||||
add_definitions(-DPOCO_UNBUNDLED)
|
||||
message(STATUS "Using external sqlite, zlib, pcre, expat, ...")
|
||||
else()
|
||||
message(STATUS "Using internal sqlite, zlib, pcre, expat, ...")
|
||||
@ -164,41 +205,127 @@ set(Poco_COMPONENTS "")
|
||||
|
||||
if(ENABLE_TESTS)
|
||||
add_subdirectory(CppUnit)
|
||||
set(ENABLE_XML ON CACHE BOOL "Enable XML" FORCE )
|
||||
set(ENABLE_JSON ON CACHE BOOL "Enable JSON" FORCE)
|
||||
|
||||
if(ENABLE_ZIP)
|
||||
set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ENABLE_ENCODINGS_COMPILER OR ENABLE_APACHECONNECTOR)
|
||||
set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
endif()
|
||||
|
||||
if(ENABLE_PAGECOMPILER_FILE2PAGE)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
endif()
|
||||
|
||||
if(ENABLE_PAGECOMPILER)
|
||||
set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
endif()
|
||||
|
||||
if(ENABLE_MONGODB OR ENABLE_REDIS)
|
||||
set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
|
||||
endif()
|
||||
|
||||
if(ENABLE_DATA_SQLITE OR ENABLE_DATA_MYSQL OR ENABLE_DATA_ODBC OR ENABLE_DATA_POSTGRESQL)
|
||||
set(ENABLE_DATA ON CACHE BOOL "Enable Data" FORCE)
|
||||
if(ENABLE_TESTS)
|
||||
set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
|
||||
set(ENABLE_DATA_SQLITE ON CACHE BOOL "Enable Data SQlite" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ENABLE_DATA AND ENABLE_TESTS)
|
||||
set(ENABLE_DATA_SQLITE ON CACHE BOOL "Enable Data SQlite" FORCE)
|
||||
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)
|
||||
set(ENABLE_CRYPTO ON CACHE BOOL "Enable Crypto" FORCE)
|
||||
set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
endif()
|
||||
|
||||
if(ENABLE_CRYPTO AND ENABLE_TESTS)
|
||||
set(ENABLE_NETSSL ON CACHE BOOL "Enable NetSSL" FORCE)
|
||||
set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
endif()
|
||||
|
||||
if(ENABLE_NET AND ENABLE_TESTS)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
endif()
|
||||
|
||||
if(ENABLE_PDF)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
set(ENABLE_XML ON CACHE BOOL "Enable XML" FORCE)
|
||||
endif()
|
||||
|
||||
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)
|
||||
endif()
|
||||
|
||||
if(ENABLE_SEVENZIP OR ENABLE_ZIP)
|
||||
set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
set(ENABLE_XML ON CACHE BOOL "Enable XML" FORCE)
|
||||
endif()
|
||||
|
||||
if(ENABLE_UTIL AND ENABLE_TESTS)
|
||||
set(ENABLE_JSON ON CACHE BOOL "Enable JSON" FORCE)
|
||||
set(ENABLE_XML ON CACHE BOOL "Enable XML" FORCE)
|
||||
endif()
|
||||
|
||||
add_subdirectory(Foundation)
|
||||
if(ENABLE_ENCODINGS)
|
||||
add_subdirectory(Encodings)
|
||||
list(APPEND Poco_COMPONENTS "Encodings")
|
||||
add_subdirectory(Encodings)
|
||||
list(APPEND Poco_COMPONENTS "Encodings")
|
||||
endif()
|
||||
|
||||
if(ENABLE_XML)
|
||||
add_subdirectory(XML)
|
||||
list(APPEND Poco_COMPONENTS "XML")
|
||||
add_subdirectory(XML)
|
||||
list(APPEND Poco_COMPONENTS "XML")
|
||||
endif()
|
||||
|
||||
if(ENABLE_JSON)
|
||||
add_subdirectory(JSON)
|
||||
list(APPEND Poco_COMPONENTS "JSON")
|
||||
add_subdirectory(JSON)
|
||||
list(APPEND Poco_COMPONENTS "JSON")
|
||||
endif()
|
||||
|
||||
if(ENABLE_UTIL)
|
||||
add_subdirectory(Util)
|
||||
list(APPEND Poco_COMPONENTS "Util")
|
||||
add_subdirectory(Util)
|
||||
list(APPEND Poco_COMPONENTS "Util")
|
||||
endif()
|
||||
|
||||
if(ENABLE_NET)
|
||||
add_subdirectory(Net)
|
||||
list(APPEND Poco_COMPONENTS "Net")
|
||||
add_subdirectory(Net)
|
||||
list(APPEND Poco_COMPONENTS "Net")
|
||||
endif()
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/MongoDB AND ENABLE_MONGODB)
|
||||
add_subdirectory(MongoDB)
|
||||
list(APPEND Poco_COMPONENTS "MongoDB")
|
||||
add_subdirectory(MongoDB)
|
||||
list(APPEND Poco_COMPONENTS "MongoDB")
|
||||
endif()
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/Redis AND ENABLE_REDIS)
|
||||
add_subdirectory(Redis)
|
||||
list(APPEND Poco_COMPONENTS "Redis")
|
||||
add_subdirectory(Redis)
|
||||
list(APPEND Poco_COMPONENTS "Redis")
|
||||
endif()
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/PDF AND ENABLE_PDF)
|
||||
add_subdirectory(PDF)
|
||||
list(APPEND Poco_COMPONENTS "PDF")
|
||||
add_subdirectory(PDF)
|
||||
list(APPEND Poco_COMPONENTS "PDF")
|
||||
endif()
|
||||
|
||||
|
||||
@ -210,65 +337,62 @@ if(WIN32 AND EXISTS ${PROJECT_SOURCE_DIR}/NetSSL_Win AND ENABLE_NETSSL_WIN)
|
||||
list(APPEND Poco_COMPONENTS "NetSSL_Win")
|
||||
endif(WIN32 AND EXISTS ${PROJECT_SOURCE_DIR}/NetSSL_Win AND ENABLE_NETSSL_WIN)
|
||||
|
||||
find_package(OpenSSL)
|
||||
if(OPENSSL_FOUND)
|
||||
include_directories("${OPENSSL_INCLUDE_DIR}")
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/NetSSL_OpenSSL AND ENABLE_NETSSL)
|
||||
add_subdirectory(NetSSL_OpenSSL)
|
||||
list(APPEND Poco_COMPONENTS "NetSSL_OpenSSL")
|
||||
add_subdirectory(NetSSL_OpenSSL)
|
||||
list(APPEND Poco_COMPONENTS "NetSSL_OpenSSL")
|
||||
endif()
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/Crypto AND ENABLE_CRYPTO)
|
||||
add_subdirectory(Crypto)
|
||||
list(APPEND Poco_COMPONENTS "Crypto")
|
||||
add_subdirectory(Crypto)
|
||||
list(APPEND Poco_COMPONENTS "Crypto")
|
||||
endif()
|
||||
endif(OPENSSL_FOUND)
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/Data AND ENABLE_DATA)
|
||||
add_subdirectory(Data)
|
||||
list(APPEND Poco_COMPONENTS "Data")
|
||||
endif()
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/SevenZip AND ENABLE_SEVENZIP)
|
||||
add_subdirectory(SevenZip)
|
||||
list(APPEND Poco_COMPONENTS "SevenZip")
|
||||
endif()
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/Zip AND ENABLE_ZIP)
|
||||
add_subdirectory(Zip)
|
||||
list(APPEND Poco_COMPONENTS "Zip")
|
||||
add_subdirectory(Data)
|
||||
list(APPEND Poco_COMPONENTS "Data")
|
||||
endif()
|
||||
|
||||
find_package(APR)
|
||||
find_package(Apache2)
|
||||
if(APRUTIL_FOUND AND APACHE_FOUND)
|
||||
include_directories( "${APACHE_INCLUDE_DIR}" "${APRUTIL_INCLUDE_DIR}" )
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/ApacheConnector AND ENABLE_APACHECONNECTOR)
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/SevenZip AND ENABLE_SEVENZIP)
|
||||
add_subdirectory(SevenZip)
|
||||
list(APPEND Poco_COMPONENTS "SevenZip")
|
||||
endif()
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/Zip AND ENABLE_ZIP)
|
||||
add_subdirectory(Zip)
|
||||
list(APPEND Poco_COMPONENTS "Zip")
|
||||
endif()
|
||||
|
||||
if(APRUTIL_FOUND AND APACHE_FOUND AND
|
||||
EXISTS ${PROJECT_SOURCE_DIR}/ApacheConnector AND ENABLE_APACHECONNECTOR)
|
||||
include_directories( "${APACHE_INCLUDE_DIR}" "${APRUTIL_INCLUDE_DIR}" ) # TODO(Bjoe) use target_include_directories or target_link_libraries
|
||||
add_subdirectory(ApacheConnector)
|
||||
list(APPEND Poco_COMPONENTS "ApacheConnector")
|
||||
endif()
|
||||
endif(APRUTIL_FOUND AND APACHE_FOUND)
|
||||
endif()
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/CppParser AND ENABLE_CPPPARSER)
|
||||
add_subdirectory(CppParser)
|
||||
list(APPEND Poco_COMPONENTS "CppParser")
|
||||
add_subdirectory(CppParser)
|
||||
list(APPEND Poco_COMPONENTS "CppParser")
|
||||
endif()
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/PocoDoc AND ENABLE_POCODOC)
|
||||
add_subdirectory(PocoDoc)
|
||||
list(APPEND Poco_COMPONENTS "PocoDoc")
|
||||
add_subdirectory(PocoDoc)
|
||||
list(APPEND Poco_COMPONENTS "PocoDoc")
|
||||
endif()
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/PageCompiler AND ENABLE_PAGECOMPILER)
|
||||
add_subdirectory(PageCompiler)
|
||||
list(APPEND Poco_COMPONENTS "PageCompiler")
|
||||
add_subdirectory(PageCompiler)
|
||||
list(APPEND Poco_COMPONENTS "PageCompiler")
|
||||
endif()
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/PageCompiler/File2Page AND ENABLE_PAGECOMPILER_FILE2PAGE)
|
||||
add_subdirectory(PageCompiler/File2Page)
|
||||
list(APPEND Poco_COMPONENTS "File2Page")
|
||||
add_subdirectory(PageCompiler/File2Page)
|
||||
list(APPEND Poco_COMPONENTS "File2Page")
|
||||
endif()
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/Encodings/Compiler AND ENABLE_ENCODINGS_COMPILER)
|
||||
add_subdirectory(Encodings/Compiler)
|
||||
list(APPEND Poco_COMPONENTS "EncodingsCompiler")
|
||||
add_subdirectory(Encodings/Compiler)
|
||||
list(APPEND Poco_COMPONENTS "EncodingsCompiler")
|
||||
endif()
|
||||
|
||||
|
||||
@ -337,6 +461,5 @@ message(STATUS "CMAKE_CXX_FLAGS_MINSIZEREL:=${CMAKE_CXX_FLAGS_MINSIZEREL}")
|
||||
message(STATUS "CMAKE_CXX_FLAGS_RELWITHDEBINFO:=${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
|
||||
|
||||
foreach(component ${Poco_COMPONENTS})
|
||||
message(STATUS "Building: ${component}")
|
||||
message(STATUS "Building: ${component}")
|
||||
endforeach()
|
||||
|
||||
|
@ -1,6 +1,3 @@
|
||||
set(LIBNAME "CppParser")
|
||||
set(POCO_LIBNAME "Poco${LIBNAME}")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
@ -9,26 +6,25 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
file(GLOB_RECURSE HDRS_G "include/*.h" )
|
||||
POCO_HEADERS_AUTO( SRCS ${HDRS_G})
|
||||
|
||||
add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} )
|
||||
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
|
||||
set_target_properties( "${LIBNAME}"
|
||||
add_library(CppParser ${SRCS})
|
||||
add_library(Poco::CppParser ALIAS CppParser)
|
||||
set_target_properties(CppParser
|
||||
PROPERTIES
|
||||
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
|
||||
OUTPUT_NAME ${POCO_LIBNAME}
|
||||
OUTPUT_NAME PocoCppParser
|
||||
DEFINE_SYMBOL CppParser_EXPORTS
|
||||
)
|
||||
|
||||
target_link_libraries( "${LIBNAME}" Foundation)
|
||||
target_include_directories( "${LIBNAME}"
|
||||
target_link_libraries(CppParser PUBLIC Poco::Foundation)
|
||||
target_include_directories(CppParser
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS})
|
||||
|
||||
POCO_INSTALL("${LIBNAME}")
|
||||
POCO_GENERATE_PACKAGE("${LIBNAME}")
|
||||
POCO_INSTALL(CppParser)
|
||||
POCO_GENERATE_PACKAGE(CppParser)
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
add_subdirectory(testsuite)
|
||||
|
@ -1,5 +1,3 @@
|
||||
set(TESTUNIT "${LIBNAME}-testrunner")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
|
||||
@ -12,11 +10,11 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF
|
||||
src/WinDriver.cpp
|
||||
)
|
||||
|
||||
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
||||
add_executable(CppParser-testrunner ${TEST_SRCS} )
|
||||
if(ANDROID)
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/${TESTUNIT} -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake)
|
||||
add_test(NAME CppParser WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/CppParser-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake)
|
||||
else()
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
|
||||
add_test(NAME CppParser WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND CppParser-testrunner -all)
|
||||
endif()
|
||||
target_link_libraries( ${TESTUNIT} PocoCppParser PocoFoundation CppUnit )
|
||||
target_link_libraries(CppParser-testrunner PUBLIC Poco::CppParser CppUnit)
|
||||
|
@ -1,10 +1,4 @@
|
||||
set(LIBNAME "CppUnit")
|
||||
|
||||
# Sources
|
||||
add_definitions(-DPOCO_NO_AUTOMATIC_LIBS)
|
||||
if (WIN32)
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
endif (WIN32)
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
|
||||
@ -12,16 +6,25 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
file(GLOB_RECURSE HDRS_G "include/*.h" )
|
||||
POCO_HEADERS_AUTO( SRCS ${HDRS_G})
|
||||
|
||||
add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} )
|
||||
set_target_properties( "${LIBNAME}"
|
||||
add_library(CppUnit ${SRCS})
|
||||
set_target_properties(CppUnit
|
||||
PROPERTIES
|
||||
VERSION "1" SOVERSION "1"
|
||||
DEFINE_SYMBOL CppUnit_EXPORTS)
|
||||
target_link_libraries( "${LIBNAME}" Foundation)
|
||||
target_include_directories( "${LIBNAME}"
|
||||
target_link_libraries(CppUnit Poco::Foundation)
|
||||
target_include_directories(CppUnit
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS})
|
||||
target_compile_definitions(CppUnit PUBLIC POCO_NO_AUTOMATIC_LIBS)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(CppUnit
|
||||
PUBLIC
|
||||
POCO_STATIC
|
||||
)
|
||||
endif()
|
||||
if (WIN32)
|
||||
target_compile_definitions(CppUnit PRIVATE _CRT_SECURE_NO_WARNINGS)
|
||||
endif (WIN32)
|
||||
|
@ -1,5 +1,3 @@
|
||||
set(LIBNAME "WinTestRunner")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( WIN_SRCS ${SRCS_G})
|
||||
@ -11,26 +9,28 @@ POCO_HEADERS_AUTO( WIN_SRCS ${HDRS_G})
|
||||
file(GLOB_RECURSE HDRS_G "src/*.h" )
|
||||
POCO_HEADERS_AUTO( WIN_SRCS ${HDRS_G})
|
||||
|
||||
# TODO: Is this flag always required?
|
||||
add_definitions("-D_AFXDLL")
|
||||
#TODO: Use instead of the flag above: find_package(MFC)
|
||||
|
||||
add_library( "${LIBNAME}" ${LIB_MODE} ${WIN_SRCS} )
|
||||
set_target_properties( "${LIBNAME}"
|
||||
add_library(WinTestRunner ${WIN_SRCS} )
|
||||
set_target_properties(WinTestRunner
|
||||
PROPERTIES
|
||||
VERSION "1" SOVERSION "1"
|
||||
DEFINE_SYMBOL WinTestRunner_EXPORTS)
|
||||
target_link_libraries( "${LIBNAME}" CppUnit )
|
||||
target_include_directories( "${LIBNAME}"
|
||||
target_link_libraries(WinTestRunner PUBLIC CppUnit)
|
||||
target_include_directories(WinTestRunner
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS})
|
||||
# TODO: Is this flag _AFXDLL always required?
|
||||
target_compile_definitions(WinTestRunner
|
||||
PRIVATE
|
||||
_AFXDLL
|
||||
)
|
||||
#TODO: Use instead of the flag _AFXDLL above: find_package(MFC)
|
||||
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries( ${LIBNAME} winmm )
|
||||
target_link_libraries(WinTestRunner PUBLIC winmm)
|
||||
endif(WIN32)
|
||||
|
||||
|
||||
|
@ -1,6 +1,3 @@
|
||||
set(LIBNAME "Crypto")
|
||||
set(POCO_LIBNAME "Poco${LIBNAME}")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
@ -9,28 +6,25 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
file(GLOB_RECURSE HDRS_G "include/*.h" )
|
||||
POCO_HEADERS_AUTO( SRCS ${HDRS_G})
|
||||
|
||||
#add_definitions(-D_USRDLL)
|
||||
|
||||
add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} )
|
||||
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
|
||||
set_target_properties( "${LIBNAME}"
|
||||
add_library(Crypto ${SRCS} )
|
||||
add_library(Poco::Crypto ALIAS Crypto)
|
||||
set_target_properties(Crypto
|
||||
PROPERTIES
|
||||
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
|
||||
OUTPUT_NAME ${POCO_LIBNAME}
|
||||
OUTPUT_NAME PocoCrypto
|
||||
DEFINE_SYMBOL Crypto_EXPORTS
|
||||
)
|
||||
|
||||
target_link_libraries( "${LIBNAME}" Foundation ${OPENSSL_LIBRARIES} )
|
||||
target_include_directories( "${LIBNAME}"
|
||||
target_link_libraries(Crypto PUBLIC Poco::Foundation OpenSSL::SSL OpenSSL::Crypto)
|
||||
target_include_directories(Crypto
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS})
|
||||
|
||||
POCO_INSTALL("${LIBNAME}")
|
||||
POCO_GENERATE_PACKAGE("${LIBNAME}")
|
||||
POCO_INSTALL(Crypto)
|
||||
POCO_GENERATE_PACKAGE(Crypto)
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
add_subdirectory(samples)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "genrsakey")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoCrypto PocoUtil PocoXML PocoFoundation )
|
||||
add_executable(genrsakey src/genrsakey.cpp)
|
||||
target_link_libraries(genrsakey PUBLIC Poco::Crypto Poco::Util Poco::XML)
|
||||
|
@ -1,5 +1,3 @@
|
||||
set(TESTUNIT "${LIBNAME}-testrunner")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
|
||||
@ -16,14 +14,14 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
|
||||
src/WinCEDriver.cpp
|
||||
)
|
||||
|
||||
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
||||
add_executable(Crypto-testrunner ${TEST_SRCS} )
|
||||
if(ANDROID)
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/${TESTUNIT} -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake)
|
||||
add_test(NAME Crypto WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/Crypto-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake)
|
||||
else()
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
|
||||
add_test(NAME Crypto WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND Crypto-testrunner -all)
|
||||
endif()
|
||||
target_link_libraries( ${TESTUNIT} PocoCrypto PocoNetSSL PocoXML PocoUtil PocoFoundation CppUnit )
|
||||
target_link_libraries(Crypto-testrunner PUBLIC Poco::NetSSL Poco::XML CppUnit)
|
||||
if(UNIX AND NOT ANDROID)
|
||||
target_link_libraries( ${TESTUNIT} pthread)
|
||||
target_link_libraries(Crypto-testrunner PUBLIC pthread)
|
||||
endif(UNIX AND NOT ANDROID)
|
||||
|
@ -1,6 +1,3 @@
|
||||
set(LIBNAME "Data")
|
||||
set(POCO_LIBNAME "Poco${LIBNAME}")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
@ -9,81 +6,69 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
file(GLOB_RECURSE HDRS_G "include/*.h" )
|
||||
POCO_HEADERS_AUTO( SRCS ${HDRS_G})
|
||||
|
||||
if (NOT POCO_STATIC)
|
||||
add_definitions(-DTHREADSAFE)
|
||||
endif (NOT POCO_STATIC)
|
||||
|
||||
if(MSVC AND NOT(MSVC_VERSION LESS 1400))
|
||||
set_source_files_properties(src/StatementImpl.cpp
|
||||
PROPERTIES COMPILE_FLAGS "/bigobj")
|
||||
endif()
|
||||
|
||||
add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} )
|
||||
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
|
||||
set_target_properties( "${LIBNAME}"
|
||||
|
||||
add_library(Data ${SRCS} )
|
||||
add_library(Poco::Data ALIAS Data)
|
||||
set_target_properties(Data
|
||||
PROPERTIES
|
||||
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
|
||||
OUTPUT_NAME ${POCO_LIBNAME}
|
||||
OUTPUT_NAME PocoData
|
||||
DEFINE_SYMBOL Data_EXPORTS
|
||||
)
|
||||
|
||||
target_link_libraries( "${LIBNAME}" Foundation)
|
||||
target_include_directories( "${LIBNAME}"
|
||||
target_link_libraries(Data PUBLIC Poco::Foundation)
|
||||
target_include_directories(Data
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS})
|
||||
|
||||
POCO_INSTALL("${LIBNAME}")
|
||||
POCO_GENERATE_PACKAGE("${LIBNAME}")
|
||||
POCO_INSTALL(Data)
|
||||
POCO_GENERATE_PACKAGE(Data)
|
||||
|
||||
if(ENABLE_DATA_SQLITE)
|
||||
# SQlite3 is built in any case
|
||||
message(STATUS "SQLite Support Enabled")
|
||||
add_subdirectory( SQLite )
|
||||
endif(ENABLE_DATA_SQLITE)
|
||||
else(ENABLE_DATA_SQLITE)
|
||||
message(STATUS "SQLite Support Disabled")
|
||||
endif()
|
||||
|
||||
if(ENABLE_DATA_MYSQL)
|
||||
find_package(MySQL)
|
||||
if(MYSQL_FOUND)
|
||||
include_directories("${MYSQL_INCLUDE_DIR}")
|
||||
message(STATUS "MySQL Support Enabled")
|
||||
add_subdirectory( MySQL )
|
||||
if(MYSQL_FOUND AND ENABLE_DATA_MYSQL)
|
||||
include_directories("${MYSQL_INCLUDE_DIR}") # TODO(Bjoe) use target_include_directories or target_link_libraries
|
||||
message(STATUS "MySQL Support Enabled")
|
||||
add_subdirectory( MySQL )
|
||||
else()
|
||||
message(STATUS "MySQL Support Disabled - no MySQL library")
|
||||
endif()
|
||||
|
||||
if(POSTGRESQL_FOUND AND ENABLE_DATA_POSTGRESQL)
|
||||
include_directories("${PostgreSQL_INCLUDE_DIR}") # TODO(Bjoe) Use target_link_libraries()
|
||||
message(STATUS "PostgreSQL Support Enabled")
|
||||
add_subdirectory( PostgreSQL )
|
||||
else()
|
||||
message(STATUS "PostgreSQL Support Disabled - no PostgreSQL library")
|
||||
endif()
|
||||
|
||||
if(WIN32 AND NOT WINCE AND ENABLE_DATA_ODBC)
|
||||
set(ODBC_LIBRARIES "odbc32" "odbccp32") # TODO(Bjoe) Verify if this is not set via find_package(ODBC)
|
||||
message(STATUS "Windows native ODBC Support Enabled")
|
||||
add_subdirectory( ODBC )
|
||||
else()
|
||||
if(ODBC_FOUND AND ENABLE_DATA_ODBC)
|
||||
include_directories("${ODBC_INCLUDE_DIRECTORIES}") # TODO(Bjoe) use target_include_directories or target_link_libraries
|
||||
message(STATUS "ODBC Support Enabled")
|
||||
add_subdirectory( ODBC )
|
||||
else()
|
||||
message(STATUS "MySQL Support Disabled - no MySQL library")
|
||||
endif(MYSQL_FOUND)
|
||||
endif(ENABLE_DATA_MYSQL)
|
||||
|
||||
if(ENABLE_DATA_POSTGRESQL)
|
||||
find_package(PostgreSQL)
|
||||
if(POSTGRESQL_FOUND)
|
||||
include_directories("${PostgreSQL_INCLUDE_DIR}")
|
||||
if(POCO_VERBOSE_MESSAGES)
|
||||
message(STATUS "PostgreSQL Support Enabled")
|
||||
endif()
|
||||
add_subdirectory( PostgreSQL )
|
||||
elseif(POCO_VERBOSE_MESSAGES)
|
||||
message(STATUS "PostgreSQL Support Disabled - no PostgreSQL library")
|
||||
endif(POSTGRESQL_FOUND)
|
||||
endif(ENABLE_DATA_POSTGRESQL)
|
||||
|
||||
if(ENABLE_DATA_ODBC)
|
||||
find_package(ODBC)
|
||||
if(WIN32 AND NOT WINCE)
|
||||
set(ODBC_LIBRARIES "odbc32" "odbccp32")
|
||||
message(STATUS "Windows native ODBC Support Enabled")
|
||||
add_subdirectory( ODBC )
|
||||
else(WIN32 AND NOT WINCE)
|
||||
if(ODBC_FOUND)
|
||||
include_directories("${ODBC_INCLUDE_DIRECTORIES}")
|
||||
message(STATUS "ODBC Support Enabled")
|
||||
add_subdirectory( ODBC )
|
||||
else()
|
||||
message(STATUS "ODBC Support Disabled - no ODBC runtime")
|
||||
endif()
|
||||
endif(WIN32 AND NOT WINCE)
|
||||
endif(ENABLE_DATA_ODBC)
|
||||
message(STATUS "ODBC Support Disabled - no ODBC runtime")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
add_subdirectory(samples)
|
||||
|
@ -1,6 +1,3 @@
|
||||
set(LIBNAME "DataMySQL")
|
||||
set(POCO_LIBNAME "Poco${LIBNAME}")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( MYSQL_SRCS ${SRCS_G})
|
||||
@ -9,28 +6,26 @@ POCO_SOURCES_AUTO( MYSQL_SRCS ${SRCS_G})
|
||||
file(GLOB_RECURSE HDRS_G "include/*.h" )
|
||||
POCO_HEADERS_AUTO( MYSQL_SRCS ${HDRS_G})
|
||||
|
||||
add_definitions(-DTHREADSAFE -DNO_TCL)
|
||||
|
||||
add_library( "${LIBNAME}" ${LIB_MODE} ${MYSQL_SRCS} )
|
||||
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
|
||||
set_target_properties( "${LIBNAME}"
|
||||
add_library(DataMySQL ${MYSQL_SRCS} )
|
||||
add_library(Poco::DataMySQL ALIAS DataMySQL)
|
||||
set_target_properties(DataMySQL
|
||||
PROPERTIES
|
||||
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
|
||||
OUTPUT_NAME ${POCO_LIBNAME}
|
||||
OUTPUT_NAME PocoDataMySQL
|
||||
DEFINE_SYMBOL MySQL_EXPORTS
|
||||
)
|
||||
|
||||
target_link_libraries( "${LIBNAME}" Foundation Data ${MYSQL_LIB})
|
||||
target_include_directories( "${LIBNAME}"
|
||||
target_link_libraries(DataMySQL PUBLIC Poco::Data ${MYSQL_LIB})
|
||||
target_include_directories(DataMySQL
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS})
|
||||
target_compile_definitions(DataMySQL PUBLIC THREADSAFE NO_TCL)
|
||||
|
||||
POCO_INSTALL("${LIBNAME}")
|
||||
POCO_GENERATE_PACKAGE("${LIBNAME}")
|
||||
POCO_INSTALL(DataMySQL)
|
||||
POCO_GENERATE_PACKAGE(DataMySQL)
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
add_subdirectory(testsuite)
|
||||
|
@ -1,5 +1,3 @@
|
||||
set(TESTUNIT "${LIBNAME}-testrunner")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
|
||||
@ -12,11 +10,11 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF
|
||||
src/WinDriver.cpp
|
||||
)
|
||||
|
||||
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
||||
add_executable(DataMySQL-testrunner ${TEST_SRCS} )
|
||||
if(ANDROID)
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/${TESTUNIT} -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake)
|
||||
add_test(NAME DataMySQL WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/DataMySQL-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake)
|
||||
else()
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
|
||||
add_test(NAME DataMySQL WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND DataMySQL-testrunner -all)
|
||||
endif()
|
||||
target_link_libraries( ${TESTUNIT} PocoDataMySQL PocoData PocoFoundation CppUnit )
|
||||
target_link_libraries(DataMySQL-testrunner PUBLIC Poco::DataMySQL CppUnit)
|
||||
|
@ -1,6 +1,3 @@
|
||||
set(LIBNAME "DataODBC")
|
||||
set(POCO_LIBNAME "Poco${LIBNAME}")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( ODBC_SRCS ${SRCS_G})
|
||||
@ -9,28 +6,26 @@ POCO_SOURCES_AUTO( ODBC_SRCS ${SRCS_G})
|
||||
file(GLOB_RECURSE HDRS_G "include/*.h" )
|
||||
POCO_HEADERS_AUTO( ODBC_SRCS ${HDRS_G})
|
||||
|
||||
add_definitions( ${ODBC_CFLAGS} -DTHREADSAFE)
|
||||
|
||||
add_library( "${LIBNAME}" ${LIB_MODE} ${ODBC_SRCS} )
|
||||
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
|
||||
set_target_properties( "${LIBNAME}"
|
||||
add_library(DataODBC ${ODBC_SRCS})
|
||||
add_library(Poco::DataODBC ALIAS DataODBC)
|
||||
set_target_properties(DataODBC
|
||||
PROPERTIES
|
||||
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
|
||||
OUTPUT_NAME ${POCO_LIBNAME}
|
||||
OUTPUT_NAME PocoDataODBC
|
||||
DEFINE_SYMBOL ODBC_EXPORTS
|
||||
)
|
||||
|
||||
target_link_libraries( "${LIBNAME}" Foundation Data ${ODBC_LIBRARIES})
|
||||
target_include_directories( "${LIBNAME}"
|
||||
target_link_libraries(DataODBC PUBLIC Poco::Data ${ODBC_LIBRARIES})
|
||||
target_include_directories(DataODBC
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS})
|
||||
target_compile_definitions(DataODBC PUBLIC ${ODBC_CFLAGS} THREADSAFE)
|
||||
|
||||
POCO_INSTALL("${LIBNAME}")
|
||||
POCO_GENERATE_PACKAGE("${LIBNAME}")
|
||||
POCO_INSTALL(DataODBC)
|
||||
POCO_GENERATE_PACKAGE(DataODBC)
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
add_subdirectory(testsuite)
|
||||
|
@ -1,5 +1,3 @@
|
||||
set(TESTUNIT "${LIBNAME}-testrunner")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
|
||||
@ -12,11 +10,11 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF
|
||||
src/WinDriver.cpp
|
||||
)
|
||||
|
||||
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
||||
add_executable(DataODBC-testrunner ${TEST_SRCS} )
|
||||
if(ANDROID)
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/${TESTUNIT} -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake)
|
||||
add_test(NAME DataODBC WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/DataODBC-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake)
|
||||
else()
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
|
||||
add_test(NAME DataODBC WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND DataODBC-testrunner -all)
|
||||
endif()
|
||||
target_link_libraries( ${TESTUNIT} PocoDataODBC PocoData PocoFoundation CppUnit )
|
||||
target_link_libraries(DataODBC-testrunner PUBLIC Poco::DataODBC CppUnit)
|
||||
|
@ -1,6 +1,3 @@
|
||||
set(LIBNAME "SQLPostgreSQL")
|
||||
set(POCO_LIBNAME "Poco${LIBNAME}")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( POSTGRESQL_SRCS ${SRCS_G})
|
||||
@ -9,25 +6,25 @@ POCO_SOURCES_AUTO( POSTGRESQL_SRCS ${SRCS_G})
|
||||
file(GLOB_RECURSE HDRS_G "include/*.h" )
|
||||
POCO_HEADERS_AUTO( POSTGRESQL_SRCS ${HDRS_G})
|
||||
|
||||
add_library( "${LIBNAME}" ${POSTGRESQL_SRCS} )
|
||||
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
|
||||
set_target_properties( "${LIBNAME}"
|
||||
add_library(DataPostgreSQL ${POSTGRESQL_SRCS} )
|
||||
add_library(Poco::DataPostgreSQL ALIAS DataPostgreSQL)
|
||||
set_target_properties(DataPostgreSQL
|
||||
PROPERTIES
|
||||
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
|
||||
OUTPUT_NAME ${POCO_LIBNAME}
|
||||
OUTPUT_NAME PocoDataPostgreSQL
|
||||
DEFINE_SYMBOL PostgreSQL_EXPORTS
|
||||
)
|
||||
|
||||
target_link_libraries( "${LIBNAME}" Foundation SQL ${PostgreSQL_LIBRARIES})
|
||||
target_include_directories( "${LIBNAME}"
|
||||
target_link_libraries(DataPostgreSQL PUBLIC Poco::Data ${PostgreSQL_LIBRARIES})
|
||||
target_include_directories(DataPostgreSQL
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
)
|
||||
|
||||
POCO_INSTALL("${LIBNAME}")
|
||||
POCO_GENERATE_PACKAGE("${LIBNAME}")
|
||||
POCO_INSTALL(DataPostgreSQL)
|
||||
POCO_GENERATE_PACKAGE(DataPostgreSQL)
|
||||
|
||||
if (POCO_ENABLE_TESTS)
|
||||
add_subdirectory(testsuite)
|
||||
|
4
Data/PostgreSQL/cmake/PocoDataPostgreSQLConfig.cmake
Normal file
4
Data/PostgreSQL/cmake/PocoDataPostgreSQLConfig.cmake
Normal file
@ -0,0 +1,4 @@
|
||||
include(CMakeFindDependencyMacro)
|
||||
find_dependency(PocoFoundation)
|
||||
find_dependency(PocoData)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/PocoDataPostgreSQLTargets.cmake")
|
@ -1,4 +0,0 @@
|
||||
include(CMakeFindDependencyMacro)
|
||||
find_dependency(PocoFoundation)
|
||||
find_dependency(PocoSQL)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/PocoSQLPostgreSQLTargets.cmake")
|
@ -1,5 +1,3 @@
|
||||
set(TESTUNIT "${LIBNAME}-testrunner")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
|
||||
@ -12,6 +10,6 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF
|
||||
src/WinDriver.cpp
|
||||
)
|
||||
|
||||
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
|
||||
target_link_libraries( ${TESTUNIT} PocoSQLPostgreSQL PocoSQL PocoFoundation CppUnit ${PostgreSQL_LIBRARIES})
|
||||
add_executable(DataPostgreSQL-testrunner ${TEST_SRCS} )
|
||||
add_test(NAME DataPostgreSQL WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND DataPostgreSQL-testrunner -all)
|
||||
target_link_libraries(DataPostgreSQL-testrunner PUBLIC Poco::DataPostgreSQL CppUnit)
|
||||
|
@ -1,6 +1,3 @@
|
||||
set(LIBNAME "DataSQLite")
|
||||
set(POCO_LIBNAME "Poco${LIBNAME}")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( SQLITE_SRCS ${SRCS_G})
|
||||
@ -10,9 +7,7 @@ file(GLOB_RECURSE HDRS_G "include/*.h" )
|
||||
POCO_HEADERS_AUTO( SQLITE_SRCS ${HDRS_G})
|
||||
|
||||
if (POCO_UNBUNDLED)
|
||||
find_package(SQLite3)
|
||||
set(DATASQLITELIBS ${SQLITE3_LIBRARIES})
|
||||
include_directories("${SQLITE3_INCLUDE_DIRS}")
|
||||
find_package(SQLite3 REQUIRED)
|
||||
else()
|
||||
# sqlite3
|
||||
POCO_SOURCES( SQLITE_SRCS sqlite3
|
||||
@ -22,36 +17,45 @@ else()
|
||||
POCO_HEADERS( SQLITE_SRCS sqlite3
|
||||
src/sqlite3.h
|
||||
)
|
||||
|
||||
set(DATASQLITELIBS "")
|
||||
endif()
|
||||
|
||||
if(WINCE)
|
||||
add_definitions(-DSQLITE_MSVC_LOCALTIME_API)
|
||||
endif(WINCE)
|
||||
add_library(DataSQLite ${SQLITE_SRCS} )
|
||||
|
||||
add_definitions(-DSQLITE_THREADSAFE=1 -DSQLITE_DISABLE_LFS -DSQLITE_OMIT_UTF16 -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_COMPLETE -DSQLITE_OMIT_TCL_VARIABLE -DSQLITE_OMIT_DEPRECATED)
|
||||
|
||||
add_library( "${LIBNAME}" ${LIB_MODE} ${SQLITE_SRCS} )
|
||||
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
|
||||
set_target_properties( "${LIBNAME}"
|
||||
add_library(Poco::DataSQLite ALIAS DataSQLite)
|
||||
set_target_properties(DataSQLite
|
||||
PROPERTIES
|
||||
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
|
||||
OUTPUT_NAME ${POCO_LIBNAME}
|
||||
OUTPUT_NAME PocoDataSQLite
|
||||
DEFINE_SYMBOL SQLite_EXPORTS
|
||||
)
|
||||
|
||||
target_link_libraries( "${LIBNAME}" Foundation Data ${DATASQLITELIBS} )
|
||||
target_include_directories( "${LIBNAME}"
|
||||
target_link_libraries(DataSQLite PUBLIC Poco::Data ${SQLITE3_LIBRARIES})
|
||||
target_include_directories(DataSQLite
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS})
|
||||
|
||||
POCO_INSTALL("${LIBNAME}")
|
||||
POCO_GENERATE_PACKAGE("${LIBNAME}")
|
||||
if(POCO_UNBUNDLED)
|
||||
target_include_directories(DataSQLite PUBLIC "${SQLITE3_INCLUDE_DIRS}")
|
||||
target_compile_definitions(DataSQLite PUBLIC POCO_UNBUNDLED)
|
||||
else()
|
||||
if(WINCE)
|
||||
target_compile_definitions(DataSQLite PRIVATE SQLITE_MSVC_LOCALTIME_API)
|
||||
endif(WINCE)
|
||||
target_compile_definitions(DataSQLite PRIVATE
|
||||
SQLITE_THREADSAFE=1
|
||||
SQLITE_DISABLE_LFS
|
||||
SQLITE_OMIT_UTF16
|
||||
SQLITE_OMIT_PROGRESS_CALLBACK
|
||||
SQLITE_OMIT_COMPLETE
|
||||
SQLITE_OMIT_TCL_VARIABLE
|
||||
SQLITE_OMIT_DEPRECATED
|
||||
)
|
||||
endif()
|
||||
|
||||
POCO_INSTALL(DataSQLite)
|
||||
POCO_GENERATE_PACKAGE(DataSQLite)
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
add_subdirectory(testsuite)
|
||||
|
@ -1,5 +1,3 @@
|
||||
set(TESTUNIT "${LIBNAME}-testrunner")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
|
||||
@ -16,11 +14,11 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
|
||||
src/WinCEDriver.cpp
|
||||
)
|
||||
|
||||
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
||||
add_executable(DataSQLite-testrunner ${TEST_SRCS} )
|
||||
if(ANDROID)
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/${TESTUNIT} -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake)
|
||||
add_test(NAME DataSQLite WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/DataSQLite-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake)
|
||||
else()
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
|
||||
add_test(NAME DataSQLite WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND DataSQLite-testrunner -all)
|
||||
endif()
|
||||
target_link_libraries( ${TESTUNIT} PocoDataSQLite PocoData PocoFoundation CppUnit )
|
||||
target_link_libraries(DataSQLite-testrunner PUBLIC Poco::DataSQLite CppUnit)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "Binding")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoDataSQLite PocoData PocoFoundation )
|
||||
add_executable(Binding src/Binding.cpp)
|
||||
target_link_libraries(Binding PUBLIC Poco::DataSQLite)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "RecordSet")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoDataSQLite PocoData PocoFoundation )
|
||||
add_executable(RecordSet src/RecordSet.cpp)
|
||||
target_link_libraries(RecordSet PUBLIC Poco::DataSQLite)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "RowFormatter")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoDataSQLite PocoData PocoFoundation )
|
||||
add_executable(RowFormatter src/RowFormatter.cpp)
|
||||
target_link_libraries(RowFormatter PUBLIC Poco::DataSQLite)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "Tuple")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoDataSQLite PocoData PocoFoundation )
|
||||
add_executable(Tuple src/Tuple.cpp)
|
||||
target_link_libraries(Tuple PUBLIC Poco::DataSQLite)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "TypeHandler")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoDataSQLite PocoData PocoFoundation )
|
||||
add_executable(TypeHandler src/TypeHandler.cpp)
|
||||
target_link_libraries(TypeHandler PUBLIC Poco::DataSQLite)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "WebNotifier")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoDataSQLite PocoData PocoNet PocoFoundation )
|
||||
add_executable(WebNotifier src/WebNotifier.cpp)
|
||||
target_link_libraries(WebNotifier PUBLIC Poco::DataSQLite Poco::Net)
|
||||
|
@ -1,5 +1,3 @@
|
||||
set(TESTUNIT "${LIBNAME}-testrunner")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
|
||||
@ -21,11 +19,11 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF
|
||||
src/StatementImpl.cpp
|
||||
)
|
||||
|
||||
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
||||
add_executable(Data-testrunner ${TEST_SRCS} )
|
||||
if(ANDROID)
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/${TESTUNIT} -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake)
|
||||
add_test(NAME Data WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/Data-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake)
|
||||
else()
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
|
||||
add_test(NAME Data WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND Data-testrunner -all)
|
||||
endif()
|
||||
target_link_libraries( ${TESTUNIT} PocoData PocoUtil PocoXML PocoFoundation CppUnit)
|
||||
target_link_libraries(Data-testrunner PUBLIC Poco::Data CppUnit)
|
||||
|
@ -1,6 +1,3 @@
|
||||
set(LIBNAME "Encodings")
|
||||
set(POCO_LIBNAME "Poco${LIBNAME}")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES( SRCS Encodings ${SRCS_G})
|
||||
@ -9,26 +6,25 @@ POCO_SOURCES( SRCS Encodings ${SRCS_G})
|
||||
file(GLOB_RECURSE HDRS_G "include/*.h" )
|
||||
POCO_HEADERS( SRCS Encodings ${HDRS_G})
|
||||
|
||||
add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} )
|
||||
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
|
||||
set_target_properties( "${LIBNAME}"
|
||||
add_library(Encodings ${SRCS} )
|
||||
add_library(Poco::Encodings ALIAS Encodings)
|
||||
set_target_properties(Encodings
|
||||
PROPERTIES
|
||||
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
|
||||
OUTPUT_NAME ${POCO_LIBNAME}
|
||||
OUTPUT_NAME PocoEncodings
|
||||
DEFINE_SYMBOL Encodings_EXPORTS
|
||||
)
|
||||
|
||||
target_link_libraries( "${LIBNAME}" Foundation)
|
||||
target_include_directories( "${LIBNAME}"
|
||||
target_link_libraries(Encodings PUBLIC Poco::Foundation)
|
||||
target_include_directories(Encodings
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS})
|
||||
|
||||
POCO_INSTALL("${LIBNAME}")
|
||||
POCO_GENERATE_PACKAGE("${LIBNAME}")
|
||||
POCO_INSTALL(Encodings)
|
||||
POCO_GENERATE_PACKAGE(Encodings)
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
add_subdirectory(samples)
|
||||
|
@ -1,21 +1,19 @@
|
||||
set(POCO_EXENAME "EncodingsCompiler")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
|
||||
add_executable( "${POCO_EXENAME}" ${SRCS} )
|
||||
set_target_properties( "${POCO_EXENAME}"
|
||||
add_executable(EncodingsCompiler ${SRCS} )
|
||||
set_target_properties(EncodingsCompiler
|
||||
PROPERTIES
|
||||
OUTPUT_NAME tec
|
||||
)
|
||||
|
||||
target_link_libraries( "${POCO_EXENAME}" Net Util XML JSON Foundation)
|
||||
target_link_libraries(EncodingsCompiler PUBLIC Poco::Net Poco::Util)
|
||||
|
||||
install(
|
||||
TARGETS "${POCO_EXENAME}" EXPORT "${POCO_EXENAME}Targets"
|
||||
TARGETS EncodingsCompiler EXPORT "EncodingsCompilerTargets"
|
||||
LIBRARY DESTINATION lib${LIB_SUFFIX}
|
||||
ARCHIVE DESTINATION lib${LIB_SUFFIX}
|
||||
RUNTIME DESTINATION bin
|
||||
INCLUDES DESTINATION include
|
||||
)
|
||||
)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "TextConverter")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoEncodings PocoFoundation )
|
||||
add_executable(TextConverter src/TextConverter.cpp)
|
||||
target_link_libraries(TextConverter PUBLIC Poco::Encodings)
|
||||
|
@ -1,5 +1,3 @@
|
||||
set(TESTUNIT "${LIBNAME}-testrunner")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
|
||||
@ -16,16 +14,16 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
|
||||
src/WinCEDriver.cpp
|
||||
)
|
||||
|
||||
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
||||
add_executable(Encodings-testrunner ${TEST_SRCS} )
|
||||
if(ANDROID)
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} "-DTEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/data;" -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/${TESTUNIT} -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake)
|
||||
add_test(NAME Encodings WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} "-DTEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/data;" -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/Encodings-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake)
|
||||
else()
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
|
||||
add_test(NAME Encodings WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND Encodings-testrunner -all)
|
||||
# The test is run in the build directory. So the test data is copied there too
|
||||
add_custom_command(TARGET ${TESTUNIT} POST_BUILD
|
||||
add_custom_command(TARGET Encodings-testrunner POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data )
|
||||
endif()
|
||||
#set_target_properties( ${TESTUNIT} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} )
|
||||
target_link_libraries( ${TESTUNIT} PocoEncodings PocoFoundation CppUnit )
|
||||
#set_target_properties(Encodings-testrunner PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} )
|
||||
target_link_libraries(Encodings-testrunner PUBLIC Poco::Encodings CppUnit)
|
||||
|
||||
|
@ -1,6 +1,3 @@
|
||||
set(LIBNAME "Foundation")
|
||||
set(POCO_LIBNAME "Poco${LIBNAME}")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
@ -33,8 +30,7 @@ POCO_MESSAGES( SRCS Logging src/pocomsg.mc)
|
||||
# The configuration will fail if the packages are not found
|
||||
if (POCO_UNBUNDLED)
|
||||
find_package(PCRE REQUIRED)
|
||||
set(SYSLIBS ${SYSLIBS} ${PCRE_LIBRARIES})
|
||||
include_directories(${PCRE_INCLUDE_DIRS})
|
||||
find_package(ZLIB REQUIRED)
|
||||
|
||||
#HACK: Unicode.cpp requires functions from these files. The can't be taken from the library
|
||||
POCO_SOURCES( SRCS RegExp
|
||||
@ -42,12 +38,6 @@ if (POCO_UNBUNDLED)
|
||||
src/pcre_tables.c
|
||||
)
|
||||
|
||||
find_package(ZLIB REQUIRED)
|
||||
set(SYSLIBS ${SYSLIBS} ${ZLIB_LIBRARIES})
|
||||
include_directories(${ZLIB_INCLUDE_DIRS})
|
||||
|
||||
add_definitions(-DPOCO_UNBUNDLED)
|
||||
|
||||
else()
|
||||
# pcre
|
||||
POCO_SOURCES( SRCS pcre
|
||||
@ -94,84 +84,127 @@ else()
|
||||
)
|
||||
endif (POCO_UNBUNDLED)
|
||||
|
||||
if(WIN32)
|
||||
set(SYSLIBS ${SYSLIBS} iphlpapi)
|
||||
endif(WIN32)
|
||||
if (${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro")
|
||||
set_target_properties( "${LIBNAME}" PROPERTIES LINK_FLAGS "-library=stlport4")
|
||||
endif (${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro")
|
||||
|
||||
if(ANDROID)
|
||||
set(SYSLIBS ${SYSLIBS} log)
|
||||
endif(ANDROID)
|
||||
|
||||
# TODO: Why is this here?
|
||||
add_definitions( -DPCRE_STATIC)
|
||||
|
||||
# For SetAffinity
|
||||
if(UNIX AND NOT APPLE)
|
||||
INCLUDE (CheckFunctionExists)
|
||||
INCLUDE (CheckCXXSourceCompiles)
|
||||
INCLUDE (CheckLibraryExists)
|
||||
CHECK_LIBRARY_EXISTS(pthread pthread_setaffinity_np "pthread.h" HAVE_PTHREAD_SETAFFINITY_NP)
|
||||
#set(CMAKE_EXTRA_INCLUDE_FILES pthread.h)
|
||||
#CHECK_FUNCTION_EXISTS(pthread_setaffinity_np HAVE_PTHREAD_SETAFFINITY_NP)
|
||||
if(NOT HAVE_PTHREAD_SETAFFINITY_NP)
|
||||
message(STATUS "Platform has not PTHREAD_SETAFFINITY_NP")
|
||||
else(HAVE_PTHREAD_SETAFFINITY_NP)
|
||||
add_definitions(-DHAVE_PTHREAD_SETAFFINITY_NP)
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#include <sched.h>
|
||||
int main() {
|
||||
cpu_set_t cpumask;
|
||||
sched_setaffinity( 0, sizeof(cpumask), &cpumask );
|
||||
return 0;
|
||||
}" HAVE_THREE_PARAM_SCHED_SETAFFINITY)
|
||||
|
||||
if(HAVE_THREE_PARAM_SCHED_SETAFFINITY)
|
||||
message(STATUS "Platform has THREE PARAM at PTHREAD_SETAFFINITY_NP")
|
||||
add_definitions(-DHAVE_THREE_PARAM_SCHED_SETAFFINITY)
|
||||
else(HAVE_THREE_PARAM_SCHED_SETAFFINITY)
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#include <sched.h>
|
||||
int main() {
|
||||
cpu_set_t cpumask;
|
||||
sched_setaffinity( 0, &cpumask );
|
||||
return 0;
|
||||
}" HAVE_TWO_PARAM_SCHED_SETAFFINITY)
|
||||
|
||||
if(HAVE_TWO_PARAM_SCHED_SETAFFINITY)
|
||||
message(STATUS "Platform has TWO PARAM at PTHREAD_SETAFFINITY_NP")
|
||||
add_definitions(-DHAVE_TWO_PARAM_SCHED_SETAFFINITY)
|
||||
endif(HAVE_TWO_PARAM_SCHED_SETAFFINITY)
|
||||
|
||||
endif(HAVE_THREE_PARAM_SCHED_SETAFFINITY)
|
||||
endif(NOT HAVE_PTHREAD_SETAFFINITY_NP)
|
||||
endif(UNIX AND NOT APPLE)
|
||||
|
||||
add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS})
|
||||
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
|
||||
set_target_properties( "${LIBNAME}"
|
||||
add_library(Foundation ${SRCS})
|
||||
add_library(Poco::Foundation ALIAS Foundation)
|
||||
set_target_properties(Foundation
|
||||
PROPERTIES
|
||||
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
|
||||
OUTPUT_NAME ${POCO_LIBNAME}
|
||||
OUTPUT_NAME PocoFoundation
|
||||
DEFINE_SYMBOL Foundation_EXPORTS
|
||||
)
|
||||
|
||||
target_link_libraries( "${LIBNAME}" ${SYSLIBS})
|
||||
target_include_directories( "${LIBNAME}"
|
||||
target_link_libraries(Foundation PUBLIC ${PCRE_LIBRARIES} ${ZLIB_LIBRARIES})
|
||||
target_include_directories(Foundation
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS})
|
||||
|
||||
POCO_INSTALL("${LIBNAME}")
|
||||
POCO_GENERATE_PACKAGE("${LIBNAME}")
|
||||
target_compile_definitions(Foundation
|
||||
PUBLIC
|
||||
$<$<CONFIG:Debug>:_DEBUG>
|
||||
)
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(Foundation
|
||||
PUBLIC
|
||||
POCO_STATIC
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
target_compile_definitions(Foundation PUBLIC POCO_NO_AUTOMATIC_LIBS POCO_OS_FAMILY_WINDOWS UNICODE _UNICODE __LCC__) #__LCC__ define used by MySQL.h
|
||||
target_link_libraries(Foundation PUBLIC iphlpapi)
|
||||
endif()
|
||||
|
||||
if (CYGWIN)
|
||||
target_compile_definitions(Foundation PUBLIC POCO_NO_FPENVIRONMENT POCO_NO_WSTRING _XOPEN_SOURCE=500 __BSD_VISIBLE)
|
||||
else (CYGWIN)
|
||||
if (UNIX AND NOT ANDROID )
|
||||
target_compile_definitions(Foundation PUBLIC POCO_OS_FAMILY_UNIX)
|
||||
if (APPLE)
|
||||
target_compile_definitions(Foundation PUBLIC POCO_HAVE_IPv6 POCO_NO_STAT64)
|
||||
target_link_libraries(Foundation PUBLIC ${CMAKE_DL_LIBS})
|
||||
else (APPLE)
|
||||
target_compile_definitions(Foundation PUBLIC _REENTRANT _THREAD_SAFE _LARGEFILE64_SOURCE _FILE_OFFSET_BITS=64)
|
||||
if (QNX)
|
||||
target_compile_definitions(Foundation PUBLIC POCO_HAVE_FD_POLL)
|
||||
target_link_libraries(Foundation PUBLIC m socket)
|
||||
else (QNX)
|
||||
target_compile_definitions(Foundation PUBLIC _XOPEN_SOURCE=500 POCO_HAVE_FD_EPOLL)
|
||||
target_link_libraries(Foundation PUBLIC pthread ${CMAKE_DL_LIBS} rt)
|
||||
endif (QNX)
|
||||
endif (APPLE)
|
||||
endif(UNIX AND NOT ANDROID )
|
||||
endif (CYGWIN)
|
||||
|
||||
if (CMAKE_SYSTEM MATCHES "SunOS")
|
||||
target_compile_definitions(Foundation
|
||||
PUBLIC
|
||||
POCO_OS_FAMILY_UNIX
|
||||
_XOPEN_SOURCE=500
|
||||
_REENTRANT
|
||||
_THREAD_SAFE
|
||||
_LARGEFILE64_SOURCE
|
||||
_FILE_OFFSET_BITS=64
|
||||
)
|
||||
target_link_libraries(Foundation PUBLIC pthread socket xnet nsl resolv rt ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_MINGW)
|
||||
target_compile_definitions(Foundation
|
||||
PUBLIC
|
||||
WC_NO_BEST_FIT_CHARS=0x400
|
||||
POCO_WIN32_UTF8
|
||||
_WIN32
|
||||
MINGW32
|
||||
WINVER=0x500
|
||||
ODBCVER=0x0300
|
||||
POCO_THREAD_STACK_SIZE
|
||||
)
|
||||
endif()
|
||||
|
||||
# SunPro C++
|
||||
if(${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro")
|
||||
target_compile_definitions(Foundation PUBLIC _BSD_SOURCE)
|
||||
target_compile_options(Foundation PUBLIC -library=stlport4)
|
||||
endif()
|
||||
|
||||
# iOS
|
||||
if (IOS)
|
||||
target_compile_definitions(Foundation
|
||||
PUBLIC
|
||||
POCO_HAVE_IPv6
|
||||
POCO_NO_FPENVIRONMENT
|
||||
POCO_NO_STAT64
|
||||
POCO_NO_SHAREDLIBS
|
||||
POCO_NO_NET_IFTYPES
|
||||
)
|
||||
endif()
|
||||
|
||||
#Android
|
||||
if (ANDROID)
|
||||
target_compile_definitions(Foundation
|
||||
PUBLIC
|
||||
POCO_NO_FPENVIRONMENT
|
||||
POCO_NO_WSTRING
|
||||
POCO_NO_SHAREDMEMORY
|
||||
)
|
||||
target_link_libraries(Foundation PUBLIC log)
|
||||
endif()
|
||||
|
||||
if(POCO_UNBUNDLED)
|
||||
target_include_directories(Foundation PUBLIC "${PCRE_INCLUDE_DIRS}" "${ZLIB_INCLUDE_DIRS}")
|
||||
target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED)
|
||||
endif()
|
||||
|
||||
POCO_INSTALL(Foundation)
|
||||
POCO_GENERATE_PACKAGE(Foundation)
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
add_subdirectory( samples )
|
||||
add_subdirectory( testsuite )
|
||||
add_subdirectory(samples)
|
||||
add_subdirectory(testsuite)
|
||||
endif ()
|
||||
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "ActiveMethod")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoFoundation )
|
||||
add_executable(ActiveMethod src/ActiveMethod.cpp)
|
||||
target_link_libraries(ActiveMethod PUBLIC Poco::Foundation )
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "Activity")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoFoundation )
|
||||
add_executable(Activity src/Activity.cpp)
|
||||
target_link_libraries(Activity PUBLIC Poco::Foundation )
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "BinaryReaderWriter")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoFoundation )
|
||||
add_executable(BinaryReaderWriter src/BinaryReaderWriter.cpp)
|
||||
target_link_libraries(BinaryReaderWriter PUBLIC Poco::Foundation )
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "DateTime")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoFoundation)
|
||||
add_executable(DateTime src/DateTime.cpp)
|
||||
target_link_libraries(DateTime PUBLIC Poco::Foundation)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "LineEndingConverter")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoFoundation )
|
||||
add_executable(LineEndingConverter src/LineEndingConverter.cpp)
|
||||
target_link_libraries(LineEndingConverter PUBLIC Poco::Foundation )
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "LogRotation")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoFoundation )
|
||||
add_executable(LogRotation src/LogRotation.cpp)
|
||||
target_link_libraries(LogRotation PUBLIC Poco::Foundation )
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "Logger")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoFoundation )
|
||||
add_executable(Logger src/Logger.cpp)
|
||||
target_link_libraries(Logger PUBLIC Poco::Foundation )
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "NotificationQueue")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoFoundation )
|
||||
add_executable(NotificationQueue src/NotificationQueue.cpp)
|
||||
target_link_libraries(NotificationQueue PUBLIC Poco::Foundation )
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "StringTokenizer")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoJSON PocoXML PocoFoundation)
|
||||
add_executable(StringTokenizer src/StringTokenizer.cpp)
|
||||
target_link_libraries(StringTokenizer PUBLIC Poco::JSON Poco::XML Poco::Foundation)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "Timer")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoFoundation )
|
||||
add_executable(Timer src/Timer.cpp)
|
||||
target_link_libraries(Timer PUBLIC Poco::Foundation )
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "URI")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoJSON PocoXML PocoFoundation )
|
||||
add_executable(URI src/URI.cpp)
|
||||
target_link_libraries(URI PUBLIC Poco::JSON Poco::XML Poco::Foundation )
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "base64decode")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoFoundation )
|
||||
add_executable(base64decode src/base64decode.cpp)
|
||||
target_link_libraries(base64decode PUBLIC Poco::Foundation )
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "base64encode")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoFoundation )
|
||||
add_executable(base64encode src/base64encode.cpp)
|
||||
target_link_libraries(base64encode PUBLIC Poco::Foundation )
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "deflate")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoFoundation )
|
||||
add_executable(deflate src/deflate.cpp)
|
||||
target_link_libraries(deflate PUBLIC Poco::Foundation )
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "dir")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoFoundation )
|
||||
add_executable(dir src/dir.cpp)
|
||||
target_link_libraries(dir PUBLIC Poco::Foundation )
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "grep")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoFoundation )
|
||||
add_executable(grep src/grep.cpp)
|
||||
target_link_libraries(grep PUBLIC Poco::Foundation )
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "hmacmd5")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoFoundation )
|
||||
add_executable(hmacmd5 src/hmacmd5.cpp)
|
||||
target_link_libraries(hmacmd5 PUBLIC Poco::Foundation )
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "inflate")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoFoundation )
|
||||
add_executable(inflate src/inflate.cpp)
|
||||
target_link_libraries(inflate PUBLIC Poco::Foundation )
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "md5")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoFoundation )
|
||||
add_executable(md5 src/md5.cpp)
|
||||
target_link_libraries(md5 PUBLIC Poco::Foundation )
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "uuidgen")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoFoundation )
|
||||
add_executable(uuidgen src/uuidgen.cpp)
|
||||
target_link_libraries(uuidgen PUBLIC Poco::Foundation )
|
||||
|
@ -1,4 +1,4 @@
|
||||
set(TESTUNIT "${LIBNAME}-testrunner")
|
||||
set(TESTUNIT "Foundation-testrunner")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
@ -24,44 +24,43 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
|
||||
src/WinCEDriver.cpp
|
||||
)
|
||||
|
||||
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
||||
add_executable(Foundation-testrunner ${TEST_SRCS} )
|
||||
if(ANDROID)
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} "-DTEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/data;${CMAKE_BINARY_DIR}/bin/TestApp;${CMAKE_BINARY_DIR}/bin/TestLibrary.so" -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/${TESTUNIT} -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake)
|
||||
add_test(NAME Foundation WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} "-DTEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/data;${CMAKE_BINARY_DIR}/bin/TestApp;${CMAKE_BINARY_DIR}/bin/TestLibrary.so" -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/Foundation-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake)
|
||||
else()
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${TESTUNIT} -all)
|
||||
set_tests_properties(${LIBNAME} PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=.") # The SharedLibaryTest has to look for shared libraries in the working directory
|
||||
add_test(NAME Foundation WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND Foundation-testrunner -all)
|
||||
set_tests_properties(Foundation PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=.") # The SharedLibaryTest has to look for shared libraries in the working directory
|
||||
# The test is run in the runtime directory. So the test data is copied there too
|
||||
add_custom_command(TARGET ${TESTUNIT} POST_BUILD
|
||||
add_custom_command(TARGET Foundation-testrunner POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/data ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/data )
|
||||
endif()
|
||||
|
||||
target_link_libraries( ${TESTUNIT} PocoFoundation CppUnit )
|
||||
target_link_libraries(Foundation-testrunner PUBLIC Poco::Foundation CppUnit )
|
||||
if(UNIX AND NOT ANDROID)
|
||||
target_link_libraries( ${TESTUNIT} pthread)
|
||||
target_link_libraries(Foundation-testrunner PUBLIC pthread)
|
||||
endif(UNIX AND NOT ANDROID)
|
||||
|
||||
if(ENABLE_LONG_RUNNING_TESTS)
|
||||
target_compile_definitions( ${TESTUNIT} PRIVATE ENABLE_LONG_RUNNING_TESTS)
|
||||
target_compile_definitions(Foundation-testrunner PRIVATE ENABLE_LONG_RUNNING_TESTS)
|
||||
endif(ENABLE_LONG_RUNNING_TESTS)
|
||||
|
||||
# TestApp
|
||||
if(WINCE)
|
||||
add_executable( TestApp src/TestApp_WINCE.cpp )
|
||||
set_target_properties(TestApp PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup")
|
||||
set_target_properties(TestApp PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup")
|
||||
else()
|
||||
add_executable( TestApp src/TestApp.cpp )
|
||||
add_executable( TestApp src/TestApp.cpp )
|
||||
endif()
|
||||
# The test is run in the runtime directory. So the TestApp is built there too because it is used by the tests
|
||||
set_target_properties( TestApp PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} )
|
||||
target_link_libraries( TestApp PocoFoundation )
|
||||
target_link_libraries( TestApp PUBLIC Poco::Foundation )
|
||||
|
||||
if(NOT POCO_STATIC)
|
||||
# TestLibrary
|
||||
add_library( TestLibrary SHARED src/TestLibrary.cpp src/TestPlugin.cpp src/TestPlugin.h )
|
||||
set_target_properties( TestLibrary PROPERTIES PREFIX "" DEBUG_POSTFIX "") # The test requires the library named TestLibrary. By default it is prefixed with lib.
|
||||
add_library(TestLibrary SHARED src/TestLibrary.cpp src/TestPlugin.cpp src/TestPlugin.h )
|
||||
set_target_properties(TestLibrary PROPERTIES PREFIX "" DEBUG_POSTFIX "") # The test requires the library named TestLibrary. By default it is prefixed with lib.
|
||||
# The test is run in the runtime directory. So the TestLibrary is built there too because it is used by the tests
|
||||
set_target_properties( TestLibrary PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} )
|
||||
target_link_libraries( TestLibrary PocoFoundation )
|
||||
endif()
|
||||
set_target_properties(TestLibrary PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} )
|
||||
target_link_libraries(TestLibrary PUBLIC Poco::Foundation )
|
||||
|
||||
add_dependencies(Foundation-testrunner TestApp TestLibrary)
|
||||
|
@ -1,11 +1,4 @@
|
||||
set(LIBNAME "JSON")
|
||||
set(POCO_LIBNAME "Poco${LIBNAME}")
|
||||
|
||||
# Sources
|
||||
if (WIN32)
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
endif (WIN32)
|
||||
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
|
||||
@ -13,30 +6,34 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
file(GLOB_RECURSE HDRS_G "include/*.h" )
|
||||
POCO_HEADERS_AUTO( SRCS ${HDRS_G})
|
||||
POCO_SOURCES(SRCS pdjson src/pdjson.c)
|
||||
if(WIN32)
|
||||
SET_SOURCE_FILES_PROPERTIES(src/pdjson.c PROPERTIES LANGUAGE CXX)
|
||||
endif()
|
||||
|
||||
add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} )
|
||||
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
|
||||
set_target_properties( "${LIBNAME}"
|
||||
add_library(JSON ${SRCS} )
|
||||
add_library(Poco::JSON ALIAS JSON)
|
||||
set_target_properties(JSON
|
||||
PROPERTIES
|
||||
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
|
||||
OUTPUT_NAME ${POCO_LIBNAME}
|
||||
OUTPUT_NAME PocoJSON
|
||||
DEFINE_SYMBOL JSON_EXPORTS
|
||||
)
|
||||
|
||||
target_link_libraries( "${LIBNAME}" Foundation)
|
||||
target_include_directories( "${LIBNAME}"
|
||||
target_link_libraries(JSON PUBLIC Poco::Foundation)
|
||||
target_include_directories(JSON
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS})
|
||||
|
||||
POCO_INSTALL("${LIBNAME}")
|
||||
POCO_GENERATE_PACKAGE("${LIBNAME}")
|
||||
if(WIN32)
|
||||
target_compile_definitions(JSON PRIVATE _CRT_SECURE_NO_WARNINGS)
|
||||
set_source_files_properties(src/pdjson.c PROPERTIES LANGUAGE CXX)
|
||||
set_property(TARGET JSON PROPERTY C_STANDARD 99)
|
||||
else()
|
||||
target_compile_features(JSON PUBLIC c_variadic_macros)
|
||||
endif()
|
||||
|
||||
POCO_INSTALL(JSON)
|
||||
POCO_GENERATE_PACKAGE(JSON)
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
add_subdirectory(samples)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "Benchmark")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoJSON PocoFoundation )
|
||||
add_executable(Benchmark src/Benchmark.cpp)
|
||||
target_link_libraries(Benchmark PUBLIC Poco::JSON)
|
||||
|
@ -1,5 +1,3 @@
|
||||
set(TESTUNIT "${LIBNAME}-testrunner")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
|
||||
@ -16,15 +14,15 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
|
||||
src/WinCEDriver.cpp
|
||||
)
|
||||
|
||||
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
||||
add_executable(JSON-testrunner ${TEST_SRCS} )
|
||||
if(ANDROID)
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} "-DTEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/data;" -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/${TESTUNIT} -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake)
|
||||
add_test(NAME JSON WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} "-DTEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/data;" -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/JSON-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake)
|
||||
else()
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
|
||||
add_test(NAME JSON WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND JSON-testrunner -all)
|
||||
# The test is run in the build directory. So the test data is copied there too
|
||||
add_custom_command(TARGET ${TESTUNIT} POST_BUILD
|
||||
add_custom_command(TARGET JSON-testrunner POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data )
|
||||
endif()
|
||||
target_link_libraries( ${TESTUNIT} PocoJSON PocoFoundation CppUnit )
|
||||
target_link_libraries(JSON-testrunner PUBLIC Poco::JSON CppUnit)
|
||||
|
||||
|
@ -1,6 +1,3 @@
|
||||
set(LIBNAME "MongoDB")
|
||||
set(POCO_LIBNAME "Poco${LIBNAME}")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
@ -9,26 +6,25 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
file(GLOB_RECURSE HDRS_G "include/*.h" )
|
||||
POCO_HEADERS_AUTO( SRCS ${HDRS_G})
|
||||
|
||||
add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} )
|
||||
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
|
||||
set_target_properties( "${LIBNAME}"
|
||||
add_library(MongoDB ${SRCS} )
|
||||
add_library(Poco::MongoDB ALIAS MongoDB)
|
||||
set_target_properties(MongoDB
|
||||
PROPERTIES
|
||||
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
|
||||
OUTPUT_NAME ${POCO_LIBNAME}
|
||||
OUTPUT_NAME PocoMongoDB
|
||||
DEFINE_SYMBOL MongoDB_EXPORTS
|
||||
)
|
||||
|
||||
target_link_libraries( "${LIBNAME}" Net Foundation)
|
||||
target_include_directories( "${LIBNAME}"
|
||||
target_link_libraries(MongoDB PUBLIC Poco::Net)
|
||||
target_include_directories(MongoDB
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS})
|
||||
|
||||
POCO_INSTALL("${LIBNAME}")
|
||||
POCO_GENERATE_PACKAGE("${LIBNAME}")
|
||||
POCO_INSTALL(MongoDB)
|
||||
POCO_GENERATE_PACKAGE(MongoDB)
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
add_subdirectory(samples)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "SQLToMongo")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoMongoDB PocoNet PocoFoundation )
|
||||
add_executable(SQLToMongo src/SQLToMongo.cpp)
|
||||
target_link_libraries(SQLToMongo PUBLIC Poco::MongoDB)
|
||||
|
@ -1,5 +1,3 @@
|
||||
set(TESTUNIT "${LIBNAME}-testrunner")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
|
||||
@ -16,13 +14,11 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
|
||||
src/WinCEDriver.cpp
|
||||
)
|
||||
|
||||
set(TESTUNIT "${LIBNAME}-testrunner")
|
||||
|
||||
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
||||
add_executable(MongoDB-testrunner ${TEST_SRCS} )
|
||||
if(ANDROID)
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/${TESTUNIT} -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake)
|
||||
add_test(NAME MongoDB WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/MongoDB-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake)
|
||||
else()
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
|
||||
add_test(NAME MongoDB WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND MongoDB-testrunner -all)
|
||||
endif()
|
||||
target_link_libraries( ${TESTUNIT} PocoMongoDB PocoFoundation CppUnit )
|
||||
target_link_libraries(MongoDB-testrunner PUBLIC Poco::MongoDB CppUnit)
|
||||
|
@ -1,6 +1,3 @@
|
||||
set(LIBNAME "Net")
|
||||
set(POCO_LIBNAME "Poco${LIBNAME}")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
@ -9,35 +6,35 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
file(GLOB_RECURSE HDRS_G "include/*.h" )
|
||||
POCO_HEADERS_AUTO( SRCS ${HDRS_G})
|
||||
|
||||
# Windows and WindowsCE need additional libraries
|
||||
if(WIN32)
|
||||
if(WINCE)
|
||||
set(SYSLIBS ${SYSLIBS} "ws2.lib" "iphlpapi.lib")
|
||||
else()
|
||||
set(SYSLIBS ${SYSLIBS} "ws2_32.lib" "iphlpapi.lib")
|
||||
endif()
|
||||
endif(WIN32)
|
||||
|
||||
add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} )
|
||||
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
|
||||
set_target_properties( "${LIBNAME}"
|
||||
add_library(Net ${SRCS} )
|
||||
add_library(Poco::Net ALIAS Net)
|
||||
set_target_properties( Net
|
||||
PROPERTIES
|
||||
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
|
||||
OUTPUT_NAME ${POCO_LIBNAME}
|
||||
OUTPUT_NAME PocoNet
|
||||
DEFINE_SYMBOL Net_EXPORTS
|
||||
)
|
||||
|
||||
target_link_libraries( "${LIBNAME}" Foundation ${SYSLIBS})
|
||||
target_include_directories( "${LIBNAME}"
|
||||
target_link_libraries(Net PUBLIC Poco::Foundation)
|
||||
# Windows and WindowsCE need additional libraries
|
||||
if(WIN32)
|
||||
target_link_libraries(Net PUBLIC "iphlpapi.lib")
|
||||
if(WINCE)
|
||||
target_link_libraries(Net PUBLIC "ws2.lib")
|
||||
else()
|
||||
target_link_libraries(Net PUBLIC "ws2_32.lib")
|
||||
endif()
|
||||
endif(WIN32)
|
||||
|
||||
target_include_directories(Net
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS})
|
||||
|
||||
POCO_INSTALL("${LIBNAME}")
|
||||
POCO_GENERATE_PACKAGE("${LIBNAME}")
|
||||
POCO_INSTALL(Net)
|
||||
POCO_GENERATE_PACKAGE(Net)
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
add_subdirectory(samples)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "EchoServer")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoNet PocoUtil PocoJSON PocoXML PocoFoundation )
|
||||
add_executable(EchoServer src/EchoServer.cpp)
|
||||
target_link_libraries(EchoServer PUBLIC Poco::Net Poco::Util Poco::JSON)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "HTTPFormServer")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoNet PocoUtil PocoJSON PocoXML PocoFoundation )
|
||||
add_executable(HTTPFormServer src/HTTPFormServer.cpp)
|
||||
target_link_libraries(HTTPFormServer PUBLIC Poco::Net Poco::Util Poco::JSON)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "HTTPLoadTest")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoNet PocoUtil PocoJSON PocoXML PocoFoundation )
|
||||
add_executable(HTTPLoadTest src/HTTPLoadTest.cpp)
|
||||
target_link_libraries(HTTPLoadTest PUBLIC Poco::Net Poco::Util Poco::JSON)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "HTTPTimeServer")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoNet PocoUtil PocoJSON PocoXML PocoFoundation )
|
||||
add_executable(HTTPTimeServer src/HTTPTimeServer.cpp)
|
||||
target_link_libraries(HTTPTimeServer PUBLIC Poco::Net Poco::Util Poco::JSON)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "Mail")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoNet PocoUtil PocoJSON PocoXML PocoFoundation )
|
||||
add_executable(Mail src/Mail.cpp)
|
||||
target_link_libraries(Mail PUBLIC Poco::Net Poco::Util Poco::JSON)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "Ping")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoNet PocoUtil PocoJSON PocoXML PocoFoundation )
|
||||
add_executable(Ping src/Ping.cpp)
|
||||
target_link_libraries(Ping PUBLIC Poco::Net Poco::Util Poco::JSON)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "SMTPLogger")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoNet PocoUtil PocoJSON PocoXML PocoFoundation )
|
||||
add_executable(SMTPLogger src/SMTPLogger.cpp)
|
||||
target_link_libraries(SMTPLogger PUBLIC Poco::Net)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "TimeServer")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoNet PocoUtil PocoJSON PocoXML PocoFoundation )
|
||||
add_executable(TimeServer src/TimeServer.cpp)
|
||||
target_link_libraries(TimeServer PUBLIC Poco::Net Poco::Util Poco::JSON)
|
||||
|
@ -1,10 +1,5 @@
|
||||
set(SAMPLE_NAME "WebSocketServer")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
add_executable(WebSocketServer src/WebSocketServer.cpp)
|
||||
if(WINCE)
|
||||
set_target_properties( ${SAMPLE_NAME} PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup")
|
||||
set_target_properties(WebSocketServer PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup")
|
||||
endif()
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoNet PocoUtil PocoJSON PocoXML PocoFoundation )
|
||||
target_link_libraries(WebSocketServer PUBLIC Poco::Net Poco::Util Poco::JSON)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "dict")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoNet PocoUtil PocoJSON PocoXML PocoFoundation )
|
||||
add_executable(dict src/dict.cpp)
|
||||
target_link_libraries(dict PUBLIC Poco::Net Poco::Util Poco::JSON)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "download")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoNet PocoUtil PocoJSON PocoXML PocoFoundation )
|
||||
add_executable(download src/download.cpp)
|
||||
target_link_libraries(download PUBLIC Poco::Net Poco::Util Poco::JSON)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "httpget")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoNet PocoUtil PocoJSON PocoXML PocoFoundation )
|
||||
add_executable(httpget src/httpget.cpp)
|
||||
target_link_libraries(httpget PUBLIC Poco::Net Poco::Util Poco::JSON)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "ifconfig")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoNet PocoUtil PocoJSON PocoXML PocoFoundation )
|
||||
add_executable(ifconfig src/ifconfig.cpp)
|
||||
target_link_libraries(ifconfig PUBLIC Poco::Net)
|
||||
|
@ -1,5 +1,3 @@
|
||||
set(TESTUNIT "${LIBNAME}-testrunner")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
|
||||
@ -16,11 +14,11 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
|
||||
src/WinCEDriver.cpp
|
||||
)
|
||||
|
||||
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
||||
add_executable(Net-testrunner ${TEST_SRCS} )
|
||||
if(ANDROID)
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/${TESTUNIT} -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake)
|
||||
add_test(NAME Net WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/Net-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake)
|
||||
else()
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
|
||||
add_test(NAME Net WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND Net-testrunner -all)
|
||||
endif()
|
||||
target_link_libraries( ${TESTUNIT} PocoNet PocoUtil PocoXML PocoFoundation CppUnit)
|
||||
target_link_libraries(Net-testrunner PUBLIC Poco::Net Poco::Util Poco::XML CppUnit)
|
||||
|
@ -1,6 +1,3 @@
|
||||
set(LIBNAME "NetSSL")
|
||||
set(POCO_LIBNAME "Poco${LIBNAME}")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
@ -9,26 +6,25 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
file(GLOB_RECURSE HDRS_G "include/*.h" )
|
||||
POCO_HEADERS_AUTO( SRCS ${HDRS_G})
|
||||
|
||||
add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} )
|
||||
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
|
||||
set_target_properties( "${LIBNAME}"
|
||||
add_library(NetSSL ${SRCS} )
|
||||
add_library(Poco::NetSSL ALIAS NetSSL)
|
||||
set_target_properties( NetSSL
|
||||
PROPERTIES
|
||||
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
|
||||
OUTPUT_NAME ${POCO_LIBNAME}
|
||||
OUTPUT_NAME PocoNetSSL
|
||||
DEFINE_SYMBOL NetSSL_EXPORTS
|
||||
)
|
||||
|
||||
target_link_libraries( "${LIBNAME}" Crypto Net Util Foundation ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} )
|
||||
target_include_directories( "${LIBNAME}"
|
||||
target_link_libraries(NetSSL PUBLIC Poco::Crypto Poco::Net Poco::Util)
|
||||
target_include_directories(NetSSL
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS})
|
||||
|
||||
POCO_INSTALL("${LIBNAME}")
|
||||
POCO_GENERATE_PACKAGE("${LIBNAME}")
|
||||
POCO_INSTALL(NetSSL)
|
||||
POCO_GENERATE_PACKAGE(NetSSL)
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
add_subdirectory(samples)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "HTTPSTimeServer")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoNetSSL PocoCrypto PocoUtil PocoNet PocoXML PocoFoundation )
|
||||
add_executable(HTTPSTimeServer src/HTTPSTimeServer.cpp)
|
||||
target_link_libraries(HTTPSTimeServer PUBLIC Poco::NetSSL Poco::Util Poco::XML)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "Mail-ssl")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoNetSSL PocoCrypto PocoUtil PocoNet PocoXML PocoFoundation )
|
||||
add_executable(Mail-ssl src/Mail.cpp)
|
||||
target_link_libraries(Mail-ssl PUBLIC Poco::NetSSL Poco::Util Poco::XML)
|
||||
|
@ -1,7 +1,5 @@
|
||||
set(SAMPLE_NAME "TwitterCLient")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoNetSSL PocoCrypto PocoNet PocoUtil PocoJSON PocoXML PocoFoundation )
|
||||
add_executable(TwitterCLient
|
||||
src/TweetApp.cpp
|
||||
src/Twitter.cpp
|
||||
)
|
||||
target_link_libraries(TwitterCLient PUBLIC Poco::NetSSL Poco::Util Poco::JSON Poco::XML)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "download-ssl")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoNetSSL PocoCrypto PocoUtil PocoNet PocoXML PocoFoundation )
|
||||
add_executable(download-ssl src/download.cpp)
|
||||
target_link_libraries(download-ssl PUBLIC Poco::NetSSL Poco::Util Poco::XML)
|
||||
|
@ -1,5 +1,3 @@
|
||||
set(TESTUNIT "${LIBNAME}-testrunner")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
|
||||
@ -16,18 +14,18 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
|
||||
src/WinCEDriver.cpp
|
||||
)
|
||||
|
||||
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
||||
add_executable(NetSSL-testrunner ${TEST_SRCS} )
|
||||
if(ANDROID)
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} "-DTEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/any.pem;${CMAKE_CURRENT_SOURCE_DIR}/rootcert.pem;${CMAKE_CURRENT_SOURCE_DIR}/testrunner.xml" -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/${TESTUNIT} -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake)
|
||||
add_test(NAME NetSSL WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} "-DTEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/any.pem;${CMAKE_CURRENT_SOURCE_DIR}/rootcert.pem;${CMAKE_CURRENT_SOURCE_DIR}/testrunner.xml" -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/NetSSL-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake)
|
||||
else()
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${TESTUNIT} -all)
|
||||
add_test(NAME NetSSL WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND NetSSL-testrunner -all)
|
||||
# The test is run in the build directory. So the test data is copied there too
|
||||
add_custom_command(TARGET ${TESTUNIT} POST_BUILD
|
||||
add_custom_command(TARGET NetSSL-testrunner POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/any.pem ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/rootcert.pem ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/testrunner.xml ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTUNIT}.xml
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/testrunner.xml ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/NetSSL-testrunner.xml
|
||||
)
|
||||
endif()
|
||||
target_link_libraries( ${TESTUNIT} PocoNetSSL PocoCrypto PocoNet PocoUtil PocoXML PocoFoundation CppUnit)
|
||||
target_link_libraries(NetSSL-testrunner PUBLIC Poco::NetSSL Poco::Util Poco::XML CppUnit)
|
||||
|
||||
|
@ -1,6 +1,3 @@
|
||||
set(LIBNAME "NetSSLWin")
|
||||
set(POCO_LIBNAME "Poco${LIBNAME}")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
@ -9,26 +6,25 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
file(GLOB_RECURSE HDRS_G "include/*.h" )
|
||||
POCO_HEADERS_AUTO( SRCS ${HDRS_G})
|
||||
|
||||
add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} )
|
||||
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
|
||||
set_target_properties( "${LIBNAME}"
|
||||
add_library(NetSSLWin ${SRCS})
|
||||
add_library(Poco::NetSSLWin ALIAS NetSSLWin)
|
||||
set_target_properties(NetSSLWin
|
||||
PROPERTIES
|
||||
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
|
||||
OUTPUT_NAME ${POCO_LIBNAME}
|
||||
OUTPUT_NAME PocoNetSSLWin
|
||||
DEFINE_SYMBOL NetSSL_Win_EXPORTS
|
||||
)
|
||||
|
||||
target_link_libraries( "${LIBNAME}" Net Util Foundation Crypt32.lib )
|
||||
target_include_directories( "${LIBNAME}"
|
||||
target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util Crypt32.lib)
|
||||
target_include_directories(NetSSLWin
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS})
|
||||
|
||||
POCO_INSTALL("${LIBNAME}")
|
||||
POCO_GENERATE_PACKAGE("${LIBNAME}")
|
||||
POCO_INSTALL(NetSSLWin)
|
||||
POCO_GENERATE_PACKAGE(NetSSLWin)
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
#TODO: Looks like the samples use crypto somehow?
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "HTTPSTimeServer-win")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoNetSSLWin PocoCrypto PocoUtil PocoNet PocoXML PocoFoundation )
|
||||
add_executable(HTTPSTimeServer-win src/HTTPSTimeServer.cpp)
|
||||
target_link_libraries(HTTPSTimeServer-win PUBLIC Poco::NetSSLWin Poco::Crypto Poco::XML)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "Mail-ssl-win")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoNetSSLWin PocoCrypto PocoUtil PocoNet PocoXML PocoFoundation )
|
||||
add_executable(Mail-ssl-win src/Mail.cpp)
|
||||
target_link_libraries(Mail-ssl-win PUBLIC Poco::NetSSLWin Poco::Crypto Poco::XML)
|
||||
|
@ -1,7 +1,7 @@
|
||||
set(SAMPLE_NAME "download-ssl-win")
|
||||
set(SAMPLE_NAME "")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoNetSSLWin PocoCrypto PocoUtil PocoNet PocoXML PocoFoundation )
|
||||
add_executable(download-ssl-win src/download.cpp)
|
||||
target_link_libraries(download-ssl-win PUBLIC Poco::NetSSLWin Poco::Crypto Poco::XML)
|
||||
|
@ -1,5 +1,3 @@
|
||||
set(TESTUNIT "${LIBNAME}-testrunner")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
|
||||
@ -16,13 +14,13 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
|
||||
src/WinCEDriver.cpp
|
||||
)
|
||||
|
||||
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${TESTUNIT} -all)
|
||||
target_link_libraries( ${TESTUNIT} PocoNetSSL PocoCrypto PocoNet PocoUtil PocoXML PocoFoundation CppUnit)
|
||||
add_executable(NetSSLWin-testrunner ${TEST_SRCS} )
|
||||
add_test(NAME NetSSLWin WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND NetSSLWin-testrunner -all)
|
||||
target_link_libraries(NetSSLWin-testrunner PUBLIC Poco::NetSSL Poco::Util Poco::XML CppUnit)
|
||||
|
||||
# The test is run in the build directory. So the test data is copied there too
|
||||
add_custom_command(TARGET ${TESTUNIT} POST_BUILD
|
||||
add_custom_command(TARGET NetSSLWin-testrunner POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/any.pem ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/rootcert.pem ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/testrunner.xml ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTUNIT}.xml
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/testrunner.xml ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/NetSSLWin.xml
|
||||
)
|
||||
|
@ -1,6 +1,3 @@
|
||||
set(LIBNAME "PDF")
|
||||
set(POCO_LIBNAME "Poco${LIBNAME}")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
@ -13,8 +10,6 @@ POCO_HEADERS_AUTO( SRCS ${HDRS_G})
|
||||
# The configuration will fail if the packages are not found
|
||||
if (POCO_UNBUNDLED)
|
||||
find_package(ZLIB REQUIRED)
|
||||
set(SYSLIBS ${SYSLIBS} ${ZLIB_LIBRARIES})
|
||||
include_directories(${ZLIB_INCLUDE_DIRS})
|
||||
else()
|
||||
# zlib
|
||||
POCO_SOURCES( SRCS zlib
|
||||
@ -121,26 +116,30 @@ POCO_SOURCES( SRCS libpng
|
||||
#TODO: Can we put this with the below includes? PRIVAT eg.
|
||||
include_directories( "include/Poco/PDF" ) # zip src
|
||||
|
||||
add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} )
|
||||
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
|
||||
set_target_properties( "${LIBNAME}"
|
||||
add_library(PDF ${SRCS} )
|
||||
add_library(Poco::PDF ALIAS PDF)
|
||||
set_target_properties(PDF
|
||||
PROPERTIES
|
||||
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
|
||||
OUTPUT_NAME ${POCO_LIBNAME}
|
||||
OUTPUT_NAME PocoPDF
|
||||
DEFINE_SYMBOL PDF_EXPORTS
|
||||
)
|
||||
|
||||
target_link_libraries( "${LIBNAME}" ${SYSLIBS} XML Util Foundation )
|
||||
target_include_directories( "${LIBNAME}"
|
||||
target_link_libraries(PDF PUBLIC ${ZLIB_LIBRARIES} Poco::XML Poco::Util)
|
||||
target_include_directories(PDF
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS})
|
||||
|
||||
POCO_INSTALL("${LIBNAME}")
|
||||
POCO_GENERATE_PACKAGE("${LIBNAME}")
|
||||
if (POCO_UNBUNDLED)
|
||||
target_include_directories(PDF PUBLIC "${ZLIB_INCLUDE_DIRS}")
|
||||
target_compile_definitions(PDF PUBLIC POCO_UNBUNDLED)
|
||||
endif()
|
||||
|
||||
POCO_INSTALL(PDF)
|
||||
POCO_GENERATE_PACKAGE(PDF)
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
add_subdirectory(samples)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "Image")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoPDF PocoUtil PocoXML PocoFoundation )
|
||||
add_executable(Image src/Image.cpp)
|
||||
target_link_libraries(Image PUBLIC Poco::PDF)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "Template")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoPDF PocoUtil PocoXML PocoFoundation )
|
||||
add_executable(Template src/Template.cpp)
|
||||
target_link_libraries(Template PUBLIC Poco::PDF)
|
||||
|
@ -1,7 +1,2 @@
|
||||
set(SAMPLE_NAME "Text")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoPDF PocoUtil PocoXML PocoFoundation )
|
||||
add_executable(Text src/Text.cpp)
|
||||
target_link_libraries(Text PUBLIC Poco::PDF)
|
||||
|
@ -1,5 +1,3 @@
|
||||
set(TESTUNIT "${LIBNAME}-testrunner")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
|
||||
@ -12,11 +10,11 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF
|
||||
src/WinDriver.cpp
|
||||
)
|
||||
|
||||
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
||||
add_executable(PDF-testrunner ${TEST_SRCS} )
|
||||
if(ANDROID)
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/${TESTUNIT} -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake)
|
||||
add_test(NAME PDF WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/PDF-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake)
|
||||
else()
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
|
||||
add_test(NAME PDF WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND PDF-testrunner -all)
|
||||
endif()
|
||||
target_link_libraries( ${TESTUNIT} PocoPDF PocoFoundation CppUnit )
|
||||
target_link_libraries(PDF-testrunner PUBLIC Poco::PDF CppUnit )
|
||||
|
@ -4,16 +4,16 @@ set(POCO_EXENAME "PageCompiler")
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
|
||||
add_executable( "${POCO_EXENAME}" ${SRCS} )
|
||||
set_target_properties( "${POCO_EXENAME}"
|
||||
add_executable(PageCompiler ${SRCS} )
|
||||
set_target_properties(PageCompiler
|
||||
PROPERTIES
|
||||
OUTPUT_NAME cpspc
|
||||
)
|
||||
|
||||
target_link_libraries( "${POCO_EXENAME}" Net Util XML JSON Foundation)
|
||||
target_link_libraries(PageCompiler PUBLIC Poco::Net Poco::Util)
|
||||
|
||||
install(
|
||||
TARGETS "${POCO_EXENAME}" EXPORT "${POCO_EXENAME}Targets"
|
||||
TARGETS PageCompiler EXPORT PageCompilerTargets
|
||||
LIBRARY DESTINATION lib${LIB_SUFFIX}
|
||||
ARCHIVE DESTINATION lib${LIB_SUFFIX}
|
||||
RUNTIME DESTINATION bin
|
||||
|
@ -1,19 +1,17 @@
|
||||
set(POCO_EXENAME "File2Page")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
|
||||
add_executable( "${POCO_EXENAME}" ${SRCS} )
|
||||
set_target_properties( "${POCO_EXENAME}"
|
||||
add_executable(File2Page ${SRCS} )
|
||||
set_target_properties(File2Page
|
||||
PROPERTIES
|
||||
OUTPUT_NAME f2cpsp
|
||||
)
|
||||
|
||||
target_link_libraries( "${POCO_EXENAME}" Net Util XML JSON Foundation)
|
||||
target_link_libraries(File2Page PUBLIC Poco::Util)
|
||||
|
||||
install(
|
||||
TARGETS "${POCO_EXENAME}" EXPORT "${POCO_EXENAME}Targets"
|
||||
TARGETS File2Page EXPORT File2PageTargets
|
||||
LIBRARY DESTINATION lib${LIB_SUFFIX}
|
||||
ARCHIVE DESTINATION lib${LIB_SUFFIX}
|
||||
RUNTIME DESTINATION bin
|
||||
|
@ -1,15 +1,13 @@
|
||||
set(POCO_EXENAME "PocoDoc")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
|
||||
add_executable( "${POCO_EXENAME}" ${SRCS} )
|
||||
add_executable(PocoDoc ${SRCS} )
|
||||
|
||||
target_link_libraries( "${POCO_EXENAME}" Util XML Foundation CppParser)
|
||||
target_link_libraries(PocoDoc PUBLIC Poco::Util Poco::XML Poco::CppParser)
|
||||
|
||||
install(
|
||||
TARGETS "${POCO_EXENAME}" EXPORT "${POCO_EXENAME}Targets"
|
||||
TARGETS PocoDoc EXPORT PocoDocTargets
|
||||
LIBRARY DESTINATION lib${LIB_SUFFIX}
|
||||
ARCHIVE DESTINATION lib${LIB_SUFFIX}
|
||||
RUNTIME DESTINATION bin
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user