mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-poco.git
synced 2025-10-29 09:42:31 +00:00
Cleanup cmake build system (develop) to use transitive dependency management from cmake (#2322)
* Cleanup cmake Root CMakeLists.txt
* Cleanup cmake targets
* Add find openssl modul for older cmake version
* set proper scope
* Switch off make based builds in travis and appveyor
* Fix build break, set C11 on c file
* Set from C11 to C99
* Fix NetSSL win build
* Set C99 compile features
* Fix Windows build
* Fix windows build
* Revert "Fix windows build"
This reverts commit 678d44216bd964f61655df809efbf63ddd8a7bfd.
* Cleanup poco unbundle definition
* Fix PDF build
* Remove unused set affinity
* Add _AFXDLL as target compile definitions
* 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
* cleanup LIB_MODE_DEFINITIONS in cmake buld system
* Fix broken merge
* Fix android foundation test
* Fix old redis build version
* Fix android fondation test
* Cleanup target link libraries.
* Update cmake documentation
* Some fixese in crypto and netssl for win and some cleanup an SQL
* Minor fix in root CMakeList.txt
* Squashed commit of the following:
commit df050b56b6d81eaf9bdb37bb016fe9a3554eba4f
Fix build dependecies in cmake
* Squashed commit of the following:
commit f41ce2bb404e197ff04b1e64f7b66c9a2b1e03c8
Fix PostgreSQL build
* Squashed commit of the following:
commit b7da0deed67ffff23a8b7a50d6deff1e022b2577
Set db hostnames
* Update doc
* Update cmake build commands
* Set public on target link libraries in cmake build
* Fix broken cppunit merge
This commit is contained in:
committed by
Aleksandar Fabijanic
parent
89e9d684ef
commit
8a70ab8a1c
@@ -16,7 +16,7 @@ before_install:
|
||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update -qq; fi
|
||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq -y libpcre3-dev libssl-dev libexpat1-dev; fi
|
||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq -y libpq-dev unixodbc-dev libmysqlclient-dev libsqlite3-dev; fi
|
||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq -y sloccount cppcheck; fi
|
||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq -y sloccount cppcheck ninja-build; fi
|
||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; 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 gcc-5 g++-5; fi
|
||||
@@ -113,7 +113,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" -DPOCO_ENABLE_TESTS=ON -DPOCO_ENABLE_LONG_RUNNING_TESTS=OFF -DPOCO_OLD_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" -DPOCO_ENABLE_TESTS=ON -DPOCO_ENABLE_LONG_RUNNING_TESTS=OFF -DPOCO_OLD_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="android API level 24"
|
||||
language: android
|
||||
@@ -160,7 +160,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" -DPOCO_ENABLE_TESTS=ON -DPOCO_ENABLE_LONG_RUNNING_TESTS=OFF -DPOCO_OLD_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" -DPOCO_ENABLE_TESTS=ON -DPOCO_ENABLE_LONG_RUNNING_TESTS=OFF -DPOCO_OLD_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="x86 (make) bundled"
|
||||
os: osx
|
||||
@@ -319,8 +319,7 @@ matrix:
|
||||
- $CXX --version
|
||||
- source ./travis/ignored.sh
|
||||
- export POCO_BASE=`pwd`
|
||||
- mkdir cmake-build
|
||||
- cd cmake-build && cmake -DPOCO_ENABLE_PDF=OFF -DPOCO_ENABLE_NETSSL=OFF -DPOCO_ENABLE_CRYPTO=OFF -DPOCO_ENABLE_TESTS=ON .. && make -s -j2 && cd ..
|
||||
- cmake -H. -Bcmake-build -GNinja -DPOCO_ENABLE_PDF=OFF -DPOCO_ENABLE_NETSSL=OFF -DPOCO_ENABLE_CRYPTO=OFF -DPOCO_ENABLE_TESTS=ON && cmake --build cmake-build --target all
|
||||
|
||||
|
||||
# QA jobs for code analytics and metrics
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
set(LIBNAME "mod_poco")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
@@ -8,18 +6,18 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
file(GLOB_RECURSE HDRS_G "include/*.h" )
|
||||
POCO_HEADERS_AUTO( SRCS ${HDRS_G})
|
||||
|
||||
add_library( "${LIBNAME}" ${SRCS} )
|
||||
set_target_properties( "${LIBNAME}"
|
||||
add_library(mod_poco ${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 (POCO_ENABLE_SAMPLES)
|
||||
add_subdirectory(samples)
|
||||
|
||||
@@ -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)
|
||||
|
||||
236
CMakeLists.txt
236
CMakeLists.txt
@@ -1,13 +1,3 @@
|
||||
# POCO_BUILD_TYPE
|
||||
# POCO_STATIC
|
||||
# POCO_UNBUNDLED
|
||||
# POCO_NO_LOCALE
|
||||
#
|
||||
# POCO_ENABLE_{COMPONENT}
|
||||
# POCO_ENABLE_TESTS
|
||||
# POCO_ENABLE_SAMPLES
|
||||
# POCO_DISABLE_INTERNAL_OPENSSL
|
||||
|
||||
cmake_minimum_required(VERSION 3.2.0)
|
||||
|
||||
project(Poco)
|
||||
@@ -15,20 +5,18 @@ project(Poco)
|
||||
option(POCO_VERBOSE_MESSAGES "Enable informational messages during configure" ON)
|
||||
|
||||
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 )
|
||||
if(POCO_VERBOSE_MESSAGES)
|
||||
message(STATUS "Poco package version: ${PACKAGE_VERSION}")
|
||||
endif()
|
||||
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)
|
||||
|
||||
if(POCO_VERBOSE_MESSAGES)
|
||||
message(STATUS "Poco package version: ${PROJECT_VERSION}")
|
||||
endif()
|
||||
|
||||
# Put the libaries and binaries that get built into directories at the
|
||||
# top of the build tree rather than in hard-to-find leaf
|
||||
@@ -41,12 +29,15 @@ 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)
|
||||
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_CPP14 "Disable C++14 if available" OFF)
|
||||
|
||||
if (DISABLE_CPP14)
|
||||
@@ -62,15 +53,8 @@ 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()
|
||||
endif()
|
||||
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "")
|
||||
set( CMAKE_BUILD_TYPE "RelWithDebInfo" )
|
||||
if (NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
|
||||
endif()
|
||||
|
||||
# Include some common macros to simpilfy Poco CMake files
|
||||
@@ -91,7 +75,7 @@ option(POCO_ENABLE_WSTRING "Enable std::wstring support" ON)
|
||||
option(POCO_ENABLE_FPENVIRONMENT "Enable floating-point support" ON)
|
||||
|
||||
if(POCO_STATIC)
|
||||
message(WARNING "POCO_STATIC is deprecated and will be removed! Use BUILD_SHARED_LIBS instead")
|
||||
message(DEPRECATION "POCO_STATIC is deprecated and will be removed! Use BUILD_SHARED_LIBS instead")
|
||||
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
|
||||
else()
|
||||
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
|
||||
@@ -129,16 +113,14 @@ if(POCO_ENABLE_NETSSL OR POCO_ENABLE_CRYPTO)
|
||||
find_package(OpenSSL REQUIRED)
|
||||
else()
|
||||
find_package(OpenSSL QUIET)
|
||||
endif(POCO_ENABLE_NETSSL OR POCO_ENABLE_CRYPTO)
|
||||
endif()
|
||||
|
||||
if(OPENSSL_FOUND)
|
||||
message(STATUS "Found OpenSSL")
|
||||
message(STATUS "Enable NetSSL and Crypto support")
|
||||
message(STATUS "Found OpenSSL. Enable NetSSL and Crypto support")
|
||||
option(POCO_ENABLE_NETSSL "Enable NetSSL" ON)
|
||||
option(POCO_ENABLE_CRYPTO "Enable Crypto" ON)
|
||||
else()
|
||||
message(STATUS "OpenSSL not found")
|
||||
message(STATUS "Disable NetSSL and Crypto support")
|
||||
message(STATUS "OpenSSL not found. Disable NetSSL and Crypto support")
|
||||
option(POCO_ENABLE_NETSSL "Enable NetSSL" OFF)
|
||||
option(POCO_ENABLE_CRYPTO "Enable Crypto" OFF)
|
||||
endif()
|
||||
@@ -148,14 +130,68 @@ if(WIN32)
|
||||
else()
|
||||
option(POCO_ENABLE_NETSSL_WIN "NetSSL Windows" OFF)
|
||||
endif()
|
||||
option(POCO_ENABLE_SQL "Enable SQL" ON)
|
||||
option(POCO_ENABLE_SQL_SQLITE "Enable SQL SQLite" ON)
|
||||
option(POCO_ENABLE_SQL_MYSQL "Enable SQL MySQL" ON)
|
||||
option(POCO_ENABLE_SQL_POSTGRESQL "Enable SQL PosgreSQL" ON)
|
||||
option(POCO_ENABLE_SQL_ODBC "Enable SQL ODBC" ON)
|
||||
|
||||
if(POCO_ENABLE_APACHECONNECTOR)
|
||||
find_package(APR REQUIRED)
|
||||
find_package(Apache2 REQUIRED)
|
||||
else()
|
||||
find_package(APR QUIET)
|
||||
find_package(Apache2 QUIET)
|
||||
endif()
|
||||
|
||||
if(APRUTIL_FOUND AND APACHE_FOUND)
|
||||
message(STATUS "Found Apache and APR. Enable Apache connector")
|
||||
option(POCO_ENABLE_APACHECONNECTOR "Enable ApacheConnector" ON)
|
||||
else()
|
||||
message(STATUS "Apache and APR not found. Enable Apache connector")
|
||||
option(POCO_ENABLE_APACHECONNECTOR "Enable ApacheConnector" OFF)
|
||||
endif()
|
||||
|
||||
if(POCO_ENABLE_SQL_MYSQL)
|
||||
find_package(MySQL REQUIRED)
|
||||
else()
|
||||
find_package(MySQL QUIET)
|
||||
endif()
|
||||
|
||||
if(MYSQL_FOUND)
|
||||
option(POCO_ENABLE_SQL "Enable SQL" ON)
|
||||
option(POCO_ENABLE_SQL_MYSQL "Enable SQL MySQL" ON)
|
||||
else()
|
||||
option(POCO_ENABLE_SQL "Enable SQL" OFF)
|
||||
option(POCO_ENABLE_SQL_MYSQL "Enable SQL MySQL" OFF)
|
||||
endif()
|
||||
|
||||
if(POCO_ENABLE_SQL_POSTGRESQL)
|
||||
find_package(PostgreSQL REQUIRED)
|
||||
else()
|
||||
find_package(PostgreSQL QUIET)
|
||||
endif()
|
||||
|
||||
if(POSTGRESQL_FOUND)
|
||||
option(POCO_ENABLE_SQL "Enable SQL" ON)
|
||||
option(POCO_ENABLE_SQL_POSTGRESQL "Enable SQL PosgreSQL" ON)
|
||||
else()
|
||||
option(POCO_ENABLE_SQL "Enable SQL" OFF)
|
||||
option(POCO_ENABLE_SQL_POSTGRESQL "Enable SQL PosgreSQL" OFF)
|
||||
endif()
|
||||
|
||||
if(POCO_ENABLE_SQL_ODBC)
|
||||
find_package(ODBC REQUIRED)
|
||||
else()
|
||||
find_package(ODBC QUIET)
|
||||
endif()
|
||||
|
||||
if(ODBC_FOUND)
|
||||
option(POCO_ENABLE_SQL "Enable SQL" ON)
|
||||
option(POCO_ENABLE_SQL_ODBC "Enable SQL ODBC" ON)
|
||||
else()
|
||||
option(POCO_ENABLE_SQL "Enable SQL" OFF)
|
||||
option(POCO_ENABLE_SQL_ODBC "Enable SQL ODBC" OFF)
|
||||
endif()
|
||||
|
||||
option(POCO_ENABLE_SQL_SQLITE "Enable SQL SQLite" OFF)
|
||||
option(POCO_ENABLE_SEVENZIP "Enable SevenZip" OFF)
|
||||
option(POCO_ENABLE_ZIP "Enable Zip" ON)
|
||||
option(POCO_ENABLE_APACHECONNECTOR "Enable ApacheConnector" OFF)
|
||||
option(POCO_ENABLE_CPPPARSER "Enable C++ parser" OFF)
|
||||
option(POCO_ENABLE_POCODOC "Enable Poco Documentation Generator" OFF)
|
||||
option(POCO_ENABLE_PAGECOMPILER "Enable PageCompiler" ON)
|
||||
@@ -179,20 +215,18 @@ 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(BUILD_SHARED_LIBS)
|
||||
if(POCO_VERBOSE_MESSAGES)
|
||||
message(STATUS "Building dynamic libraries")
|
||||
endif()
|
||||
else(BUILD_SHARED_LIBS)
|
||||
set(LIB_MODE_DEFINITIONS -DPOCO_STATIC)
|
||||
if(POCO_VERBOSE_MESSAGES)
|
||||
message(STATUS "Building static libraries")
|
||||
endif()
|
||||
endif(BUILD_SHARED_LIBS)
|
||||
|
||||
if (POCO_ENABLE_TESTS)
|
||||
option(ENABLE_LONG_RUNNING_TESTS "Enable long running test" ON)
|
||||
option(POCO_ENABLE_LONG_RUNNING_TESTS "Enable long running test" ON)
|
||||
include(CTest)
|
||||
enable_testing()
|
||||
if(POCO_VERBOSE_MESSAGES)
|
||||
@@ -211,7 +245,6 @@ elseif (POCO_VERBOSE_MESSAGES)
|
||||
endif ()
|
||||
|
||||
if (POCO_UNBUNDLED)
|
||||
add_definitions( -DPOCO_UNBUNDLED)
|
||||
if(POCO_VERBOSE_MESSAGES)
|
||||
message(STATUS "Build with using external sqlite, libz, pcre, expat ...")
|
||||
endif()
|
||||
@@ -221,12 +254,105 @@ endif ()
|
||||
|
||||
include(DefinePlatformSpecifc)
|
||||
|
||||
# Collect the built libraries and include dirs, the will be used to create the PocoConfig.cmake file
|
||||
set(Poco_COMPONENTS "")
|
||||
|
||||
# Pthreads/threads support
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
if(POCO_ENABLE_TESTS)
|
||||
set(POCO_ENABLE_XML ON CACHE BOOL "Enable XML" FORCE )
|
||||
set(POCO_ENABLE_JSON ON CACHE BOOL "Enable JSON" FORCE)
|
||||
|
||||
if(POCO_ENABLE_ZIP)
|
||||
set(POCO_ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(POCO_ENABLE_ENCODINGS_COMPILER OR POCO_ENABLE_APACHECONNECTOR)
|
||||
set(POCO_ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
|
||||
set(POCO_ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
endif()
|
||||
|
||||
if(POCO_ENABLE_PAGECOMPILER_FILE2PAGE)
|
||||
set(POCO_ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
endif()
|
||||
|
||||
if(POCO_ENABLE_PAGECOMPILER)
|
||||
set(POCO_ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
|
||||
set(POCO_ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
endif()
|
||||
|
||||
|
||||
if(POCO_ENABLE_MONGODB OR POCO_ENABLE_REDIS)
|
||||
set(POCO_ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
|
||||
endif()
|
||||
|
||||
if(POCO_ENABLE_SQL_SQLITE OR POCO_ENABLE_SQL_MYSQL OR POCO_ENABLE_SQL_ODBC OR POCO_ENABLE_SQL_POSTGRESQL)
|
||||
set(POCO_ENABLE_SQL ON CACHE BOOL "Enable Data" FORCE)
|
||||
if(POCO_ENABLE_TESTS)
|
||||
set(POCO_ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
|
||||
set(POCO_ENABLE_SQL_SQLITE ON CACHE BOOL "Enable Data SQlite" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(POCO_ENABLE_SQL AND POCO_ENABLE_SAMPLES)
|
||||
set(POCO_ENABLE_SQL_SQLITE ON CACHE BOOL "Enable Data SQlite" FORCE)
|
||||
endif()
|
||||
|
||||
if(POCO_ENABLE_NETSSL_WIN)
|
||||
set(POCO_ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
if(POCO_ENABLE_TESTS)
|
||||
set(POCO_ENABLE_CRYPTO ON CACHE BOOL "Enable Crypto" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(POCO_ENABLE_NETSSL)
|
||||
set(POCO_ENABLE_CRYPTO ON CACHE BOOL "Enable Crypto" FORCE)
|
||||
set(POCO_ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
|
||||
set(POCO_ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
endif()
|
||||
|
||||
if(POCO_ENABLE_CRYPTO AND POCO_ENABLE_TESTS)
|
||||
set(POCO_ENABLE_NETSSL ON CACHE BOOL "Enable NetSSL" FORCE)
|
||||
set(POCO_ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
|
||||
endif()
|
||||
|
||||
if(POCO_ENABLE_CRYPTO AND POCO_ENABLE_SAMPLES)
|
||||
set(POCO_ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
set(POCO_ENABLE_XML ON CACHE BOOL "Enable XML" FORCE)
|
||||
endif()
|
||||
|
||||
if(POCO_ENABLE_NET AND POCO_ENABLE_TESTS)
|
||||
set(POCO_ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
endif()
|
||||
|
||||
if(POCO_ENABLE_NET AND POCO_ENABLE_SAMPLES)
|
||||
set(POCO_ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
set(POCO_ENABLE_JSON ON CACHE BOOL "Enable JSON" FORCE)
|
||||
endif()
|
||||
|
||||
if(POCO_ENABLE_PDF)
|
||||
set(POCO_ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
set(POCO_ENABLE_XML ON CACHE BOOL "Enable XML" FORCE)
|
||||
endif()
|
||||
|
||||
if(POCO_ENABLE_POCODOC)
|
||||
set(POCO_ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
set(POCO_ENABLE_XML ON CACHE BOOL "Enable XML" FORCE)
|
||||
set(POCO_ENABLE_CPPPARSER ON CACHE BOOL "Enable C++ parser" FORCE)
|
||||
endif()
|
||||
|
||||
if(POCO_ENABLE_SEVENZIP OR POCO_ENABLE_ZIP)
|
||||
set(POCO_ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
|
||||
set(POCO_ENABLE_XML ON CACHE BOOL "Enable XML" FORCE)
|
||||
endif()
|
||||
|
||||
if(POCO_ENABLE_UTIL AND POCO_ENABLE_SAMPLES)
|
||||
set(POCO_ENABLE_JSON ON CACHE BOOL "Enable JSON" FORCE)
|
||||
set(POCO_ENABLE_XML ON CACHE BOOL "Enable XML" FORCE)
|
||||
endif()
|
||||
|
||||
# Collect the built libraries and include dirs, the will be used to create the PocoConfig.cmake file
|
||||
set(Poco_COMPONENTS "")
|
||||
|
||||
if (POCO_ENABLE_TESTS OR POCO_ENABLE_CPPUNIT)
|
||||
add_subdirectory(CppUnit)
|
||||
list(APPEND Poco_COMPONENTS "CppUnit")
|
||||
@@ -262,9 +388,6 @@ if(POCO_ENABLE_NET)
|
||||
list(APPEND Poco_COMPONENTS "Net")
|
||||
endif()
|
||||
|
||||
#NetSSL
|
||||
|
||||
|
||||
if(WIN32 AND POCO_ENABLE_NETSSL_WIN)
|
||||
add_subdirectory(NetSSL_Win)
|
||||
list(APPEND Poco_COMPONENTS "NetSSL_Win")
|
||||
@@ -272,9 +395,8 @@ endif(WIN32 AND POCO_ENABLE_NETSSL_WIN)
|
||||
|
||||
if(OPENSSL_FOUND)
|
||||
if(MSVC)
|
||||
list(APPEND OPENSSL_LIBRARIES ws2_32 Crypt32)
|
||||
list(APPEND OPENSSL_LIBRARIES ws2_32 Crypt32) # TODO(BJoe) Is this really needed?
|
||||
endif()
|
||||
include_directories("${OPENSSL_INCLUDE_DIR}")
|
||||
if(POCO_ENABLE_NETSSL)
|
||||
add_subdirectory(NetSSL_OpenSSL)
|
||||
list(APPEND Poco_COMPONENTS "NetSSL_OpenSSL")
|
||||
@@ -302,15 +424,11 @@ if(POCO_ENABLE_REDIS)
|
||||
list(APPEND Poco_COMPONENTS "Redis")
|
||||
endif()
|
||||
|
||||
find_package(APR)
|
||||
find_package(Apache2)
|
||||
if(APRUTIL_FOUND AND APACHE_FOUND)
|
||||
include_directories( "${APACHE_INCLUDE_DIR}" "${APRUTIL_INCLUDE_DIR}" )
|
||||
if(POCO_ENABLE_APACHECONNECTOR)
|
||||
if(APRUTIL_FOUND AND APACHE_FOUND AND POCO_ENABLE_APACHECONNECTOR)
|
||||
include_directories( "${APACHE_INCLUDE_DIR}" "${APRUTIL_INCLUDE_DIR}" ) # TODO(BJoe) Use namespace target in target_link_libraries()
|
||||
add_subdirectory(ApacheConnector)
|
||||
list(APPEND Poco_COMPONENTS "ApacheConnector")
|
||||
endif()
|
||||
endif(APRUTIL_FOUND AND APACHE_FOUND)
|
||||
endif()
|
||||
|
||||
if(POCO_ENABLE_CPPPARSER)
|
||||
add_subdirectory(CppParser)
|
||||
|
||||
@@ -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}" ${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 (POCO_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 PocoCppUnit )
|
||||
target_link_libraries(CppParser-testrunner PUBLIC Poco::CppParser Poco::CppUnit)
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
set(LIBNAME "CppUnit")
|
||||
set(POCO_LIBNAME "Poco${LIBNAME}")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
@@ -9,22 +6,28 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
file(GLOB_RECURSE HDRS_G "include/*.h" )
|
||||
POCO_HEADERS_AUTO( SRCS ${HDRS_G})
|
||||
|
||||
add_library( "${LIBNAME}" ${SRCS} )
|
||||
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
|
||||
set_target_properties( "${LIBNAME}"
|
||||
add_library(CppUnit ${SRCS})
|
||||
add_library(Poco::CppUnit ALIAS CppUnit)
|
||||
set_target_properties(CppUnit
|
||||
PROPERTIES
|
||||
VERSION "1" SOVERSION "1"
|
||||
OUTPUT_NAME ${POCO_LIBNAME}
|
||||
OUTPUT_NAME PocoCppUnit
|
||||
DEFINE_SYMBOL CppUnit_EXPORTS
|
||||
)
|
||||
target_link_libraries( "${LIBNAME}" Foundation)
|
||||
target_include_directories( "${LIBNAME}"
|
||||
target_link_libraries(CppUnit PUBLIC 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})
|
||||
|
||||
POCO_INSTALL("${LIBNAME}")
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(CppUnit
|
||||
PUBLIC
|
||||
POCO_STATIC
|
||||
)
|
||||
endif()
|
||||
|
||||
POCO_INSTALL(CppUnit)
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
set(LIBNAME "WinTestRunner")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( WIN_SRCS ${SRCS_G})
|
||||
@@ -11,24 +9,26 @@ 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}" ${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}" PocoCppUnit )
|
||||
target_include_directories( "${LIBNAME}"
|
||||
target_link_libraries(WinTestRunner PUBLIC Poco::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,37 +6,36 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
file(GLOB_RECURSE HDRS_G "include/*.h" )
|
||||
POCO_HEADERS_AUTO( SRCS ${HDRS_G})
|
||||
|
||||
add_library( "${LIBNAME}" ${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::SSL OpenSSL::Crypto )
|
||||
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})
|
||||
|
||||
if(MSVC AND POCO_DISABLE_INTERNAL_OPENSSL)
|
||||
target_compile_definitions("${LIBNAME}" PUBLIC POCO_EXTERNAL_OPENSSL)
|
||||
target_compile_definitions(Crypto PUBLIC POCO_EXTERNAL_OPENSSL)
|
||||
endif()
|
||||
|
||||
if(MSVC AND NOT POCO_DISABLE_INTERNAL_OPENSSL)
|
||||
add_custom_command(TARGET "${LIBNAME}" PRE_BUILD
|
||||
add_custom_command(TARGET Crypto PRE_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${INTERNAL_OPENSSL_LIBRARY_DIR} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
|
||||
COMMENT "Copying OpenSSL binaries" VERBATIM)
|
||||
endif(MSVC AND NOT POCO_DISABLE_INTERNAL_OPENSSL)
|
||||
|
||||
POCO_INSTALL("${LIBNAME}")
|
||||
POCO_GENERATE_PACKAGE("${LIBNAME}")
|
||||
POCO_INSTALL(Crypto)
|
||||
POCO_GENERATE_PACKAGE(Crypto)
|
||||
|
||||
if (POCO_ENABLE_TESTS)
|
||||
add_subdirectory(testsuite)
|
||||
|
||||
@@ -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,19 +14,19 @@ 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 PocoXML PocoUtil PocoFoundation PocoCppUnit )
|
||||
target_link_libraries(Crypto-testrunner PUBLIC Poco::NetSSL Poco::XML Poco::CppUnit)
|
||||
|
||||
if(MSVC AND NOT POCO_DISABLE_INTERNAL_OPENSSL)
|
||||
set_tests_properties(${LIBNAME} PROPERTIES ENVIRONMENT "PATH=%PATH%\;${INTERNAL_OPENSSL_PATH}")
|
||||
set_tests_properties(Crypto PROPERTIES ENVIRONMENT "PATH=%PATH%\;${INTERNAL_OPENSSL_PATH}")
|
||||
endif(MSVC AND NOT POCO_DISABLE_INTERNAL_OPENSSL)
|
||||
|
||||
if(UNIX AND NOT ANDROID)
|
||||
target_link_libraries( ${TESTUNIT} pthread)
|
||||
target_link_libraries(Crypto-testrunner PUBLIC pthread)
|
||||
endif(UNIX AND NOT ANDROID)
|
||||
|
||||
@@ -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,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,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,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 Poco::Util Poco::XML 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,28 +6,29 @@ 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 ${LIB_MODE} ${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 (POCO_ENABLE_TESTS)
|
||||
if(POCO_ENABLE_TESTS)
|
||||
add_subdirectory(testsuite)
|
||||
endif()
|
||||
if(POCO_ENABLE_SAMPLES)
|
||||
add_subdirectory(samples)
|
||||
add_subdirectory(testsuite)
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
@@ -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,15 @@ 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 PocoCppUnit )
|
||||
|
||||
#set_target_properties(Encodings-testrunner PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} )
|
||||
target_link_libraries(Encodings-testrunner PUBLIC Poco::Encodings Poco::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})
|
||||
@@ -36,8 +33,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
|
||||
@@ -45,9 +41,6 @@ if (POCO_UNBUNDLED)
|
||||
src/pcre_tables.c
|
||||
)
|
||||
|
||||
find_package(ZLIB REQUIRED)
|
||||
set(SYSLIBS ${SYSLIBS} ${ZLIB_LIBRARIES})
|
||||
include_directories(${ZLIB_INCLUDE_DIRS})
|
||||
else()
|
||||
# pcre
|
||||
POCO_SOURCES( SRCS pcre
|
||||
@@ -94,95 +87,158 @@ 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 POSIX threads on Unix
|
||||
if(UNIX AND NOT APPLE)
|
||||
# We still need pthreads on Unix
|
||||
set(SYSLIBS ${SYSLIBS} ${CMAKE_THREAD_LIBS_INIT})
|
||||
INCLUDE (CheckFunctionExists)
|
||||
INCLUDE (CheckCXXSourceCompiles)
|
||||
INCLUDE (CheckLibraryExists)
|
||||
CHECK_LIBRARY_EXISTS(pthread pthread_setaffinity_np "pthread.h" HAVE_PTHREAD_SETAFFINITY_NP)
|
||||
if(NOT HAVE_PTHREAD_SETAFFINITY_NP)
|
||||
if(POCO_VERBOSE_MESSAGES)
|
||||
message(STATUS "Platform has not PTHREAD_SETAFFINITY_NP")
|
||||
endif()
|
||||
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)
|
||||
if(POCO_VERBOSE_MESSAGES)
|
||||
message(STATUS "Platform has THREE PARAM at PTHREAD_SETAFFINITY_NP")
|
||||
endif()
|
||||
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)
|
||||
if(POCO_VERBOSE_MESSAGES)
|
||||
message(STATUS "Platform has TWO PARAM at PTHREAD_SETAFFINITY_NP")
|
||||
endif()
|
||||
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}" ${SRCS})
|
||||
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
|
||||
set_target_properties( "${LIBNAME}"
|
||||
add_library(Foundation ${LIB_MODE} ${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})
|
||||
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 UNICODE _UNICODE __LCC__) #__LCC__ define used by MySQL.h
|
||||
target_link_libraries(Foundation PUBLIC iphlpapi)
|
||||
endif(WIN32)
|
||||
|
||||
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 )
|
||||
# Standard 'must be' defines
|
||||
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)
|
||||
elseif(${CMAKE_SYSTEM} MATCHES "AIX")
|
||||
target_compile_definitions(Foundation PUBLIC __IBMCPP_TR1__)
|
||||
elseif(CMAKE_SYSTEM MATCHES "^FreeBSD")
|
||||
target_compile_definitions(Foundation
|
||||
PUBLIC
|
||||
_XOPEN_SOURCE=600
|
||||
__BSD_VISIBLE
|
||||
_REENTRANT
|
||||
_THREAD_SAFE
|
||||
_LARGEFILE64_SOURCE
|
||||
_FILE_OFFSET_BITS=64
|
||||
POCO_HAVE_IPv6
|
||||
POCO_HAVE_FD_POLL
|
||||
)
|
||||
target_link_libraries(Foundation PUBLIC pthread ${CMAKE_DL_LIBS} rt)
|
||||
else ()
|
||||
target_compile_definitions(Foundation PUBLIC _XOPEN_SOURCE=500 POCO_HAVE_FD_EPOLL)
|
||||
target_link_libraries(Foundation PUBLIC pthread ${CMAKE_DL_LIBS} rt)
|
||||
endif ()
|
||||
endif (APPLE)
|
||||
endif(UNIX AND NOT ANDROID )
|
||||
endif (CYGWIN)
|
||||
|
||||
if (CMAKE_SYSTEM MATCHES "SunOS")
|
||||
# Standard 'must be' defines
|
||||
target_compile_definitions(Foundation PUBLIC _REENTRANT _THREAD_SAFE _LARGEFILE64_SOURCE _FILE_OFFSET_BITS=64)
|
||||
target_compile_options(Foundation PUBLIC -m64 )
|
||||
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
|
||||
_WIN32
|
||||
MINGW32
|
||||
WINVER=0x500
|
||||
ODBCVER=0x0300
|
||||
POCO_THREAD_STACK_SIZE
|
||||
)
|
||||
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_SHAREDMEMORY )
|
||||
target_link_libraries(Foundation PUBLIC log)
|
||||
endif(ANDROID)
|
||||
|
||||
# IBM XLC for AIX
|
||||
if ((${CMAKE_CXX_COMPILER_ID} MATCHES "XL") AND (${CMAKE_SYSTEM} MATCHES "AIX"))
|
||||
target_compile_options(Foundation
|
||||
PUBLIC
|
||||
-qlanglvl=extended0x
|
||||
-qlanglvl=noconstexpr
|
||||
-qlanglvl=newexcp
|
||||
-qsuppress=1540-0198
|
||||
-qsuppress=1540-1628
|
||||
-qsuppress=1540-0095
|
||||
-qsuppress=1500-030
|
||||
)
|
||||
endif()
|
||||
|
||||
if(POCO_UNBUNDLED)
|
||||
target_include_directories(Foundation PUBLIC "${PCRE_INCLUDE_DIRS}" "${ZLIB_INCLUDE_DIRS}")
|
||||
target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED)
|
||||
endif()
|
||||
|
||||
if (NOT POCO_ENABLE_WSTRING)
|
||||
target_compile_definitions("${LIBNAME}" PUBLIC POCO_NO_WSTRING)
|
||||
target_compile_definitions(Foundation PUBLIC POCO_NO_WSTRING)
|
||||
endif()
|
||||
|
||||
if (NOT POCO_ENABLE_FPENVIRONMENT)
|
||||
target_compile_definitions("${LIBNAME}" PUBLIC POCO_NO_FPENVIRONMENT)
|
||||
target_compile_definitions(Foundation PUBLIC POCO_NO_FPENVIRONMENT)
|
||||
endif()
|
||||
|
||||
POCO_INSTALL("${LIBNAME}")
|
||||
POCO_GENERATE_PACKAGE("${LIBNAME}")
|
||||
POCO_INSTALL(Foundation)
|
||||
POCO_GENERATE_PACKAGE(Foundation)
|
||||
|
||||
if (POCO_ENABLE_TESTS)
|
||||
add_subdirectory( testsuite )
|
||||
|
||||
@@ -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 "MutexBenchmark")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoFoundation )
|
||||
add_executable(MutexBenchmark src/Benchmark.cpp)
|
||||
target_link_libraries(MutexBenchmark 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} PocoFoundation )
|
||||
add_executable(StringTokenizer src/StringTokenizer.cpp)
|
||||
target_link_libraries(StringTokenizer PUBLIC 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} PocoFoundation )
|
||||
add_executable(URI src/URI.cpp)
|
||||
target_link_libraries(URI PUBLIC 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,5 +1,3 @@
|
||||
set(TESTUNIT "${LIBNAME}-testrunner")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
file(GLOB SRCS_G_REMOVE
|
||||
@@ -24,48 +22,48 @@ 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$<$<CONFIG:Debug>:d>.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$<$<CONFIG:Debug>:d>.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)
|
||||
add_test(NAME Foundation WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND Foundation-testrunner -all)
|
||||
if(WIN32)
|
||||
set_tests_properties(${LIBNAME} PROPERTIES ENVIRONMENT "PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") # The SharedLibaryTest has to look for shared libraries in the working directory
|
||||
set_tests_properties(Foundation PROPERTIES ENVIRONMENT "PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") # The SharedLibaryTest has to look for shared libraries in the working directory
|
||||
elseif(UNIX)
|
||||
set_tests_properties(${LIBNAME} PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") # The SharedLibaryTest has to look for shared libraries in the working directory
|
||||
set_tests_properties(Foundation PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") # The SharedLibaryTest has to look for shared libraries in the working directory
|
||||
endif()
|
||||
# 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 PocoCppUnit )
|
||||
target_link_libraries(Foundation-testrunner PUBLIC Poco::Foundation Poco::CppUnit)
|
||||
if(UNIX AND NOT ANDROID)
|
||||
target_link_libraries( ${TESTUNIT} pthread)
|
||||
target_link_libraries(Foundation-testrunner PUBLIC pthread)
|
||||
endif(UNIX AND NOT ANDROID)
|
||||
|
||||
if(POCO_ENABLE_LONG_RUNNING_TESTS)
|
||||
target_compile_definitions( ${TESTUNIT} PRIVATE ENABLE_LONG_RUNNING_TESTS)
|
||||
target_compile_definitions(Foundation-testrunner PRIVATE ENABLE_LONG_RUNNING_TESTS)
|
||||
endif(POCO_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 DEBUG_POSTFIX "d")
|
||||
set_target_properties( TestApp PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} )
|
||||
target_link_libraries( TestApp PocoFoundation)
|
||||
target_link_libraries( TestApp PUBLIC Poco::Foundation )
|
||||
|
||||
# TestLibrary
|
||||
add_library( TestLibrary SHARED src/TestLibrary.cpp src/TestPlugin.cpp src/TestPlugin.h )
|
||||
# The test requires the library named TestLibrary. By default it is prefixed with lib.
|
||||
set_target_properties( TestLibrary PROPERTIES PREFIX "")
|
||||
set_target_properties( TestLibrary PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} )
|
||||
target_link_libraries( TestLibrary PocoFoundation)
|
||||
set_target_properties(TestLibrary PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} )
|
||||
target_link_libraries(TestLibrary PUBLIC Poco::Foundation )
|
||||
|
||||
add_dependencies(${TESTUNIT} TestLibrary TestApp)
|
||||
add_dependencies(Foundation-testrunner TestApp TestLibrary)
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
set(LIBNAME "JSON")
|
||||
set(POCO_LIBNAME "Poco${LIBNAME}")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
@@ -10,26 +7,31 @@ POCO_SOURCES(SRCS pdjson src/pdjson.c)
|
||||
file(GLOB_RECURSE HDRS_G "include/*.h" )
|
||||
POCO_HEADERS_AUTO( SRCS ${HDRS_G})
|
||||
|
||||
add_library( "${LIBNAME}" ${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(MSVC)
|
||||
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 (POCO_ENABLE_TESTS)
|
||||
add_subdirectory(testsuite)
|
||||
|
||||
@@ -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} ${CMAKE_THREAD_LIBS_INIT} PocoJSON PocoFoundation PocoCppUnit )
|
||||
target_link_libraries(JSON-testrunner PUBLIC Poco::JSON Poco::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}" ${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 (POCO_ENABLE_TESTS)
|
||||
add_subdirectory(testsuite)
|
||||
|
||||
@@ -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} ${CMAKE_THREAD_LIBS_INIT} PocoMongoDB PocoFoundation PocoCppUnit )
|
||||
target_link_libraries(MongoDB-testrunner PUBLIC Poco::MongoDB Poco::CppUnit)
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include "Poco/DateTime.h"
|
||||
#include "Poco/ObjectPool.h"
|
||||
#include "Poco/Environment.h"
|
||||
#include "Poco/MongoDB/InsertRequest.h"
|
||||
#include "Poco/MongoDB/QueryRequest.h"
|
||||
#include "Poco/MongoDB/DeleteRequest.h"
|
||||
@@ -33,6 +34,21 @@ using namespace Poco::MongoDB;
|
||||
|
||||
Poco::MongoDB::Connection::Ptr MongoDBTest::_mongo;
|
||||
|
||||
namespace
|
||||
{
|
||||
std::string getHost()
|
||||
{
|
||||
#if POCO_OS == POCO_OS_ANDROID
|
||||
return "10.0.2.2";
|
||||
#else
|
||||
if(Poco::Environment::has("MONGODB_HOST"))
|
||||
return Poco::Environment::get("MONGODB_HOST");
|
||||
else
|
||||
return "127.0.0.1";
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
MongoDBTest::MongoDBTest(const std::string& name):
|
||||
CppUnit::TestCase("MongoDB")
|
||||
@@ -300,12 +316,7 @@ void MongoDBTest::testBuildInfo()
|
||||
|
||||
void MongoDBTest::testConnectionPool()
|
||||
{
|
||||
#if POCO_OS == POCO_OS_ANDROID
|
||||
std::string host = "10.0.2.2";
|
||||
#else
|
||||
std::string host = "127.0.0.1";
|
||||
#endif
|
||||
|
||||
std::string host = getHost();
|
||||
Poco::Net::SocketAddress sa(host, 27017);
|
||||
Poco::PoolableObjectFactory<Poco::MongoDB::Connection, Poco::MongoDB::Connection::Ptr> factory(sa);
|
||||
Poco::ObjectPool<Poco::MongoDB::Connection, Poco::MongoDB::Connection::Ptr> pool(factory, 10, 15);
|
||||
@@ -414,13 +425,7 @@ void MongoDBTest::testConnectURI()
|
||||
{
|
||||
Poco::MongoDB::Connection conn;
|
||||
Poco::MongoDB::Connection::SocketFactory sf;
|
||||
|
||||
#if POCO_OS == POCO_OS_ANDROID
|
||||
std::string host = "10.0.2.2";
|
||||
#else
|
||||
std::string host = "127.0.0.1";
|
||||
#endif
|
||||
|
||||
std::string host = getHost();
|
||||
conn.connect("mongodb://" + host, sf);
|
||||
conn.disconnect();
|
||||
|
||||
@@ -463,11 +468,7 @@ void MongoDBTest::testConnectURI()
|
||||
|
||||
CppUnit::Test* MongoDBTest::suite()
|
||||
{
|
||||
#if POCO_OS == POCO_OS_ANDROID
|
||||
std::string host = "10.0.2.2";
|
||||
#else
|
||||
std::string host = "127.0.0.1";
|
||||
#endif
|
||||
std::string host = getHost();
|
||||
try
|
||||
{
|
||||
_mongo = new Poco::MongoDB::Connection(host, 27017);
|
||||
|
||||
@@ -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}" ${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 (POCO_ENABLE_TESTS)
|
||||
add_subdirectory(testsuite)
|
||||
|
||||
@@ -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} ${CMAKE_THREAD_LIBS_INIT} PocoNet PocoUtil PocoXML PocoFoundation PocoCppUnit)
|
||||
target_link_libraries(Net-testrunner PUBLIC Poco::Net Poco::Util Poco::XML Poco::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}" ${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)
|
||||
target_include_directories( "${LIBNAME}"
|
||||
target_link_libraries(NetSSL PUBLIC Poco::Crypto Poco::Util Poco::Net)
|
||||
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 (POCO_ENABLE_TESTS)
|
||||
add_subdirectory(testsuite)
|
||||
|
||||
@@ -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,10 +1,5 @@
|
||||
set(SAMPLE_NAME "SetSourceIP")
|
||||
|
||||
add_executable(SetSourceIP src/SetSourceIP.cpp)
|
||||
target_link_libraries(SetSourceIP PUBLIC Poco::NetSSL Poco::Crypto Poco::Util Poco::Net Poco::XML Poco::Foundation)
|
||||
# uncomment following line, might solve compiling issues
|
||||
#set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
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 )
|
||||
|
||||
@@ -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,21 +14,21 @@ 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)
|
||||
# The test is run in the build directory. So the test data is copied there too
|
||||
add_custom_command(TARGET ${TESTUNIT} POST_BUILD
|
||||
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 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} ${CMAKE_THREAD_LIBS_INIT} PocoNetSSL PocoCrypto PocoNet PocoUtil PocoXML PocoFoundation PocoCppUnit)
|
||||
target_link_libraries(NetSSL-testrunner PUBLIC Poco::NetSSL Poco::Util Poco::XML Poco::CppUnit)
|
||||
|
||||
if(MSVC AND NOT POCO_DISABLE_INTERNAL_OPENSSL)
|
||||
set_tests_properties(${LIBNAME} PROPERTIES ENVIRONMENT "PATH=%PATH%\;${INTERNAL_OPENSSL_PATH}")
|
||||
set_tests_properties(NetSSL PROPERTIES ENVIRONMENT "PATH=%PATH%\;${INTERNAL_OPENSSL_PATH}")
|
||||
endif(MSVC AND NOT POCO_DISABLE_INTERNAL_OPENSSL)
|
||||
|
||||
@@ -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,34 +6,29 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
file(GLOB_RECURSE HDRS_G "include/*.h" )
|
||||
POCO_HEADERS_AUTO( SRCS ${HDRS_G})
|
||||
|
||||
add_library( "${LIBNAME}" ${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 (POCO_ENABLE_TESTS)
|
||||
if (WIN32)
|
||||
if (WIN32 AND POCO_ENABLE_TESTS)
|
||||
add_subdirectory(testsuite)
|
||||
endif ()
|
||||
endif ()
|
||||
if (POCO_ENABLE_SAMPLES)
|
||||
if (WIN32)
|
||||
if (WIN32 AND POCO_ENABLE_SAMPLES)
|
||||
add_subdirectory(samples)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
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 PocoUtil PocoNet PocoXML PocoFoundation )
|
||||
add_custom_command(TARGET ${SAMPLE_NAME} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/any.pfx ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
)
|
||||
add_executable(HTTPSTimeServer-win src/HTTPSTimeServer.cpp)
|
||||
target_link_libraries(HTTPSTimeServer-win PUBLIC Poco::NetSSLWin Poco::Crypto Poco::XML)
|
||||
add_custom_command(TARGET HTTPSTimeServer-win POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/any.pfx ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
)
|
||||
|
||||
@@ -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 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,2 @@
|
||||
set(SAMPLE_NAME "download-ssl-win")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
||||
add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
|
||||
target_link_libraries( ${SAMPLE_NAME} PocoNetSSLWin 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,12 +14,12 @@ 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} PocoNetSSLWin PocoNet PocoUtil PocoXML PocoFoundation PocoCppUnit)
|
||||
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 Poco::CppUnit)
|
||||
|
||||
# The test is run in the build directory. So the test data is copied there too
|
||||
add_custom_command(TARGET ${TESTUNIT} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/any.pfx ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/testrunner.xml ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTUNIT}.xml
|
||||
add_custom_command(TARGET NetSSLWin-testrunner POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/any.pfx ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/testrunner.xml ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/NetSSLWin-testrunner.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
|
||||
@@ -122,26 +117,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}" ${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 (POCO_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 Poco::CppUnit)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
//
|
||||
|
||||
|
||||
#include "CppUnit/TestRunner.h"
|
||||
#include "Poco/CppUnit/TestRunner.h"
|
||||
#include "PDFTestSuite.h"
|
||||
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
|
||||
#include "PDFTest.h"
|
||||
#include "CppUnit/TestCaller.h"
|
||||
#include "CppUnit/TestSuite.h"
|
||||
#include "Poco/CppUnit/TestCaller.h"
|
||||
#include "Poco/CppUnit/TestSuite.h"
|
||||
|
||||
|
||||
PDFTest::PDFTest(const std::string& name): CppUnit::TestCase(name)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
|
||||
#include "Poco/PDF/PDF.h"
|
||||
#include "CppUnit/TestCase.h"
|
||||
#include "Poco/CppUnit/TestCase.h"
|
||||
|
||||
|
||||
class PDFTest: public CppUnit::TestCase
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#define PDFTestSuite_INCLUDED
|
||||
|
||||
|
||||
#include "CppUnit/TestSuite.h"
|
||||
#include "Poco/CppUnit/TestSuite.h"
|
||||
|
||||
|
||||
class PDFTestSuite
|
||||
|
||||
@@ -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}" ${CMAKE_THREAD_LIBS_INIT} 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}" ${CMAKE_THREAD_LIBS_INIT} 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
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
set(LIBNAME "Redis")
|
||||
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}" ${SRCS} )
|
||||
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
|
||||
set_target_properties( "${LIBNAME}"
|
||||
add_library(Redis ${SRCS} )
|
||||
add_library(Poco::Redis ALIAS Redis)
|
||||
set_target_properties(Redis
|
||||
PROPERTIES
|
||||
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
|
||||
OUTPUT_NAME ${POCO_LIBNAME}
|
||||
OUTPUT_NAME PocoRedis
|
||||
DEFINE_SYMBOL Redis_EXPORTS
|
||||
)
|
||||
|
||||
target_link_libraries( "${LIBNAME}" Net Foundation)
|
||||
target_include_directories( "${LIBNAME}"
|
||||
target_link_libraries(Redis PUBLIC Poco::Net)
|
||||
target_include_directories(Redis
|
||||
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(Redis)
|
||||
POCO_GENERATE_PACKAGE(Redis)
|
||||
|
||||
if (POCO_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,18 +14,18 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
|
||||
src/WinCEDriver.cpp
|
||||
)
|
||||
|
||||
set(TESTUNIT "${LIBNAME}-testrunner")
|
||||
option(POCO_OLD_REDIS_VERSION "Use old redis version" OFF)
|
||||
|
||||
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
||||
add_executable(Redis-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 Redis WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/Redis-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 Redis WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND Redis-testrunner -all)
|
||||
endif()
|
||||
|
||||
target_link_libraries( ${TESTUNIT} ${CMAKE_THREAD_LIBS_INIT} PocoRedis PocoFoundation PocoCppUnit )
|
||||
target_link_libraries(Redis-testrunner PUBLIC Poco::Redis Poco::CppUnit)
|
||||
|
||||
if(POCO_OLD_REDIS_VERSION)
|
||||
target_compile_definitions( ${TESTUNIT} PRIVATE OLD_REDIS_VERSION)
|
||||
endif(POCO_OLD_REDIS_VERSION)
|
||||
target_compile_definitions(Redis-testrunner PRIVATE OLD_REDIS_VERSION)
|
||||
endif()
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "Poco/Exception.h"
|
||||
#include "Poco/Delegate.h"
|
||||
#include "Poco/Thread.h"
|
||||
#include "Poco/Environment.h"
|
||||
#include "RedisTest.h"
|
||||
#include "Poco/Redis/AsyncReader.h"
|
||||
#include "Poco/Redis/Command.h"
|
||||
@@ -35,6 +36,8 @@ RedisTest::RedisTest(const std::string& name):
|
||||
#if POCO_OS == POCO_OS_ANDROID
|
||||
_host = "10.0.2.2";
|
||||
#endif
|
||||
if(Poco::Environment::has("REDIS_HOST"))
|
||||
_host = Poco::Environment::get("REDIS_HOST");
|
||||
if (!_connected)
|
||||
{
|
||||
try
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
set(LIBNAME "SQL")
|
||||
set(POCO_LIBNAME "Poco${LIBNAME}")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
@@ -9,87 +6,78 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
||||
file(GLOB_RECURSE HDRS_G "include/*.h" )
|
||||
POCO_HEADERS_AUTO( SRCS ${HDRS_G})
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
add_definitions(-DTHREADSAFE)
|
||||
endif (BUILD_SHARED_LIBS)
|
||||
|
||||
if(MSVC AND NOT(MSVC_VERSION LESS 1400))
|
||||
set_source_files_properties(src/StatementImpl.cpp
|
||||
PROPERTIES COMPILE_FLAGS "/bigobj")
|
||||
endif()
|
||||
|
||||
add_library( "${LIBNAME}" ${SRCS} )
|
||||
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
|
||||
set_target_properties( "${LIBNAME}"
|
||||
add_library(SQL ${SRCS} )
|
||||
add_library(Poco::SQL ALIAS SQL)
|
||||
set_target_properties(SQL
|
||||
PROPERTIES
|
||||
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
|
||||
OUTPUT_NAME ${POCO_LIBNAME}
|
||||
OUTPUT_NAME PocoSQL
|
||||
DEFINE_SYMBOL SQL_EXPORTS
|
||||
)
|
||||
|
||||
target_link_libraries( "${LIBNAME}" Foundation)
|
||||
target_include_directories( "${LIBNAME}"
|
||||
target_link_libraries(SQL PUBLIC Poco::Foundation)
|
||||
target_include_directories(SQL
|
||||
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(SQL)
|
||||
POCO_GENERATE_PACKAGE(SQL)
|
||||
|
||||
if(POCO_ENABLE_SQL_SQLITE)
|
||||
if(POCO_VERBOSE_MESSAGES)
|
||||
message(STATUS "SQLite Support Enabled")
|
||||
endif()
|
||||
# SQlite3 is built in any case
|
||||
add_subdirectory( SQLite )
|
||||
elseif(POCO_VERBOSE_MESSAGES)
|
||||
message(STATUS "SQLite Support Disabled")
|
||||
endif(POCO_ENABLE_SQL_SQLITE)
|
||||
|
||||
if(POCO_ENABLE_SQL_MYSQL)
|
||||
find_package(MySQL)
|
||||
if(MYSQL_FOUND)
|
||||
include_directories("${MYSQL_INCLUDE_DIR}")
|
||||
if(POCO_VERBOSE_MESSAGES)
|
||||
message(STATUS "MySQL Support Enabled")
|
||||
endif()
|
||||
add_subdirectory( MySQL )
|
||||
elseif(POCO_VERBOSE_MESSAGES)
|
||||
message(STATUS "MySQL Support Disabled - no MySQL library")
|
||||
endif(MYSQL_FOUND)
|
||||
endif(POCO_ENABLE_SQL_MYSQL)
|
||||
if(MYSQL_FOUND AND POCO_ENABLE_SQL_MYSQL)
|
||||
include_directories("${MYSQL_INCLUDE_DIR}") # TODO(Bjoe) Use target_link_libraries()
|
||||
if(POCO_VERBOSE_MESSAGES)
|
||||
message(STATUS "MySQL Support Enabled")
|
||||
endif()
|
||||
add_subdirectory( MySQL )
|
||||
elseif(POCO_VERBOSE_MESSAGES)
|
||||
message(STATUS "MySQL Support Disabled - no MySQL library")
|
||||
endif()
|
||||
|
||||
if(POCO_ENABLE_SQL_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(POCO_ENABLE_SQL_POSTGRESQL)
|
||||
if(POSTGRESQL_FOUND AND POCO_ENABLE_SQL_POSTGRESQL)
|
||||
include_directories("${PostgreSQL_INCLUDE_DIR}") # TODO(Bjoe) Use target_link_libraries()
|
||||
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()
|
||||
|
||||
if(POCO_ENABLE_SQL_ODBC)
|
||||
find_package(ODBC)
|
||||
if(WIN32 AND NOT WINCE)
|
||||
set(ODBC_LIBRARIES "odbc32" "odbccp32")
|
||||
if(WIN32 AND NOT WINCE AND POCO_ENABLE_SQL_ODBC)
|
||||
set(ODBC_LIBRARIES "odbc32" "odbccp32")
|
||||
if(POCO_VERBOSE_MESSAGES)
|
||||
message(STATUS "Windows native ODBC Support Enabled")
|
||||
endif()
|
||||
add_subdirectory( ODBC )
|
||||
else()
|
||||
if(ODBC_FOUND AND POCO_ENABLE_SQL_ODBC)
|
||||
include_directories("${ODBC_INCLUDE_DIRECTORIES}") # TODO(Bjoe) Use target_link_libraries()
|
||||
if(POCO_VERBOSE_MESSAGES)
|
||||
message(STATUS "Windows native ODBC Support Enabled")
|
||||
message(STATUS "ODBC Support Enabled")
|
||||
endif()
|
||||
add_subdirectory( ODBC )
|
||||
else(WIN32 AND NOT WINCE)
|
||||
if(ODBC_FOUND)
|
||||
include_directories("${ODBC_INCLUDE_DIRECTORIES}")
|
||||
if(POCO_VERBOSE_MESSAGES)
|
||||
message(STATUS "ODBC Support Enabled")
|
||||
endif()
|
||||
add_subdirectory( ODBC )
|
||||
elseif(POCO_VERBOSE_MESSAGES)
|
||||
message(STATUS "ODBC Support Disabled - no ODBC runtime")
|
||||
endif()
|
||||
endif(WIN32 AND NOT WINCE)
|
||||
endif(POCO_ENABLE_SQL_ODBC)
|
||||
elseif(POCO_VERBOSE_MESSAGES)
|
||||
message(STATUS "ODBC Support Disabled - no ODBC runtime")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (POCO_ENABLE_TESTS)
|
||||
add_subdirectory(testsuite)
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
set(LIBNAME "SQLMySQL")
|
||||
set(POCO_LIBNAME "Poco${LIBNAME}")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( MYSQL_SRCS ${SRCS_G})
|
||||
@@ -9,28 +6,27 @@ 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}" ${MYSQL_SRCS} )
|
||||
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
|
||||
set_target_properties( "${LIBNAME}"
|
||||
add_library(SQLMySQL ${MYSQL_SRCS} )
|
||||
add_library(Poco::SQLMySQL ALIAS SQLMySQL)
|
||||
set_target_properties(SQLMySQL
|
||||
PROPERTIES
|
||||
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
|
||||
OUTPUT_NAME ${POCO_LIBNAME}
|
||||
OUTPUT_NAME PocoSQLMySQL
|
||||
DEFINE_SYMBOL MySQL_EXPORTS
|
||||
)
|
||||
|
||||
target_link_libraries( "${LIBNAME}" Foundation SQL ${MYSQL_LIB})
|
||||
target_include_directories( "${LIBNAME}"
|
||||
target_link_libraries(SQLMySQL PUBLIC Poco::SQL ${MYSQL_LIB}) # TODO(Bjoe) Use namespace target
|
||||
target_include_directories(SQLMySQL
|
||||
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(SQLMySQL PUBLIC THREADSAFE NO_TCL)
|
||||
|
||||
POCO_INSTALL("${LIBNAME}")
|
||||
POCO_GENERATE_PACKAGE("${LIBNAME}")
|
||||
POCO_INSTALL(SQLMySQL)
|
||||
POCO_GENERATE_PACKAGE(SQLMySQL)
|
||||
|
||||
if (POCO_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(SQLMySQL-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 SQLMySQL WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/SQLMySQL-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 SQLMySQL WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND SQLMySQL-testrunner -all)
|
||||
endif()
|
||||
target_link_libraries( ${TESTUNIT} PocoSQLMySQL PocoSQL PocoFoundation PocoCppUnit )
|
||||
target_link_libraries(SQLMySQL-testrunner PUBLIC Poco::SQLMySQL Poco::CppUnit)
|
||||
|
||||
@@ -47,7 +47,10 @@ Poco::SharedPtr<SQLExecutor> MySQLTest::_pExecutor = 0;
|
||||
|
||||
std::string MySQLTest::getHost()
|
||||
{
|
||||
return "127.0.0.1"; //do not change to "localhost"!
|
||||
if (Environment::has("MYSQL_HOST"))
|
||||
return Environment::get("MYSQL_HOST");
|
||||
else
|
||||
return "127.0.0.1"; //do not change to "localhost"!
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
set(LIBNAME "SQLODBC")
|
||||
set(POCO_LIBNAME "Poco${LIBNAME}")
|
||||
|
||||
# Sources
|
||||
file(GLOB SRCS_G "src/*.cpp")
|
||||
POCO_SOURCES_AUTO( ODBC_SRCS ${SRCS_G})
|
||||
@@ -9,28 +6,27 @@ 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}" ${ODBC_SRCS} )
|
||||
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
|
||||
set_target_properties( "${LIBNAME}"
|
||||
add_library(SQLODBC ${ODBC_SRCS} )
|
||||
add_library(Poco::SQLODBC ALIAS SQLODBC)
|
||||
set_target_properties(SQLODBC
|
||||
PROPERTIES
|
||||
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
|
||||
OUTPUT_NAME ${POCO_LIBNAME}
|
||||
OUTPUT_NAME PocoSQLODBC
|
||||
DEFINE_SYMBOL ODBC_EXPORTS
|
||||
)
|
||||
|
||||
target_link_libraries( "${LIBNAME}" Foundation SQL ${ODBC_LIBRARIES})
|
||||
target_include_directories( "${LIBNAME}"
|
||||
target_link_libraries(SQLODBC PUBLIC Poco::SQL ${ODBC_LIBRARIES}) # TODO(Bjoe) Use namespace target
|
||||
target_include_directories(SQLODBC
|
||||
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(SQLODBC PUBLIC ${ODBC_CFLAGS} THREADSAFE)
|
||||
|
||||
POCO_INSTALL("${LIBNAME}")
|
||||
POCO_GENERATE_PACKAGE("${LIBNAME}")
|
||||
POCO_INSTALL(SQLODBC)
|
||||
POCO_GENERATE_PACKAGE(SQLODBC)
|
||||
|
||||
if (POCO_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(SQLODBC-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 SQLODBC WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/SQLODBC-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 SQLODBC WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND SQLODBC-testrunner -all)
|
||||
endif()
|
||||
target_link_libraries( ${TESTUNIT} PocoSQLODBC PocoSQL PocoFoundation PocoCppUnit )
|
||||
target_link_libraries(SQLODBC-testrunner PUBLIC Poco::SQLODBC Poco::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(SQLPostgreSQL ${POSTGRESQL_SRCS} )
|
||||
add_library(Poco::SQLPostgreSQL ALIAS SQLPostgreSQL)
|
||||
set_target_properties(SQLPostgreSQL
|
||||
PROPERTIES
|
||||
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
|
||||
OUTPUT_NAME ${POCO_LIBNAME}
|
||||
OUTPUT_NAME PocoSQLPostgreSQL
|
||||
DEFINE_SYMBOL PostgreSQL_EXPORTS
|
||||
)
|
||||
|
||||
target_link_libraries( "${LIBNAME}" Foundation SQL ${PostgreSQL_LIBRARIES})
|
||||
target_include_directories( "${LIBNAME}"
|
||||
target_link_libraries(SQLPostgreSQL PUBLIC Poco::SQL ${PostgreSQL_LIBRARIES})
|
||||
target_include_directories(SQLPostgreSQL
|
||||
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(SQLPostgreSQL)
|
||||
POCO_GENERATE_PACKAGE(SQLPostgreSQL)
|
||||
|
||||
if (POCO_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,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(SQLPostgreSQL-testrunner ${TEST_SRCS} )
|
||||
add_test(NAME SQLPostgreSQL WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND SQLPostgreSQL-testrunner -all)
|
||||
target_link_libraries(SQLPostgreSQL-testrunner PUBLIC Poco::SQLPostgreSQL Poco::CppUnit)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user