From 612f092235110bdb579c74b245e40679f78fd4b7 Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Sun, 3 Jun 2018 18:17:50 +0200 Subject: [PATCH] Cleanup cmake build system to use transitive dependency management from cmake (#2321) * Some cleanup in the root CMakeLists.txt * Cleanup cmake targets * Add find openssl modul for older cmake version * Set proper scope * Change crypto default to off * Fix openssl default to on * Remove global setting of C99 standard * Set from C11 to C99 * Fix for NetSSL win build * Set C99 compile features * Fix Windows build * Fix windows build * Cleanup poco unbundle definition * Fix PDF build * Remove unused set affinity * Add _CRT_SECURE_NO_WARNINGS as target compile definitions * Add _AFXDLL as target compile definitions * Remove commented out line * Refactor add_definitions to target_compile_definitons in Util * Refactor add_definitions to target_compile_definitons in XML * Remove THREADSAFE in data sql cmake build * Refactor add_definitions to target_compile_definition in cmake mysql * Refactor add_definitions to target_compile_definition in cmake odbc * Refactor add_definitions to target_compile_definition in cmake sqlite * Refactor add_definitions to target_compile_definitions in platform specific cmake * Add _DEBUG as compile definition * Add build dependencies between Foundation-testrunner and TestApp, TestLibrary in cmake build * Use cmake property to build shared libs * Cleanup POCO_NO_AUTOMATIC_LIBS. Set only for Windows in cmake build system * cleanup LIB_MODE_DEFINITIONS in cmake buld system * Add POCO_STATIC for CppUnit * Cleanup target link libraries and add option dependencies. * Add dependencies management in cmake * Update cmake documentation * Squashed commit of the following: commit 38c233f93fc8e9ad6e24d686c905eb18c86e19a7 Fix "invalid new-expression of abstract class type ApacheServerRequest" (#2231) - abstract method "bool secure() const" defined in HTTPServerRequest was implemented in ApacheServerRequest, one of its derived classes - a ap_log_error had one of its parameters changed for fixing a warning "passing NULL to non-pointer argument" - minor indentation problems corrected commit 4cbdfbe828943871618172f9e042176f115d61d8 Fix build dependencies * Improve database cmake build dependencies * Update doc * Update doc * Update cmake build commands * Set public on target link libraries in cmake build system * Fix PostgreSQL build * Fix PostgreSQL build in cmake * Fix PostgreSQL from SQL to Data * Squashed commit of the following: commit 1ba7d5dcbfb8d07860dd4efda33b31bedf6184c4 Add missing cmake file * Set path to PostgresSQL in AppVoyer * Try to fix AppVeyor build * show dir in appvoyer * Disable PostgreSQL build on Appvoyer * Refactor add_definitions to target_compile_definitions --- .travis.yml | 16 +- ApacheConnector/CMakeLists.txt | 12 +- ApacheConnector/include/ApacheConnector.h | 10 +- ApacheConnector/include/ApacheServerRequest.h | 6 + .../samples/FormServer/CMakeLists.txt | 9 +- .../samples/TimeServer/CMakeLists.txt | 9 +- ApacheConnector/src/ApacheConnector.cpp | 55 ++- ApacheConnector/src/ApacheServerRequest.cpp | 8 +- CMakeLists.txt | 321 ++++++++---- CppParser/CMakeLists.txt | 20 +- CppParser/testsuite/CMakeLists.txt | 12 +- CppUnit/CMakeLists.txt | 25 +- CppUnit/WinTestRunner/CMakeLists.txt | 24 +- Crypto/CMakeLists.txt | 22 +- Crypto/samples/genrsakey/CMakeLists.txt | 9 +- Crypto/testsuite/CMakeLists.txt | 14 +- Data/CMakeLists.txt | 97 ++-- Data/MySQL/CMakeLists.txt | 23 +- Data/MySQL/testsuite/CMakeLists.txt | 12 +- Data/ODBC/CMakeLists.txt | 23 +- Data/ODBC/testsuite/CMakeLists.txt | 12 +- Data/PostgreSQL/CMakeLists.txt | 21 +- .../cmake/PocoDataPostgreSQLConfig.cmake | 4 + .../cmake/PocoSQLPostgreSQLConfig.cmake | 4 - Data/PostgreSQL/testsuite/CMakeLists.txt | 8 +- Data/SQLite/CMakeLists.txt | 50 +- Data/SQLite/testsuite/CMakeLists.txt | 12 +- Data/samples/Binding/CMakeLists.txt | 9 +- Data/samples/RecordSet/CMakeLists.txt | 9 +- Data/samples/RowFormatter/CMakeLists.txt | 9 +- Data/samples/Tuple/CMakeLists.txt | 9 +- Data/samples/TypeHandler/CMakeLists.txt | 9 +- Data/samples/WebNotifier/CMakeLists.txt | 9 +- Data/testsuite/CMakeLists.txt | 12 +- Encodings/CMakeLists.txt | 20 +- Encodings/Compiler/CMakeLists.txt | 12 +- .../samples/TextConverter/CMakeLists.txt | 9 +- Encodings/testsuite/CMakeLists.txt | 16 +- Foundation/CMakeLists.txt | 185 ++++--- .../samples/ActiveMethod/CMakeLists.txt | 9 +- Foundation/samples/Activity/CMakeLists.txt | 9 +- .../samples/BinaryReaderWriter/CMakeLists.txt | 9 +- Foundation/samples/DateTime/CMakeLists.txt | 9 +- .../LineEndingConverter/CMakeLists.txt | 9 +- Foundation/samples/LogRotation/CMakeLists.txt | 9 +- Foundation/samples/Logger/CMakeLists.txt | 9 +- .../samples/NotificationQueue/CMakeLists.txt | 9 +- .../samples/StringTokenizer/CMakeLists.txt | 9 +- Foundation/samples/Timer/CMakeLists.txt | 9 +- Foundation/samples/URI/CMakeLists.txt | 9 +- .../samples/base64decode/CMakeLists.txt | 9 +- .../samples/base64encode/CMakeLists.txt | 9 +- Foundation/samples/deflate/CMakeLists.txt | 9 +- Foundation/samples/dir/CMakeLists.txt | 9 +- Foundation/samples/grep/CMakeLists.txt | 9 +- Foundation/samples/hmacmd5/CMakeLists.txt | 9 +- Foundation/samples/inflate/CMakeLists.txt | 9 +- Foundation/samples/md5/CMakeLists.txt | 9 +- Foundation/samples/uuidgen/CMakeLists.txt | 9 +- Foundation/testsuite/CMakeLists.txt | 37 +- JSON/CMakeLists.txt | 35 +- JSON/samples/Benchmark/CMakeLists.txt | 9 +- JSON/testsuite/CMakeLists.txt | 14 +- MongoDB/CMakeLists.txt | 20 +- MongoDB/samples/SQLToMongo/CMakeLists.txt | 9 +- MongoDB/testsuite/CMakeLists.txt | 14 +- Net/CMakeLists.txt | 39 +- Net/samples/EchoServer/CMakeLists.txt | 9 +- Net/samples/HTTPFormServer/CMakeLists.txt | 9 +- Net/samples/HTTPLoadTest/CMakeLists.txt | 9 +- Net/samples/HTTPTimeServer/CMakeLists.txt | 9 +- Net/samples/Mail/CMakeLists.txt | 9 +- Net/samples/Ping/CMakeLists.txt | 9 +- Net/samples/SMTPLogger/CMakeLists.txt | 9 +- Net/samples/TimeServer/CMakeLists.txt | 9 +- Net/samples/WebSocketServer/CMakeLists.txt | 11 +- Net/samples/dict/CMakeLists.txt | 9 +- Net/samples/download/CMakeLists.txt | 9 +- Net/samples/httpget/CMakeLists.txt | 9 +- Net/samples/ifconfig/CMakeLists.txt | 9 +- Net/testsuite/CMakeLists.txt | 12 +- NetSSL_OpenSSL/CMakeLists.txt | 20 +- .../samples/HTTPSTimeServer/CMakeLists.txt | 9 +- NetSSL_OpenSSL/samples/Mail/CMakeLists.txt | 9 +- .../samples/TwitterClient/CMakeLists.txt | 12 +- .../samples/download/CMakeLists.txt | 9 +- NetSSL_OpenSSL/testsuite/CMakeLists.txt | 16 +- NetSSL_Win/CMakeLists.txt | 20 +- .../samples/HTTPSTimeServer/CMakeLists.txt | 9 +- NetSSL_Win/samples/Mail/CMakeLists.txt | 9 +- NetSSL_Win/samples/download/CMakeLists.txt | 6 +- NetSSL_Win/testsuite/CMakeLists.txt | 12 +- PDF/CMakeLists.txt | 27 +- PDF/samples/Image/CMakeLists.txt | 9 +- PDF/samples/Template/CMakeLists.txt | 9 +- PDF/samples/Text/CMakeLists.txt | 9 +- PDF/testsuite/CMakeLists.txt | 12 +- PageCompiler/CMakeLists.txt | 8 +- PageCompiler/File2Page/CMakeLists.txt | 10 +- PocoDoc/CMakeLists.txt | 8 +- Redis/CMakeLists.txt | 22 +- Redis/testsuite/CMakeLists.txt | 16 +- SevenZip/CMakeLists.txt | 20 +- SevenZip/samples/un7zip/CMakeLists.txt | 9 +- Util/CMakeLists.txt | 30 +- Util/samples/SampleApp/CMakeLists.txt | 11 +- Util/samples/SampleServer/CMakeLists.txt | 11 +- Util/samples/Units/CMakeLists.txt | 9 +- Util/samples/pkill/CMakeLists.txt | 11 +- Util/testsuite/CMakeLists.txt | 12 +- XML/CMakeLists.txt | 45 +- XML/samples/DOMParser/CMakeLists.txt | 9 +- XML/samples/DOMWriter/CMakeLists.txt | 9 +- XML/samples/PrettyPrint/CMakeLists.txt | 9 +- XML/samples/SAXParser/CMakeLists.txt | 9 +- XML/testsuite/CMakeLists.txt | 12 +- Zip/CMakeLists.txt | 20 +- Zip/samples/unzip/CMakeLists.txt | 11 +- Zip/samples/zip/CMakeLists.txt | 6 +- Zip/testsuite/CMakeLists.txt | 15 +- appveyor.yml | 6 +- build_cmake.cmd | 19 +- build_cmake.sh | 19 +- cmake/DefinePlatformSpecifc.cmake | 56 --- cmake/FindMySQL.cmake | 2 +- cmake/FindPostgreSQL.cmake | 246 +++++++--- cmake/V33/FindOpenSSL.cmake | 463 ++++++++++++++++++ doc/00200-GettingStarted.page | 86 +++- 128 files changed, 1693 insertions(+), 1357 deletions(-) create mode 100644 Data/PostgreSQL/cmake/PocoDataPostgreSQLConfig.cmake delete mode 100644 Data/PostgreSQL/cmake/PocoSQLPostgreSQLConfig.cmake create mode 100644 cmake/V33/FindOpenSSL.cmake diff --git a/.travis.yml b/.travis.yml index faf780953..d6838485b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ before_install: - if [ "$TRAVIS_OS_NAME" == "linux" ]; then tar -xzvf cmake-3.2.3-Linux-x86_64.tar.gz; fi - if [ "$TRAVIS_OS_NAME" == "linux" ]; then export PATH=$PWD/cmake-3.2.3-Linux-x86_64/bin:$PATH; fi - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update -qq; fi - - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq -y unixodbc-dev libmysqlclient-dev g++-arm-linux-gnueabi g++-arm-linux-gnueabihf clang-3.5 libc++-dev sloccount cppcheck; fi + - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq -y unixodbc-dev libmysqlclient-dev g++-arm-linux-gnueabi g++-arm-linux-gnueabihf clang-3.5 libc++-dev ninja-build sloccount cppcheck; fi services: - mongodb @@ -81,7 +81,7 @@ matrix: # See also in /usr/local/android-sdk/ndk-bundle/build/cmake/android.toolchain.cmake # Using the ninja build command. Is much faster then make build command. - - mkdir cmake-build && cd cmake-build && /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake -G'Android Gradle - Ninja' -DANDROID_ABI=armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/usr/local/android-sdk/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-19 -DCMAKE_MAKE_PROGRAM=/usr/local/android-sdk/cmake/3.6.4111459/bin/ninja -DANDROID_STL="c++_static" -DANDROID_CPP_FEATURES="exceptions rtti" -DENABLE_TESTS=ON -DENABLE_LONG_RUNNING_TESTS=OFF -DOLD_REDIS_VERSION=ON .. && /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake --build . --target all && travis_wait 30 /usr/local/android-sdk/cmake/3.6.4111459/bin/ctest -E Foundation --output-on-failure + - /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake -H. -Bcmake-build -G'Android Gradle - Ninja' -DANDROID_ABI=armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/usr/local/android-sdk/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-19 -DCMAKE_MAKE_PROGRAM=/usr/local/android-sdk/cmake/3.6.4111459/bin/ninja -DANDROID_STL="c++_static" -DANDROID_CPP_FEATURES="exceptions rtti" -DENABLE_TESTS=ON -DENABLE_LONG_RUNNING_TESTS=OFF -DOLD_REDIS_VERSION=ON && /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake --build cmake-build --target all && cd cmake-build && travis_wait 30 /usr/local/android-sdk/cmake/3.6.4111459/bin/ctest -E Foundation --output-on-failure - env: TEST_NAME="android API level 24" language: android @@ -128,7 +128,7 @@ matrix: # See also in /usr/local/android-sdk/ndk-bundle/build/cmake/android.toolchain.cmake # Using the ninja build command. Is much faster then make build command. - - mkdir cmake-build && cd cmake-build && /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake -G'Android Gradle - Ninja' -DANDROID_ABI=armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/usr/local/android-sdk/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-24 -DCMAKE_MAKE_PROGRAM=/usr/local/android-sdk/cmake/3.6.4111459/bin/ninja -DANDROID_STL="c++_static" -DANDROID_CPP_FEATURES="exceptions rtti" -DENABLE_TESTS=ON -DENABLE_LONG_RUNNING_TESTS=OFF -DOLD_REDIS_VERSION=ON .. && /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake --build . --target all && travis_wait 30 /usr/local/android-sdk/cmake/3.6.4111459/bin/ctest -E Foundation --output-on-failure + - /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake -H. -Bcmake-build -G'Android Gradle - Ninja' -DANDROID_ABI=armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/usr/local/android-sdk/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-24 -DCMAKE_MAKE_PROGRAM=/usr/local/android-sdk/cmake/3.6.4111459/bin/ninja -DANDROID_STL="c++_static" -DANDROID_CPP_FEATURES="exceptions rtti" -DENABLE_TESTS=ON -DENABLE_LONG_RUNNING_TESTS=OFF -DOLD_REDIS_VERSION=ON && /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake --build cmake-build --target all && cd cmake-build && travis_wait 30 /usr/local/android-sdk/cmake/3.6.4111459/bin/ctest -E Foundation --output-on-failure - env: TEST_NAME="gcc (make)" compiler: gcc @@ -150,7 +150,7 @@ matrix: compiler: gcc script: # disable tests, gcc-4.6 gets an internal compiler error - - mkdir cmake-build && cd cmake-build && cmake -DENABLE_PDF=OFF -DENABLE_TESTS=OFF .. && make all -j2 && cd .. + - cmake -H. -Bcmake-build -GNinja -DENABLE_PDF=OFF -DENABLE_TESTS=OFF && cmake --build cmake-build --target all - env: TEST_NAME="gcc-4.8 (CMake)" compiler: gcc @@ -160,24 +160,24 @@ matrix: - sudo apt-get install -qq -y g++-4.8 - export CC="gcc-4.8" - export CXX="g++-4.8" - - mkdir cmake-build && cd cmake-build && cmake -DENABLE_PDF=OFF -DENABLE_TESTS=ON .. && make all -j2 && cd .. + - cmake -H. -Bcmake-build -GNinja -DENABLE_PDF=OFF -DENABLE_TESTS=ON && cmake --build cmake-build --target all - env: TEST_NAME="clang (CMake)" compiler: clang script: - - mkdir cmake-build && cd cmake-build && cmake -DENABLE_PDF=OFF -DENABLE_TESTS=ON .. && make all -j2 && cd .. + - cmake -H. -Bcmake-build -GNinja -DENABLE_PDF=OFF -DENABLE_TESTS=ON && cmake --build cmake-build --target all - env: TEST_NAME="arm-linux-gnueabi-g++ (CMake)" script: - export CC="arm-linux-gnueabi-gcc" - export CXX="arm-linux-gnueabi-g++" - - mkdir cmake-build && cd cmake-build && cmake -DENABLE_PDF=OFF -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_TESTS=ON .. && make all -j2 && cd .. + - cmake -H. -Bcmake-build -GNinja -DENABLE_PDF=OFF -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_TESTS=ON && cmake --build cmake-build --target all - env: TEST_NAME="arm-linux-gnueabihf-g++ (CMake)" script: - export CC="arm-linux-gnueabihf-gcc" - export CXX="arm-linux-gnueabihf-g++" - - mkdir cmake-build && cd cmake-build && cmake -DENABLE_PDF=OFF -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_TESTS=ON .. && make all -j2 && cd .. + - cmake -H. -Bcmake-build -GNinja -DENABLE_PDF=OFF -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_TESTS=ON && cmake --build cmake-build --target all # TODO osx build # TODO run test suite diff --git a/ApacheConnector/CMakeLists.txt b/ApacheConnector/CMakeLists.txt index 4328c18b6..b367c01d2 100644 --- a/ApacheConnector/CMakeLists.txt +++ b/ApacheConnector/CMakeLists.txt @@ -1,5 +1,3 @@ -set(LIBNAME "mod_poco") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( SRCS ${SRCS_G}) @@ -8,19 +6,19 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G}) file(GLOB_RECURSE HDRS_G "include/*.h" ) POCO_HEADERS_AUTO( SRCS ${HDRS_G}) -add_library( "${LIBNAME}" SHARED ${SRCS} ) -set_target_properties( "${LIBNAME}" +add_library(mod_poco SHARED ${SRCS}) +set_target_properties(mod_poco PROPERTIES VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} DEFINE_SYMBOL ApacheHandlers_EXPORTS) -target_link_libraries( "${LIBNAME}" ) -target_include_directories( "${LIBNAME}" +target_include_directories(mod_poco PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ) +target_link_libraries(mod_poco PUBLIC Poco::Util Poco::Net) if (ENABLE_TESTS) add_subdirectory(samples) -endif () \ No newline at end of file +endif () diff --git a/ApacheConnector/include/ApacheConnector.h b/ApacheConnector/include/ApacheConnector.h index 80630cc12..5e7b095a7 100644 --- a/ApacheConnector/include/ApacheConnector.h +++ b/ApacheConnector/include/ApacheConnector.h @@ -48,14 +48,20 @@ public: void sendErrorResponse(int status); /// Sends an error response with the given HTTP status code. - + int sendFile(const std::string& path, unsigned int fileSize, const std::string& mediaType); /// Sends the file given by fileName as response. void copyHeaders(ApacheServerRequest& request); /// Copies the request uri and header fields from the Apache request /// to the ApacheServerRequest. - + + bool secure(); + /// Returns true if the request is using a secure + /// connection. Returns false if no secure connection + /// is used, or if it is not known whether a secure + /// connection is used. + private: request_rec* _pRec; }; diff --git a/ApacheConnector/include/ApacheServerRequest.h b/ApacheConnector/include/ApacheServerRequest.h index dc6694f0e..825d6b734 100644 --- a/ApacheConnector/include/ApacheServerRequest.h +++ b/ApacheConnector/include/ApacheServerRequest.h @@ -58,6 +58,12 @@ public: Poco::Net::HTTPServerResponse& response() const; /// Returns a reference to the associated response + bool secure() const; + /// Returns true if the request is using a secure + /// connection. Returns false if no secure connection + /// is used, or if it is not known whether a secure + /// connection is used. + protected: void setResponse(ApacheServerResponse* pResponse); diff --git a/ApacheConnector/samples/FormServer/CMakeLists.txt b/ApacheConnector/samples/FormServer/CMakeLists.txt index ae7a563c8..f1710507f 100644 --- a/ApacheConnector/samples/FormServer/CMakeLists.txt +++ b/ApacheConnector/samples/FormServer/CMakeLists.txt @@ -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) diff --git a/ApacheConnector/samples/TimeServer/CMakeLists.txt b/ApacheConnector/samples/TimeServer/CMakeLists.txt index 595b9c33a..919972cd1 100644 --- a/ApacheConnector/samples/TimeServer/CMakeLists.txt +++ b/ApacheConnector/samples/TimeServer/CMakeLists.txt @@ -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) diff --git a/ApacheConnector/src/ApacheConnector.cpp b/ApacheConnector/src/ApacheConnector.cpp index ea961e587..d6d020dc1 100644 --- a/ApacheConnector/src/ApacheConnector.cpp +++ b/ApacheConnector/src/ApacheConnector.cpp @@ -131,6 +131,12 @@ int ApacheRequestRec::sendFile(const std::string& path, unsigned int fileSize, c } +bool ApacheRequestRec::secure() +{ + return DEFAULT_HTTPS_PORT == ap_default_port(_pRec) && ap_http_scheme(_pRec) == "https"; +} + + void ApacheRequestRec::copyHeaders(ApacheServerRequest& request) { const apr_array_header_t* arr = apr_table_elts(_pRec->headers_in); @@ -149,7 +155,13 @@ void ApacheRequestRec::copyHeaders(ApacheServerRequest& request) void ApacheConnector::log(const char* file, int line, int level, int status, const char *text) { - ap_log_error(file, line, level, 0, NULL, "%s", text); + // ap_log_error() has undergone significant changes in Apache 2.4. + // Validate Apache version for using a proper ap_log_error() version. +#if AP_SERVER_MAJORVERSION_NUMBER == 2 && AP_SERVER_MINORVERSION_NUMBER < 4 + ap_log_error(file, line, level, 0, NULL, "%s", text); +#else + ap_log_error(file, line, level, 0, 0, 0, text); +#endif } @@ -172,24 +184,33 @@ extern "C" int ApacheConnector_handler(request_rec *r) if ((rv = ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK))) return rv; -#ifndef POCO_ENABLE_CPP11 - std::auto_ptr pRequest(new ApacheServerRequest( - &rec, - r->connection->local_ip, - r->connection->local_addr->port, - r->connection->remote_ip, - r->connection->remote_addr->port)); - - std::auto_ptr pResponse(new ApacheServerResponse(pRequest.get())); + // The properties conn_rec->remote_ip and conn_rec->remote_addr have undergone significant changes in Apache 2.4. + // Validate Apache version for using conn_rec->remote_ip and conn_rec->remote_addr proper versions. +#if AP_SERVER_MAJORVERSION_NUMBER == 2 && AP_SERVER_MINORVERSION_NUMBER < 4 + const char* clientIp = r->connection->remote_ip; + apr_port_t clientPort = r->connection->remote_addr->port; #else - std::unique_ptr pRequest(new ApacheServerRequest( - &rec, - r->connection->local_ip, - r->connection->local_addr->port, - r->connection->remote_ip, - r->connection->remote_addr->port)); + const char* clientIp = r->connection->client_ip; + apr_port_t clientPort = r->connection->client_addr->port; +#endif +#ifndef POCO_ENABLE_CPP11 + std::auto_ptr pRequest(new ApacheServerRequest( + &rec, + r->connection->local_ip, + r->connection->local_addr->port, + clientIp, + clientPort)); - std::unique_ptr pResponse(new ApacheServerResponse(pRequest.get())); + std::auto_ptr pResponse(new ApacheServerResponse(pRequest.get())); +#else + std::unique_ptr pRequest(new ApacheServerRequest( + &rec, + r->connection->local_ip, + r->connection->local_addr->port, + clientIp, + clientPort)); + + std::unique_ptr pResponse(new ApacheServerResponse(pRequest.get())); #endif // POCO_ENABLE_CPP11 // add header information to request diff --git a/ApacheConnector/src/ApacheServerRequest.cpp b/ApacheConnector/src/ApacheServerRequest.cpp index ee22c903f..0699c79ba 100644 --- a/ApacheConnector/src/ApacheServerRequest.cpp +++ b/ApacheConnector/src/ApacheServerRequest.cpp @@ -35,7 +35,7 @@ ApacheServerRequest::~ApacheServerRequest() delete _pStream; } - + const Poco::Net::HTTPServerParams& ApacheServerRequest::serverParams() const { throw Poco::NotImplementedException("No HTTPServerParams available in Apache modules."); @@ -58,3 +58,9 @@ bool ApacheServerRequest::expectContinue() const { return false; } + + +bool ApacheServerRequest::secure() const +{ + return _pApacheRequest->secure(); +} diff --git a/CMakeLists.txt b/CMakeLists.txt index 14a3d380c..7df655ddc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,30 +1,18 @@ -# POCO_BUILD_TYPE -# POCO_STATIC -# POCO_UNBUNDLED -# POCO_NO_LOCALE -# -# ENABLE_{COMPONENT} -# ENABLE_TESTS - cmake_minimum_required(VERSION 3.2.0) project(Poco) -set(CMAKE_C_STANDARD 11) - file(STRINGS "${PROJECT_SOURCE_DIR}/libversion" SHARED_LIBRARY_VERSION) - # Read the version information from the VERSION file -file(STRINGS "${PROJECT_SOURCE_DIR}/VERSION" PACKAGE_VERSION) -message(STATUS "Poco package version: ${PACKAGE_VERSION}") +file (STRINGS "${PROJECT_SOURCE_DIR}/VERSION" PACKAGE_VERSION ) string(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" CPACK_PACKAGE_VERSION_MAJOR ${PACKAGE_VERSION}) string(REGEX REPLACE "[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" CPACK_PACKAGE_VERSION_MINOR ${PACKAGE_VERSION}) string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" CPACK_PACKAGE_VERSION_PATCH ${PACKAGE_VERSION}) -set(COMPLETE_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}) +set(PROJECT_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}) set(RELEASE_NAME "Unstable-trunk") -set(PROJECT_VERSION ${COMPLETE_VERSION}) -set(CMAKE_C_STANDARD 99) + +message(STATUS "Poco package version: ${PROJECT_VERSION}") # Put the libaries and binaries that get built into directories at the # top of the build tree rather than in hard-to-find leaf @@ -36,14 +24,14 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) # Append our module directory to CMake -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) - -# COMMENT REPLACED BY BIICODE +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) +if(${CMAKE_VERSION} VERSION_LESS "3.4") + list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/V33) +endif() ################################################################################# # Setup C/C++ compiler options ################################################################################# - option(DISABLE_CPP11 "Disable C++11 if available" OFF) option(DISABLE_CPP14 "Disable C++14 if available" OFF) @@ -70,42 +58,99 @@ else() endif() endif() -if(NOT MSVC_IDE) - if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING - "Choose the type of build, options are: None Debug Release" FORCE) - endif() - message(STATUS "Setting Poco build type - ${CMAKE_BUILD_TYPE}") -endif() - -if(CMAKE_BUILD_TYPE STREQUAL "") +if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "RelWithDebInfo") endif() +message(STATUS "Setting Poco build type - ${CMAKE_BUILD_TYPE}") # Include some common macros to simpilfy the Poco CMake files include(PocoMacros) +if(ENABLE_CRYPTO OR ENABLE_NETSSL) + find_package(OpenSSL REQUIRED) +else() + find_package(OpenSSL) +endif() + +if(OPENSSL_FOUND) + option(ENABLE_NETSSL "Enable NetSSL" ON) + option(ENABLE_CRYPTO "Enable Crypto" ON) +else() + option(ENABLE_NETSSL "Enable NetSSL" OFF) + option(ENABLE_CRYPTO "Enable Crypto" OFF) +endif() + +if(ENABLE_APACHECONNECTOR) + find_package(APR REQUIRED) + find_package(Apache2 REQUIRED) +else() + find_package(APR) + find_package(Apache2) +endif() + +if(APRUTIL_FOUND AND APACHE_FOUND AND + EXISTS ${PROJECT_SOURCE_DIR}/ApacheConnector AND ENABLE_APACHECONNECTOR) + option(ENABLE_APACHECONNECTOR "Enable ApacheConnector" ON) +else() + option(ENABLE_APACHECONNECTOR "Enable ApacheConnector" OFF) +endif() + +if(ENABLE_DATA_MYSQL) + find_package(MySQL REQUIRED) +else() + find_package(MySQL) +endif() + +if(MYSQL_FOUND) + option(ENABLE_DATA "Enable Data" ON) + option(ENABLE_DATA_MYSQL "Enable Data MySQL" ON) +else() + option(ENABLE_DATA "Enable Data" OFF) + option(ENABLE_DATA_MYSQL "Enable Data MySQL" OFF) +endif() + +if(ENABLE_DATA_POSTGRESQL) + find_package(PostgreSQL REQUIRED) +else() + find_package(PostgreSQL QUIET) +endif() + +if(POSTGRESQL_FOUND) + option(ENABLE_DATA "Enable SQL" ON) + option(ENABLE_DATA_POSTGRESQL "Enable SQL PosgreSQL" ON) +else() + option(ENABLE_DATA "Enable SQL" OFF) + option(ENABLE_DATA_POSTGRESQL "Enable SQL PosgreSQL" OFF) +endif() + +if(ENABLE_DATA_ODBC) + find_package(ODBC REQUIRED) +else() + find_package(ODBC) +endif() + +if(ODBC_FOUND) + option(ENABLE_DATA "Enable Data" ON) + option(ENABLE_DATA_ODBC "Enable Data ODBC" ON) +else() + option(ENABLE_DATA "Enable Data" OFF) + option(ENABLE_DATA_ODBC "Enable Data ODBC" OFF) +endif() + # Allow enabling and disabling components option(ENABLE_ENCODINGS "Enable Encodings" ON) option(ENABLE_ENCODINGS_COMPILER "Enable Encodings Compiler" OFF) option(ENABLE_XML "Enable XML" ON) option(ENABLE_JSON "Enable JSON" ON) option(ENABLE_MONGODB "Enable MongoDB" ON) +option(ENABLE_DATA_SQLITE "Enable Data SQlite" ON) option(ENABLE_REDIS "Enable Redis" ON) option(ENABLE_PDF "Enable PDF" OFF) option(ENABLE_UTIL "Enable Util" ON) option(ENABLE_NET "Enable Net" ON) -option(ENABLE_NETSSL "Enable NetSSL" ON) option(ENABLE_NETSSL_WIN "Enable NetSSL Windows" OFF) -option(ENABLE_CRYPTO "Enable Crypto" ON) -option(ENABLE_DATA "Enable Data" ON) -option(ENABLE_DATA_SQLITE "Enable Data SQlite" ON) -option(ENABLE_DATA_MYSQL "Enable Data MySQL" ON) -option(ENABLE_DATA_POSTGRESQL "Enable Data PostgreSQL" ON) -option(ENABLE_DATA_ODBC "Enable Data ODBC" ON) option(ENABLE_SEVENZIP "Enable SevenZip" OFF) option(ENABLE_ZIP "Enable Zip" ON) -option(ENABLE_APACHECONNECTOR "Enable ApacheConnector" OFF) option(ENABLE_CPPPARSER "Enable C++ parser" OFF) option(ENABLE_POCODOC "Enable Poco Documentation Generator" OFF) option(ENABLE_PAGECOMPILER "Enable PageCompiler" ON) @@ -118,6 +163,13 @@ option(ENABLE_TESTS option(POCO_STATIC "Set to OFF|ON (default is OFF) to control build of POCO as STATIC library" OFF) +if(POCO_STATIC) + message(STATUS "Building static libraries") + option(BUILD_SHARED_LIBS "Build shared libraries" OFF) +else() + message(STATUS "Building dynamic libraries") + option(BUILD_SHARED_LIBS "Build shared libraries" ON) +endif() option(POCO_UNBUNDLED "Set to OFF|ON (default is OFF) to control linking dependencies as external" OFF) @@ -130,16 +182,6 @@ if(MSVC) "Set to OFF|ON (default is OFF) to control parallel build of POCO with MSVC" OFF) endif() -# Uncomment from next two lines to force static or dynamic library, default is autodetection -if(POCO_STATIC) - set(LIB_MODE_DEFINITIONS -DPOCO_STATIC -DPOCO_NO_AUTOMATIC_LIBS) - set(LIB_MODE STATIC) - message(STATUS "Building static libraries") -else(POCO_STATIC) - set(LIB_MODE SHARED) - set(LIB_MODE_DEFINITIONS -DPOCO_NO_AUTOMATIC_LIBS) - message(STATUS "Building dynamic libraries") -endif(POCO_STATIC) if(ENABLE_TESTS) option(ENABLE_LONG_RUNNING_TESTS "Enable long running test" ON) @@ -151,7 +193,6 @@ else() endif() if(POCO_UNBUNDLED) - add_definitions(-DPOCO_UNBUNDLED) message(STATUS "Using external sqlite, zlib, pcre, expat, ...") else() message(STATUS "Using internal sqlite, zlib, pcre, expat, ...") @@ -164,41 +205,127 @@ set(Poco_COMPONENTS "") if(ENABLE_TESTS) add_subdirectory(CppUnit) + set(ENABLE_XML ON CACHE BOOL "Enable XML" FORCE ) + set(ENABLE_JSON ON CACHE BOOL "Enable JSON" FORCE) + + if(ENABLE_ZIP) + set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE) + endif() +endif() + +if(ENABLE_ENCODINGS_COMPILER OR ENABLE_APACHECONNECTOR) + set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE) + set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE) +endif() + +if(ENABLE_PAGECOMPILER_FILE2PAGE) + set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE) +endif() + +if(ENABLE_PAGECOMPILER) + set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE) + set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE) +endif() + +if(ENABLE_MONGODB OR ENABLE_REDIS) + set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE) +endif() + +if(ENABLE_DATA_SQLITE OR ENABLE_DATA_MYSQL OR ENABLE_DATA_ODBC OR ENABLE_DATA_POSTGRESQL) + set(ENABLE_DATA ON CACHE BOOL "Enable Data" FORCE) + if(ENABLE_TESTS) + set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE) + set(ENABLE_DATA_SQLITE ON CACHE BOOL "Enable Data SQlite" FORCE) + endif() +endif() + +if(ENABLE_DATA AND ENABLE_TESTS) + set(ENABLE_DATA_SQLITE ON CACHE BOOL "Enable Data SQlite" FORCE) +endif() + +if(ENABLE_NETSSL_WIN) + set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE) + if(ENABLE_TESTS) + set(ENABLE_CRYPTO ON CACHE BOOL "Enable Crypto" FORCE) + endif() +endif() + +if(ENABLE_NETSSL) + set(ENABLE_CRYPTO ON CACHE BOOL "Enable Crypto" FORCE) + set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE) + set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE) +endif() + +if(ENABLE_CRYPTO AND ENABLE_TESTS) + set(ENABLE_NETSSL ON CACHE BOOL "Enable NetSSL" FORCE) + set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE) + set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE) +endif() + +if(ENABLE_NET AND ENABLE_TESTS) + set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE) +endif() + +if(ENABLE_PDF) + set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE) + set(ENABLE_XML ON CACHE BOOL "Enable XML" FORCE) +endif() + +if(ENABLE_POCODOC) + set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE) + set(ENABLE_XML ON CACHE BOOL "Enable XML" FORCE) + set(ENABLE_CPPPARSER ON CACHE BOOL "Enable C++ parser" FORCE) +endif() + +if(ENABLE_SEVENZIP OR ENABLE_ZIP) + set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE) + set(ENABLE_XML ON CACHE BOOL "Enable XML" FORCE) +endif() + +if(ENABLE_UTIL AND ENABLE_TESTS) + set(ENABLE_JSON ON CACHE BOOL "Enable JSON" FORCE) + set(ENABLE_XML ON CACHE BOOL "Enable XML" FORCE) endif() add_subdirectory(Foundation) if(ENABLE_ENCODINGS) -add_subdirectory(Encodings) -list(APPEND Poco_COMPONENTS "Encodings") + add_subdirectory(Encodings) + list(APPEND Poco_COMPONENTS "Encodings") endif() + if(ENABLE_XML) -add_subdirectory(XML) -list(APPEND Poco_COMPONENTS "XML") + add_subdirectory(XML) + list(APPEND Poco_COMPONENTS "XML") endif() + if(ENABLE_JSON) -add_subdirectory(JSON) -list(APPEND Poco_COMPONENTS "JSON") + add_subdirectory(JSON) + list(APPEND Poco_COMPONENTS "JSON") endif() + if(ENABLE_UTIL) -add_subdirectory(Util) -list(APPEND Poco_COMPONENTS "Util") + add_subdirectory(Util) + list(APPEND Poco_COMPONENTS "Util") endif() + if(ENABLE_NET) -add_subdirectory(Net) -list(APPEND Poco_COMPONENTS "Net") + add_subdirectory(Net) + list(APPEND Poco_COMPONENTS "Net") endif() if(EXISTS ${PROJECT_SOURCE_DIR}/MongoDB AND ENABLE_MONGODB) -add_subdirectory(MongoDB) -list(APPEND Poco_COMPONENTS "MongoDB") + add_subdirectory(MongoDB) + list(APPEND Poco_COMPONENTS "MongoDB") endif() + if(EXISTS ${PROJECT_SOURCE_DIR}/Redis AND ENABLE_REDIS) -add_subdirectory(Redis) -list(APPEND Poco_COMPONENTS "Redis") + add_subdirectory(Redis) + list(APPEND Poco_COMPONENTS "Redis") endif() + if(EXISTS ${PROJECT_SOURCE_DIR}/PDF AND ENABLE_PDF) -add_subdirectory(PDF) -list(APPEND Poco_COMPONENTS "PDF") + add_subdirectory(PDF) + list(APPEND Poco_COMPONENTS "PDF") endif() @@ -210,65 +337,62 @@ if(WIN32 AND EXISTS ${PROJECT_SOURCE_DIR}/NetSSL_Win AND ENABLE_NETSSL_WIN) list(APPEND Poco_COMPONENTS "NetSSL_Win") endif(WIN32 AND EXISTS ${PROJECT_SOURCE_DIR}/NetSSL_Win AND ENABLE_NETSSL_WIN) -find_package(OpenSSL) if(OPENSSL_FOUND) - include_directories("${OPENSSL_INCLUDE_DIR}") if(EXISTS ${PROJECT_SOURCE_DIR}/NetSSL_OpenSSL AND ENABLE_NETSSL) - add_subdirectory(NetSSL_OpenSSL) - list(APPEND Poco_COMPONENTS "NetSSL_OpenSSL") + add_subdirectory(NetSSL_OpenSSL) + list(APPEND Poco_COMPONENTS "NetSSL_OpenSSL") endif() if(EXISTS ${PROJECT_SOURCE_DIR}/Crypto AND ENABLE_CRYPTO) - add_subdirectory(Crypto) - list(APPEND Poco_COMPONENTS "Crypto") + add_subdirectory(Crypto) + list(APPEND Poco_COMPONENTS "Crypto") endif() endif(OPENSSL_FOUND) if(EXISTS ${PROJECT_SOURCE_DIR}/Data AND ENABLE_DATA) -add_subdirectory(Data) -list(APPEND Poco_COMPONENTS "Data") -endif() -if(EXISTS ${PROJECT_SOURCE_DIR}/SevenZip AND ENABLE_SEVENZIP) -add_subdirectory(SevenZip) -list(APPEND Poco_COMPONENTS "SevenZip") -endif() -if(EXISTS ${PROJECT_SOURCE_DIR}/Zip AND ENABLE_ZIP) -add_subdirectory(Zip) -list(APPEND Poco_COMPONENTS "Zip") + add_subdirectory(Data) + list(APPEND Poco_COMPONENTS "Data") endif() -find_package(APR) -find_package(Apache2) -if(APRUTIL_FOUND AND APACHE_FOUND) - include_directories( "${APACHE_INCLUDE_DIR}" "${APRUTIL_INCLUDE_DIR}" ) - if(EXISTS ${PROJECT_SOURCE_DIR}/ApacheConnector AND ENABLE_APACHECONNECTOR) +if(EXISTS ${PROJECT_SOURCE_DIR}/SevenZip AND ENABLE_SEVENZIP) + add_subdirectory(SevenZip) + list(APPEND Poco_COMPONENTS "SevenZip") +endif() + +if(EXISTS ${PROJECT_SOURCE_DIR}/Zip AND ENABLE_ZIP) + add_subdirectory(Zip) + list(APPEND Poco_COMPONENTS "Zip") +endif() + +if(APRUTIL_FOUND AND APACHE_FOUND AND + EXISTS ${PROJECT_SOURCE_DIR}/ApacheConnector AND ENABLE_APACHECONNECTOR) + include_directories( "${APACHE_INCLUDE_DIR}" "${APRUTIL_INCLUDE_DIR}" ) # TODO(Bjoe) use target_include_directories or target_link_libraries add_subdirectory(ApacheConnector) list(APPEND Poco_COMPONENTS "ApacheConnector") - endif() -endif(APRUTIL_FOUND AND APACHE_FOUND) +endif() if(EXISTS ${PROJECT_SOURCE_DIR}/CppParser AND ENABLE_CPPPARSER) -add_subdirectory(CppParser) -list(APPEND Poco_COMPONENTS "CppParser") + add_subdirectory(CppParser) + list(APPEND Poco_COMPONENTS "CppParser") endif() if(EXISTS ${PROJECT_SOURCE_DIR}/PocoDoc AND ENABLE_POCODOC) -add_subdirectory(PocoDoc) -list(APPEND Poco_COMPONENTS "PocoDoc") + add_subdirectory(PocoDoc) + list(APPEND Poco_COMPONENTS "PocoDoc") endif() if(EXISTS ${PROJECT_SOURCE_DIR}/PageCompiler AND ENABLE_PAGECOMPILER) -add_subdirectory(PageCompiler) -list(APPEND Poco_COMPONENTS "PageCompiler") + add_subdirectory(PageCompiler) + list(APPEND Poco_COMPONENTS "PageCompiler") endif() if(EXISTS ${PROJECT_SOURCE_DIR}/PageCompiler/File2Page AND ENABLE_PAGECOMPILER_FILE2PAGE) -add_subdirectory(PageCompiler/File2Page) -list(APPEND Poco_COMPONENTS "File2Page") + add_subdirectory(PageCompiler/File2Page) + list(APPEND Poco_COMPONENTS "File2Page") endif() if(EXISTS ${PROJECT_SOURCE_DIR}/Encodings/Compiler AND ENABLE_ENCODINGS_COMPILER) -add_subdirectory(Encodings/Compiler) -list(APPEND Poco_COMPONENTS "EncodingsCompiler") + add_subdirectory(Encodings/Compiler) + list(APPEND Poco_COMPONENTS "EncodingsCompiler") endif() @@ -337,6 +461,5 @@ message(STATUS "CMAKE_CXX_FLAGS_MINSIZEREL:=${CMAKE_CXX_FLAGS_MINSIZEREL}") message(STATUS "CMAKE_CXX_FLAGS_RELWITHDEBINFO:=${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") foreach(component ${Poco_COMPONENTS}) -message(STATUS "Building: ${component}") + message(STATUS "Building: ${component}") endforeach() - diff --git a/CppParser/CMakeLists.txt b/CppParser/CMakeLists.txt index 0c970c8e7..5efb0f8f4 100644 --- a/CppParser/CMakeLists.txt +++ b/CppParser/CMakeLists.txt @@ -1,6 +1,3 @@ -set(LIBNAME "CppParser") -set(POCO_LIBNAME "Poco${LIBNAME}") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( SRCS ${SRCS_G}) @@ -9,26 +6,25 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G}) file(GLOB_RECURSE HDRS_G "include/*.h" ) POCO_HEADERS_AUTO( SRCS ${HDRS_G}) -add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} ) -add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}") -set_target_properties( "${LIBNAME}" +add_library(CppParser ${SRCS}) +add_library(Poco::CppParser ALIAS CppParser) +set_target_properties(CppParser PROPERTIES VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} - OUTPUT_NAME ${POCO_LIBNAME} + OUTPUT_NAME PocoCppParser DEFINE_SYMBOL CppParser_EXPORTS ) -target_link_libraries( "${LIBNAME}" Foundation) -target_include_directories( "${LIBNAME}" +target_link_libraries(CppParser PUBLIC Poco::Foundation) +target_include_directories(CppParser PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ) -target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS}) -POCO_INSTALL("${LIBNAME}") -POCO_GENERATE_PACKAGE("${LIBNAME}") +POCO_INSTALL(CppParser) +POCO_GENERATE_PACKAGE(CppParser) if (ENABLE_TESTS) add_subdirectory(testsuite) diff --git a/CppParser/testsuite/CMakeLists.txt b/CppParser/testsuite/CMakeLists.txt index 48203225e..5bee88ad6 100644 --- a/CppParser/testsuite/CMakeLists.txt +++ b/CppParser/testsuite/CMakeLists.txt @@ -1,5 +1,3 @@ -set(TESTUNIT "${LIBNAME}-testrunner") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G}) @@ -12,11 +10,11 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF src/WinDriver.cpp ) -add_executable( ${TESTUNIT} ${TEST_SRCS} ) +add_executable(CppParser-testrunner ${TEST_SRCS} ) if(ANDROID) - add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/${TESTUNIT} -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) + add_test(NAME CppParser WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/CppParser-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) else() - add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all) + add_test(NAME CppParser WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND CppParser-testrunner -all) endif() -target_link_libraries( ${TESTUNIT} PocoCppParser PocoFoundation CppUnit ) +target_link_libraries(CppParser-testrunner PUBLIC Poco::CppParser CppUnit) diff --git a/CppUnit/CMakeLists.txt b/CppUnit/CMakeLists.txt index c17ee3ff2..af4d04301 100644 --- a/CppUnit/CMakeLists.txt +++ b/CppUnit/CMakeLists.txt @@ -1,10 +1,4 @@ -set(LIBNAME "CppUnit") - # Sources -add_definitions(-DPOCO_NO_AUTOMATIC_LIBS) -if (WIN32) - add_definitions(-D_CRT_SECURE_NO_WARNINGS) -endif (WIN32) file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( SRCS ${SRCS_G}) @@ -12,16 +6,25 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G}) file(GLOB_RECURSE HDRS_G "include/*.h" ) POCO_HEADERS_AUTO( SRCS ${HDRS_G}) -add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} ) -set_target_properties( "${LIBNAME}" +add_library(CppUnit ${SRCS}) +set_target_properties(CppUnit PROPERTIES VERSION "1" SOVERSION "1" DEFINE_SYMBOL CppUnit_EXPORTS) -target_link_libraries( "${LIBNAME}" Foundation) -target_include_directories( "${LIBNAME}" +target_link_libraries(CppUnit Poco::Foundation) +target_include_directories(CppUnit PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ) -target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS}) +target_compile_definitions(CppUnit PUBLIC POCO_NO_AUTOMATIC_LIBS) +if(NOT BUILD_SHARED_LIBS) + target_compile_definitions(CppUnit + PUBLIC + POCO_STATIC + ) +endif() +if (WIN32) + target_compile_definitions(CppUnit PRIVATE _CRT_SECURE_NO_WARNINGS) +endif (WIN32) diff --git a/CppUnit/WinTestRunner/CMakeLists.txt b/CppUnit/WinTestRunner/CMakeLists.txt index 27416cb8d..c48b98e77 100644 --- a/CppUnit/WinTestRunner/CMakeLists.txt +++ b/CppUnit/WinTestRunner/CMakeLists.txt @@ -1,5 +1,3 @@ -set(LIBNAME "WinTestRunner") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( WIN_SRCS ${SRCS_G}) @@ -11,26 +9,28 @@ POCO_HEADERS_AUTO( WIN_SRCS ${HDRS_G}) file(GLOB_RECURSE HDRS_G "src/*.h" ) POCO_HEADERS_AUTO( WIN_SRCS ${HDRS_G}) -# TODO: Is this flag always required? -add_definitions("-D_AFXDLL") -#TODO: Use instead of the flag above: find_package(MFC) - -add_library( "${LIBNAME}" ${LIB_MODE} ${WIN_SRCS} ) -set_target_properties( "${LIBNAME}" +add_library(WinTestRunner ${WIN_SRCS} ) +set_target_properties(WinTestRunner PROPERTIES VERSION "1" SOVERSION "1" DEFINE_SYMBOL WinTestRunner_EXPORTS) -target_link_libraries( "${LIBNAME}" CppUnit ) -target_include_directories( "${LIBNAME}" +target_link_libraries(WinTestRunner PUBLIC CppUnit) +target_include_directories(WinTestRunner PUBLIC $ $ 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) diff --git a/Crypto/CMakeLists.txt b/Crypto/CMakeLists.txt index ea948be79..dfb80880e 100644 --- a/Crypto/CMakeLists.txt +++ b/Crypto/CMakeLists.txt @@ -1,6 +1,3 @@ -set(LIBNAME "Crypto") -set(POCO_LIBNAME "Poco${LIBNAME}") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( SRCS ${SRCS_G}) @@ -9,28 +6,25 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G}) file(GLOB_RECURSE HDRS_G "include/*.h" ) POCO_HEADERS_AUTO( SRCS ${HDRS_G}) -#add_definitions(-D_USRDLL) - -add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} ) -add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}") -set_target_properties( "${LIBNAME}" +add_library(Crypto ${SRCS} ) +add_library(Poco::Crypto ALIAS Crypto) +set_target_properties(Crypto PROPERTIES VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} - OUTPUT_NAME ${POCO_LIBNAME} + OUTPUT_NAME PocoCrypto DEFINE_SYMBOL Crypto_EXPORTS ) -target_link_libraries( "${LIBNAME}" Foundation ${OPENSSL_LIBRARIES} ) -target_include_directories( "${LIBNAME}" +target_link_libraries(Crypto PUBLIC Poco::Foundation OpenSSL::SSL OpenSSL::Crypto) +target_include_directories(Crypto PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ) -target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS}) -POCO_INSTALL("${LIBNAME}") -POCO_GENERATE_PACKAGE("${LIBNAME}") +POCO_INSTALL(Crypto) +POCO_GENERATE_PACKAGE(Crypto) if (ENABLE_TESTS) add_subdirectory(samples) diff --git a/Crypto/samples/genrsakey/CMakeLists.txt b/Crypto/samples/genrsakey/CMakeLists.txt index 2feabdc94..f415fbc18 100644 --- a/Crypto/samples/genrsakey/CMakeLists.txt +++ b/Crypto/samples/genrsakey/CMakeLists.txt @@ -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) diff --git a/Crypto/testsuite/CMakeLists.txt b/Crypto/testsuite/CMakeLists.txt index 75fcc21ba..be7c05b8f 100644 --- a/Crypto/testsuite/CMakeLists.txt +++ b/Crypto/testsuite/CMakeLists.txt @@ -1,5 +1,3 @@ -set(TESTUNIT "${LIBNAME}-testrunner") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G}) @@ -16,14 +14,14 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE src/WinCEDriver.cpp ) -add_executable( ${TESTUNIT} ${TEST_SRCS} ) +add_executable(Crypto-testrunner ${TEST_SRCS} ) if(ANDROID) - add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/${TESTUNIT} -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) + add_test(NAME Crypto WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/Crypto-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) else() - add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all) + add_test(NAME Crypto WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND Crypto-testrunner -all) endif() -target_link_libraries( ${TESTUNIT} PocoCrypto PocoNetSSL PocoXML PocoUtil PocoFoundation CppUnit ) +target_link_libraries(Crypto-testrunner PUBLIC Poco::NetSSL Poco::XML CppUnit) if(UNIX AND NOT ANDROID) - target_link_libraries( ${TESTUNIT} pthread) + target_link_libraries(Crypto-testrunner PUBLIC pthread) endif(UNIX AND NOT ANDROID) diff --git a/Data/CMakeLists.txt b/Data/CMakeLists.txt index 975d2937e..c518b74e5 100644 --- a/Data/CMakeLists.txt +++ b/Data/CMakeLists.txt @@ -1,6 +1,3 @@ -set(LIBNAME "Data") -set(POCO_LIBNAME "Poco${LIBNAME}") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( SRCS ${SRCS_G}) @@ -9,81 +6,69 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G}) file(GLOB_RECURSE HDRS_G "include/*.h" ) POCO_HEADERS_AUTO( SRCS ${HDRS_G}) -if (NOT POCO_STATIC) - add_definitions(-DTHREADSAFE) -endif (NOT POCO_STATIC) - if(MSVC AND NOT(MSVC_VERSION LESS 1400)) set_source_files_properties(src/StatementImpl.cpp PROPERTIES COMPILE_FLAGS "/bigobj") endif() -add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} ) -add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}") -set_target_properties( "${LIBNAME}" + +add_library(Data ${SRCS} ) +add_library(Poco::Data ALIAS Data) +set_target_properties(Data PROPERTIES VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} - OUTPUT_NAME ${POCO_LIBNAME} + OUTPUT_NAME PocoData DEFINE_SYMBOL Data_EXPORTS ) -target_link_libraries( "${LIBNAME}" Foundation) -target_include_directories( "${LIBNAME}" +target_link_libraries(Data PUBLIC Poco::Foundation) +target_include_directories(Data PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ) -target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS}) -POCO_INSTALL("${LIBNAME}") -POCO_GENERATE_PACKAGE("${LIBNAME}") +POCO_INSTALL(Data) +POCO_GENERATE_PACKAGE(Data) if(ENABLE_DATA_SQLITE) # SQlite3 is built in any case + message(STATUS "SQLite Support Enabled") add_subdirectory( SQLite ) -endif(ENABLE_DATA_SQLITE) +else(ENABLE_DATA_SQLITE) + message(STATUS "SQLite Support Disabled") +endif() -if(ENABLE_DATA_MYSQL) - find_package(MySQL) - if(MYSQL_FOUND) - include_directories("${MYSQL_INCLUDE_DIR}") - message(STATUS "MySQL Support Enabled") - add_subdirectory( MySQL ) +if(MYSQL_FOUND AND ENABLE_DATA_MYSQL) + include_directories("${MYSQL_INCLUDE_DIR}") # TODO(Bjoe) use target_include_directories or target_link_libraries + message(STATUS "MySQL Support Enabled") + add_subdirectory( MySQL ) +else() + message(STATUS "MySQL Support Disabled - no MySQL library") +endif() + +if(POSTGRESQL_FOUND AND ENABLE_DATA_POSTGRESQL) + include_directories("${PostgreSQL_INCLUDE_DIR}") # TODO(Bjoe) Use target_link_libraries() + message(STATUS "PostgreSQL Support Enabled") + add_subdirectory( PostgreSQL ) +else() + message(STATUS "PostgreSQL Support Disabled - no PostgreSQL library") +endif() + +if(WIN32 AND NOT WINCE AND ENABLE_DATA_ODBC) + set(ODBC_LIBRARIES "odbc32" "odbccp32") # TODO(Bjoe) Verify if this is not set via find_package(ODBC) + message(STATUS "Windows native ODBC Support Enabled") + add_subdirectory( ODBC ) +else() + if(ODBC_FOUND AND ENABLE_DATA_ODBC) + include_directories("${ODBC_INCLUDE_DIRECTORIES}") # TODO(Bjoe) use target_include_directories or target_link_libraries + message(STATUS "ODBC Support Enabled") + add_subdirectory( ODBC ) else() - message(STATUS "MySQL Support Disabled - no MySQL library") - endif(MYSQL_FOUND) -endif(ENABLE_DATA_MYSQL) - -if(ENABLE_DATA_POSTGRESQL) - find_package(PostgreSQL) - if(POSTGRESQL_FOUND) - include_directories("${PostgreSQL_INCLUDE_DIR}") - if(POCO_VERBOSE_MESSAGES) - message(STATUS "PostgreSQL Support Enabled") - endif() - add_subdirectory( PostgreSQL ) - elseif(POCO_VERBOSE_MESSAGES) - message(STATUS "PostgreSQL Support Disabled - no PostgreSQL library") - endif(POSTGRESQL_FOUND) -endif(ENABLE_DATA_POSTGRESQL) - -if(ENABLE_DATA_ODBC) - find_package(ODBC) - if(WIN32 AND NOT WINCE) - set(ODBC_LIBRARIES "odbc32" "odbccp32") - message(STATUS "Windows native ODBC Support Enabled") - add_subdirectory( ODBC ) - else(WIN32 AND NOT WINCE) - if(ODBC_FOUND) - include_directories("${ODBC_INCLUDE_DIRECTORIES}") - message(STATUS "ODBC Support Enabled") - add_subdirectory( ODBC ) - else() - message(STATUS "ODBC Support Disabled - no ODBC runtime") - endif() - endif(WIN32 AND NOT WINCE) -endif(ENABLE_DATA_ODBC) + message(STATUS "ODBC Support Disabled - no ODBC runtime") + endif() +endif() if (ENABLE_TESTS) add_subdirectory(samples) diff --git a/Data/MySQL/CMakeLists.txt b/Data/MySQL/CMakeLists.txt index 510c6cb77..14744e1a8 100644 --- a/Data/MySQL/CMakeLists.txt +++ b/Data/MySQL/CMakeLists.txt @@ -1,6 +1,3 @@ -set(LIBNAME "DataMySQL") -set(POCO_LIBNAME "Poco${LIBNAME}") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( MYSQL_SRCS ${SRCS_G}) @@ -9,28 +6,26 @@ POCO_SOURCES_AUTO( MYSQL_SRCS ${SRCS_G}) file(GLOB_RECURSE HDRS_G "include/*.h" ) POCO_HEADERS_AUTO( MYSQL_SRCS ${HDRS_G}) -add_definitions(-DTHREADSAFE -DNO_TCL) - -add_library( "${LIBNAME}" ${LIB_MODE} ${MYSQL_SRCS} ) -add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}") -set_target_properties( "${LIBNAME}" +add_library(DataMySQL ${MYSQL_SRCS} ) +add_library(Poco::DataMySQL ALIAS DataMySQL) +set_target_properties(DataMySQL PROPERTIES VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} - OUTPUT_NAME ${POCO_LIBNAME} + OUTPUT_NAME PocoDataMySQL DEFINE_SYMBOL MySQL_EXPORTS ) -target_link_libraries( "${LIBNAME}" Foundation Data ${MYSQL_LIB}) -target_include_directories( "${LIBNAME}" +target_link_libraries(DataMySQL PUBLIC Poco::Data ${MYSQL_LIB}) +target_include_directories(DataMySQL PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ) -target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS}) +target_compile_definitions(DataMySQL PUBLIC THREADSAFE NO_TCL) -POCO_INSTALL("${LIBNAME}") -POCO_GENERATE_PACKAGE("${LIBNAME}") +POCO_INSTALL(DataMySQL) +POCO_GENERATE_PACKAGE(DataMySQL) if (ENABLE_TESTS) add_subdirectory(testsuite) diff --git a/Data/MySQL/testsuite/CMakeLists.txt b/Data/MySQL/testsuite/CMakeLists.txt index 01df02e55..35a735e6a 100644 --- a/Data/MySQL/testsuite/CMakeLists.txt +++ b/Data/MySQL/testsuite/CMakeLists.txt @@ -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) diff --git a/Data/ODBC/CMakeLists.txt b/Data/ODBC/CMakeLists.txt index 67d2d955f..3f05c84e3 100644 --- a/Data/ODBC/CMakeLists.txt +++ b/Data/ODBC/CMakeLists.txt @@ -1,6 +1,3 @@ -set(LIBNAME "DataODBC") -set(POCO_LIBNAME "Poco${LIBNAME}") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( ODBC_SRCS ${SRCS_G}) @@ -9,28 +6,26 @@ POCO_SOURCES_AUTO( ODBC_SRCS ${SRCS_G}) file(GLOB_RECURSE HDRS_G "include/*.h" ) POCO_HEADERS_AUTO( ODBC_SRCS ${HDRS_G}) -add_definitions( ${ODBC_CFLAGS} -DTHREADSAFE) - -add_library( "${LIBNAME}" ${LIB_MODE} ${ODBC_SRCS} ) -add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}") -set_target_properties( "${LIBNAME}" +add_library(DataODBC ${ODBC_SRCS}) +add_library(Poco::DataODBC ALIAS DataODBC) +set_target_properties(DataODBC PROPERTIES VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} - OUTPUT_NAME ${POCO_LIBNAME} + OUTPUT_NAME PocoDataODBC DEFINE_SYMBOL ODBC_EXPORTS ) -target_link_libraries( "${LIBNAME}" Foundation Data ${ODBC_LIBRARIES}) -target_include_directories( "${LIBNAME}" +target_link_libraries(DataODBC PUBLIC Poco::Data ${ODBC_LIBRARIES}) +target_include_directories(DataODBC PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ) -target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS}) +target_compile_definitions(DataODBC PUBLIC ${ODBC_CFLAGS} THREADSAFE) -POCO_INSTALL("${LIBNAME}") -POCO_GENERATE_PACKAGE("${LIBNAME}") +POCO_INSTALL(DataODBC) +POCO_GENERATE_PACKAGE(DataODBC) if (ENABLE_TESTS) add_subdirectory(testsuite) diff --git a/Data/ODBC/testsuite/CMakeLists.txt b/Data/ODBC/testsuite/CMakeLists.txt index eb566675c..afc723cf8 100644 --- a/Data/ODBC/testsuite/CMakeLists.txt +++ b/Data/ODBC/testsuite/CMakeLists.txt @@ -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) diff --git a/Data/PostgreSQL/CMakeLists.txt b/Data/PostgreSQL/CMakeLists.txt index 986a2aa51..7f9cd16a9 100644 --- a/Data/PostgreSQL/CMakeLists.txt +++ b/Data/PostgreSQL/CMakeLists.txt @@ -1,6 +1,3 @@ -set(LIBNAME "SQLPostgreSQL") -set(POCO_LIBNAME "Poco${LIBNAME}") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( POSTGRESQL_SRCS ${SRCS_G}) @@ -9,25 +6,25 @@ POCO_SOURCES_AUTO( POSTGRESQL_SRCS ${SRCS_G}) file(GLOB_RECURSE HDRS_G "include/*.h" ) POCO_HEADERS_AUTO( POSTGRESQL_SRCS ${HDRS_G}) -add_library( "${LIBNAME}" ${POSTGRESQL_SRCS} ) -add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}") -set_target_properties( "${LIBNAME}" +add_library(DataPostgreSQL ${POSTGRESQL_SRCS} ) +add_library(Poco::DataPostgreSQL ALIAS DataPostgreSQL) +set_target_properties(DataPostgreSQL PROPERTIES VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} - OUTPUT_NAME ${POCO_LIBNAME} + OUTPUT_NAME PocoDataPostgreSQL DEFINE_SYMBOL PostgreSQL_EXPORTS ) -target_link_libraries( "${LIBNAME}" Foundation SQL ${PostgreSQL_LIBRARIES}) -target_include_directories( "${LIBNAME}" +target_link_libraries(DataPostgreSQL PUBLIC Poco::Data ${PostgreSQL_LIBRARIES}) +target_include_directories(DataPostgreSQL PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src - ) +) -POCO_INSTALL("${LIBNAME}") -POCO_GENERATE_PACKAGE("${LIBNAME}") +POCO_INSTALL(DataPostgreSQL) +POCO_GENERATE_PACKAGE(DataPostgreSQL) if (POCO_ENABLE_TESTS) add_subdirectory(testsuite) diff --git a/Data/PostgreSQL/cmake/PocoDataPostgreSQLConfig.cmake b/Data/PostgreSQL/cmake/PocoDataPostgreSQLConfig.cmake new file mode 100644 index 000000000..f4b6ab632 --- /dev/null +++ b/Data/PostgreSQL/cmake/PocoDataPostgreSQLConfig.cmake @@ -0,0 +1,4 @@ +include(CMakeFindDependencyMacro) +find_dependency(PocoFoundation) +find_dependency(PocoData) +include("${CMAKE_CURRENT_LIST_DIR}/PocoDataPostgreSQLTargets.cmake") diff --git a/Data/PostgreSQL/cmake/PocoSQLPostgreSQLConfig.cmake b/Data/PostgreSQL/cmake/PocoSQLPostgreSQLConfig.cmake deleted file mode 100644 index 43c9a5c18..000000000 --- a/Data/PostgreSQL/cmake/PocoSQLPostgreSQLConfig.cmake +++ /dev/null @@ -1,4 +0,0 @@ -include(CMakeFindDependencyMacro) -find_dependency(PocoFoundation) -find_dependency(PocoSQL) -include("${CMAKE_CURRENT_LIST_DIR}/PocoSQLPostgreSQLTargets.cmake") diff --git a/Data/PostgreSQL/testsuite/CMakeLists.txt b/Data/PostgreSQL/testsuite/CMakeLists.txt index 6721b61eb..6e0f140e6 100644 --- a/Data/PostgreSQL/testsuite/CMakeLists.txt +++ b/Data/PostgreSQL/testsuite/CMakeLists.txt @@ -1,5 +1,3 @@ -set(TESTUNIT "${LIBNAME}-testrunner") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G}) @@ -12,6 +10,6 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF src/WinDriver.cpp ) -add_executable( ${TESTUNIT} ${TEST_SRCS} ) -add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all) -target_link_libraries( ${TESTUNIT} PocoSQLPostgreSQL PocoSQL PocoFoundation CppUnit ${PostgreSQL_LIBRARIES}) +add_executable(DataPostgreSQL-testrunner ${TEST_SRCS} ) +add_test(NAME DataPostgreSQL WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND DataPostgreSQL-testrunner -all) +target_link_libraries(DataPostgreSQL-testrunner PUBLIC Poco::DataPostgreSQL CppUnit) diff --git a/Data/SQLite/CMakeLists.txt b/Data/SQLite/CMakeLists.txt index 6509421ee..a9d6e06aa 100644 --- a/Data/SQLite/CMakeLists.txt +++ b/Data/SQLite/CMakeLists.txt @@ -1,6 +1,3 @@ -set(LIBNAME "DataSQLite") -set(POCO_LIBNAME "Poco${LIBNAME}") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( SQLITE_SRCS ${SRCS_G}) @@ -10,9 +7,7 @@ file(GLOB_RECURSE HDRS_G "include/*.h" ) POCO_HEADERS_AUTO( SQLITE_SRCS ${HDRS_G}) if (POCO_UNBUNDLED) - find_package(SQLite3) - set(DATASQLITELIBS ${SQLITE3_LIBRARIES}) - include_directories("${SQLITE3_INCLUDE_DIRS}") + find_package(SQLite3 REQUIRED) else() # sqlite3 POCO_SOURCES( SQLITE_SRCS sqlite3 @@ -22,36 +17,45 @@ else() POCO_HEADERS( SQLITE_SRCS sqlite3 src/sqlite3.h ) - - set(DATASQLITELIBS "") endif() -if(WINCE) - add_definitions(-DSQLITE_MSVC_LOCALTIME_API) -endif(WINCE) +add_library(DataSQLite ${SQLITE_SRCS} ) -add_definitions(-DSQLITE_THREADSAFE=1 -DSQLITE_DISABLE_LFS -DSQLITE_OMIT_UTF16 -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_COMPLETE -DSQLITE_OMIT_TCL_VARIABLE -DSQLITE_OMIT_DEPRECATED) - -add_library( "${LIBNAME}" ${LIB_MODE} ${SQLITE_SRCS} ) -add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}") -set_target_properties( "${LIBNAME}" +add_library(Poco::DataSQLite ALIAS DataSQLite) +set_target_properties(DataSQLite PROPERTIES VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} - OUTPUT_NAME ${POCO_LIBNAME} + OUTPUT_NAME PocoDataSQLite DEFINE_SYMBOL SQLite_EXPORTS ) - -target_link_libraries( "${LIBNAME}" Foundation Data ${DATASQLITELIBS} ) -target_include_directories( "${LIBNAME}" +target_link_libraries(DataSQLite PUBLIC Poco::Data ${SQLITE3_LIBRARIES}) +target_include_directories(DataSQLite PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ) -target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS}) -POCO_INSTALL("${LIBNAME}") -POCO_GENERATE_PACKAGE("${LIBNAME}") +if(POCO_UNBUNDLED) + target_include_directories(DataSQLite PUBLIC "${SQLITE3_INCLUDE_DIRS}") + target_compile_definitions(DataSQLite PUBLIC POCO_UNBUNDLED) +else() + if(WINCE) + target_compile_definitions(DataSQLite PRIVATE SQLITE_MSVC_LOCALTIME_API) + endif(WINCE) + target_compile_definitions(DataSQLite PRIVATE + SQLITE_THREADSAFE=1 + SQLITE_DISABLE_LFS + SQLITE_OMIT_UTF16 + SQLITE_OMIT_PROGRESS_CALLBACK + SQLITE_OMIT_COMPLETE + SQLITE_OMIT_TCL_VARIABLE + SQLITE_OMIT_DEPRECATED + ) +endif() + +POCO_INSTALL(DataSQLite) +POCO_GENERATE_PACKAGE(DataSQLite) if (ENABLE_TESTS) add_subdirectory(testsuite) diff --git a/Data/SQLite/testsuite/CMakeLists.txt b/Data/SQLite/testsuite/CMakeLists.txt index e9576d873..3734acf6a 100644 --- a/Data/SQLite/testsuite/CMakeLists.txt +++ b/Data/SQLite/testsuite/CMakeLists.txt @@ -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) diff --git a/Data/samples/Binding/CMakeLists.txt b/Data/samples/Binding/CMakeLists.txt index 0e43e6cfe..3cb198dfd 100644 --- a/Data/samples/Binding/CMakeLists.txt +++ b/Data/samples/Binding/CMakeLists.txt @@ -1,7 +1,2 @@ -set(SAMPLE_NAME "Binding") - -set(LOCAL_SRCS "") -aux_source_directory(src LOCAL_SRCS) - -add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) -target_link_libraries( ${SAMPLE_NAME} PocoDataSQLite PocoData PocoFoundation ) +add_executable(Binding src/Binding.cpp) +target_link_libraries(Binding PUBLIC Poco::DataSQLite) diff --git a/Data/samples/RecordSet/CMakeLists.txt b/Data/samples/RecordSet/CMakeLists.txt index 8f6be903d..cc2019740 100644 --- a/Data/samples/RecordSet/CMakeLists.txt +++ b/Data/samples/RecordSet/CMakeLists.txt @@ -1,7 +1,2 @@ -set(SAMPLE_NAME "RecordSet") - -set(LOCAL_SRCS "") -aux_source_directory(src LOCAL_SRCS) - -add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) -target_link_libraries( ${SAMPLE_NAME} PocoDataSQLite PocoData PocoFoundation ) +add_executable(RecordSet src/RecordSet.cpp) +target_link_libraries(RecordSet PUBLIC Poco::DataSQLite) diff --git a/Data/samples/RowFormatter/CMakeLists.txt b/Data/samples/RowFormatter/CMakeLists.txt index 54e732a23..ab9dd83aa 100644 --- a/Data/samples/RowFormatter/CMakeLists.txt +++ b/Data/samples/RowFormatter/CMakeLists.txt @@ -1,7 +1,2 @@ -set(SAMPLE_NAME "RowFormatter") - -set(LOCAL_SRCS "") -aux_source_directory(src LOCAL_SRCS) - -add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) -target_link_libraries( ${SAMPLE_NAME} PocoDataSQLite PocoData PocoFoundation ) +add_executable(RowFormatter src/RowFormatter.cpp) +target_link_libraries(RowFormatter PUBLIC Poco::DataSQLite) diff --git a/Data/samples/Tuple/CMakeLists.txt b/Data/samples/Tuple/CMakeLists.txt index de28affae..b428f70e2 100644 --- a/Data/samples/Tuple/CMakeLists.txt +++ b/Data/samples/Tuple/CMakeLists.txt @@ -1,7 +1,2 @@ -set(SAMPLE_NAME "Tuple") - -set(LOCAL_SRCS "") -aux_source_directory(src LOCAL_SRCS) - -add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) -target_link_libraries( ${SAMPLE_NAME} PocoDataSQLite PocoData PocoFoundation ) +add_executable(Tuple src/Tuple.cpp) +target_link_libraries(Tuple PUBLIC Poco::DataSQLite) diff --git a/Data/samples/TypeHandler/CMakeLists.txt b/Data/samples/TypeHandler/CMakeLists.txt index 5942db43c..4fec26406 100644 --- a/Data/samples/TypeHandler/CMakeLists.txt +++ b/Data/samples/TypeHandler/CMakeLists.txt @@ -1,7 +1,2 @@ -set(SAMPLE_NAME "TypeHandler") - -set(LOCAL_SRCS "") -aux_source_directory(src LOCAL_SRCS) - -add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) -target_link_libraries( ${SAMPLE_NAME} PocoDataSQLite PocoData PocoFoundation ) +add_executable(TypeHandler src/TypeHandler.cpp) +target_link_libraries(TypeHandler PUBLIC Poco::DataSQLite) diff --git a/Data/samples/WebNotifier/CMakeLists.txt b/Data/samples/WebNotifier/CMakeLists.txt index 167898b1f..5f08b0c8b 100644 --- a/Data/samples/WebNotifier/CMakeLists.txt +++ b/Data/samples/WebNotifier/CMakeLists.txt @@ -1,7 +1,2 @@ -set(SAMPLE_NAME "WebNotifier") - -set(LOCAL_SRCS "") -aux_source_directory(src LOCAL_SRCS) - -add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) -target_link_libraries( ${SAMPLE_NAME} PocoDataSQLite PocoData PocoNet PocoFoundation ) +add_executable(WebNotifier src/WebNotifier.cpp) +target_link_libraries(WebNotifier PUBLIC Poco::DataSQLite Poco::Net) diff --git a/Data/testsuite/CMakeLists.txt b/Data/testsuite/CMakeLists.txt index e86d56ba2..e02b601c9 100644 --- a/Data/testsuite/CMakeLists.txt +++ b/Data/testsuite/CMakeLists.txt @@ -1,5 +1,3 @@ -set(TESTUNIT "${LIBNAME}-testrunner") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G}) @@ -21,11 +19,11 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF src/StatementImpl.cpp ) -add_executable( ${TESTUNIT} ${TEST_SRCS} ) +add_executable(Data-testrunner ${TEST_SRCS} ) if(ANDROID) - add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/${TESTUNIT} -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) + add_test(NAME Data WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/Data-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) else() - add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all) + add_test(NAME Data WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND Data-testrunner -all) endif() -target_link_libraries( ${TESTUNIT} PocoData PocoUtil PocoXML PocoFoundation CppUnit) +target_link_libraries(Data-testrunner PUBLIC Poco::Data CppUnit) diff --git a/Encodings/CMakeLists.txt b/Encodings/CMakeLists.txt index 41ac2cd15..e0a9c5cde 100644 --- a/Encodings/CMakeLists.txt +++ b/Encodings/CMakeLists.txt @@ -1,6 +1,3 @@ -set(LIBNAME "Encodings") -set(POCO_LIBNAME "Poco${LIBNAME}") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES( SRCS Encodings ${SRCS_G}) @@ -9,26 +6,25 @@ POCO_SOURCES( SRCS Encodings ${SRCS_G}) file(GLOB_RECURSE HDRS_G "include/*.h" ) POCO_HEADERS( SRCS Encodings ${HDRS_G}) -add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} ) -add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}") -set_target_properties( "${LIBNAME}" +add_library(Encodings ${SRCS} ) +add_library(Poco::Encodings ALIAS Encodings) +set_target_properties(Encodings PROPERTIES VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} - OUTPUT_NAME ${POCO_LIBNAME} + OUTPUT_NAME PocoEncodings DEFINE_SYMBOL Encodings_EXPORTS ) -target_link_libraries( "${LIBNAME}" Foundation) -target_include_directories( "${LIBNAME}" +target_link_libraries(Encodings PUBLIC Poco::Foundation) +target_include_directories(Encodings PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ) -target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS}) -POCO_INSTALL("${LIBNAME}") -POCO_GENERATE_PACKAGE("${LIBNAME}") +POCO_INSTALL(Encodings) +POCO_GENERATE_PACKAGE(Encodings) if (ENABLE_TESTS) add_subdirectory(samples) diff --git a/Encodings/Compiler/CMakeLists.txt b/Encodings/Compiler/CMakeLists.txt index ccb99e3bc..1d8b959ec 100644 --- a/Encodings/Compiler/CMakeLists.txt +++ b/Encodings/Compiler/CMakeLists.txt @@ -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 - ) +) diff --git a/Encodings/samples/TextConverter/CMakeLists.txt b/Encodings/samples/TextConverter/CMakeLists.txt index a6871570e..12f0082b1 100644 --- a/Encodings/samples/TextConverter/CMakeLists.txt +++ b/Encodings/samples/TextConverter/CMakeLists.txt @@ -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) diff --git a/Encodings/testsuite/CMakeLists.txt b/Encodings/testsuite/CMakeLists.txt index 7508e5522..d55c7a57e 100644 --- a/Encodings/testsuite/CMakeLists.txt +++ b/Encodings/testsuite/CMakeLists.txt @@ -1,5 +1,3 @@ -set(TESTUNIT "${LIBNAME}-testrunner") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G}) @@ -16,16 +14,16 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE src/WinCEDriver.cpp ) -add_executable( ${TESTUNIT} ${TEST_SRCS} ) +add_executable(Encodings-testrunner ${TEST_SRCS} ) if(ANDROID) - add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} "-DTEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/data;" -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/${TESTUNIT} -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) + add_test(NAME Encodings WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} "-DTEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/data;" -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/Encodings-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) else() - add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all) + add_test(NAME Encodings WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND Encodings-testrunner -all) # The test is run in the build directory. So the test data is copied there too - add_custom_command(TARGET ${TESTUNIT} POST_BUILD + add_custom_command(TARGET Encodings-testrunner POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data ) endif() -#set_target_properties( ${TESTUNIT} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} ) -target_link_libraries( ${TESTUNIT} PocoEncodings PocoFoundation CppUnit ) +#set_target_properties(Encodings-testrunner PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} ) +target_link_libraries(Encodings-testrunner PUBLIC Poco::Encodings CppUnit) diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt index 4380a38ce..3d286c7a7 100644 --- a/Foundation/CMakeLists.txt +++ b/Foundation/CMakeLists.txt @@ -1,6 +1,3 @@ -set(LIBNAME "Foundation") -set(POCO_LIBNAME "Poco${LIBNAME}") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( SRCS ${SRCS_G}) @@ -33,8 +30,7 @@ POCO_MESSAGES( SRCS Logging src/pocomsg.mc) # The configuration will fail if the packages are not found if (POCO_UNBUNDLED) find_package(PCRE REQUIRED) - set(SYSLIBS ${SYSLIBS} ${PCRE_LIBRARIES}) - include_directories(${PCRE_INCLUDE_DIRS}) + find_package(ZLIB REQUIRED) #HACK: Unicode.cpp requires functions from these files. The can't be taken from the library POCO_SOURCES( SRCS RegExp @@ -42,12 +38,6 @@ if (POCO_UNBUNDLED) src/pcre_tables.c ) - find_package(ZLIB REQUIRED) - set(SYSLIBS ${SYSLIBS} ${ZLIB_LIBRARIES}) - include_directories(${ZLIB_INCLUDE_DIRS}) - - add_definitions(-DPOCO_UNBUNDLED) - else() # pcre POCO_SOURCES( SRCS pcre @@ -94,84 +84,127 @@ else() ) endif (POCO_UNBUNDLED) -if(WIN32) - set(SYSLIBS ${SYSLIBS} iphlpapi) -endif(WIN32) -if (${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro") - set_target_properties( "${LIBNAME}" PROPERTIES LINK_FLAGS "-library=stlport4") -endif (${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro") -if(ANDROID) - set(SYSLIBS ${SYSLIBS} log) -endif(ANDROID) - -# TODO: Why is this here? -add_definitions( -DPCRE_STATIC) - -# For SetAffinity -if(UNIX AND NOT APPLE) - INCLUDE (CheckFunctionExists) - INCLUDE (CheckCXXSourceCompiles) - INCLUDE (CheckLibraryExists) - CHECK_LIBRARY_EXISTS(pthread pthread_setaffinity_np "pthread.h" HAVE_PTHREAD_SETAFFINITY_NP) - #set(CMAKE_EXTRA_INCLUDE_FILES pthread.h) - #CHECK_FUNCTION_EXISTS(pthread_setaffinity_np HAVE_PTHREAD_SETAFFINITY_NP) - if(NOT HAVE_PTHREAD_SETAFFINITY_NP) - message(STATUS "Platform has not PTHREAD_SETAFFINITY_NP") - else(HAVE_PTHREAD_SETAFFINITY_NP) - add_definitions(-DHAVE_PTHREAD_SETAFFINITY_NP) - CHECK_CXX_SOURCE_COMPILES(" - #include - int main() { - cpu_set_t cpumask; - sched_setaffinity( 0, sizeof(cpumask), &cpumask ); - return 0; - }" HAVE_THREE_PARAM_SCHED_SETAFFINITY) - - if(HAVE_THREE_PARAM_SCHED_SETAFFINITY) - message(STATUS "Platform has THREE PARAM at PTHREAD_SETAFFINITY_NP") - add_definitions(-DHAVE_THREE_PARAM_SCHED_SETAFFINITY) - else(HAVE_THREE_PARAM_SCHED_SETAFFINITY) - CHECK_CXX_SOURCE_COMPILES(" - #include - int main() { - cpu_set_t cpumask; - sched_setaffinity( 0, &cpumask ); - return 0; - }" HAVE_TWO_PARAM_SCHED_SETAFFINITY) - - if(HAVE_TWO_PARAM_SCHED_SETAFFINITY) - message(STATUS "Platform has TWO PARAM at PTHREAD_SETAFFINITY_NP") - add_definitions(-DHAVE_TWO_PARAM_SCHED_SETAFFINITY) - endif(HAVE_TWO_PARAM_SCHED_SETAFFINITY) - - endif(HAVE_THREE_PARAM_SCHED_SETAFFINITY) - endif(NOT HAVE_PTHREAD_SETAFFINITY_NP) -endif(UNIX AND NOT APPLE) - -add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS}) -add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}") -set_target_properties( "${LIBNAME}" +add_library(Foundation ${SRCS}) +add_library(Poco::Foundation ALIAS Foundation) +set_target_properties(Foundation PROPERTIES VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} - OUTPUT_NAME ${POCO_LIBNAME} + OUTPUT_NAME PocoFoundation DEFINE_SYMBOL Foundation_EXPORTS ) -target_link_libraries( "${LIBNAME}" ${SYSLIBS}) -target_include_directories( "${LIBNAME}" +target_link_libraries(Foundation PUBLIC ${PCRE_LIBRARIES} ${ZLIB_LIBRARIES}) +target_include_directories(Foundation PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ) -target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS}) -POCO_INSTALL("${LIBNAME}") -POCO_GENERATE_PACKAGE("${LIBNAME}") +target_compile_definitions(Foundation + PUBLIC + $<$:_DEBUG> +) + +if(NOT BUILD_SHARED_LIBS) + target_compile_definitions(Foundation + PUBLIC + POCO_STATIC + ) +endif() + +if(WIN32) + target_compile_definitions(Foundation PUBLIC POCO_NO_AUTOMATIC_LIBS POCO_OS_FAMILY_WINDOWS UNICODE _UNICODE __LCC__) #__LCC__ define used by MySQL.h + target_link_libraries(Foundation PUBLIC iphlpapi) +endif() + +if (CYGWIN) + target_compile_definitions(Foundation PUBLIC POCO_NO_FPENVIRONMENT POCO_NO_WSTRING _XOPEN_SOURCE=500 __BSD_VISIBLE) +else (CYGWIN) + if (UNIX AND NOT ANDROID ) + target_compile_definitions(Foundation PUBLIC POCO_OS_FAMILY_UNIX) + if (APPLE) + target_compile_definitions(Foundation PUBLIC POCO_HAVE_IPv6 POCO_NO_STAT64) + target_link_libraries(Foundation PUBLIC ${CMAKE_DL_LIBS}) + else (APPLE) + target_compile_definitions(Foundation PUBLIC _REENTRANT _THREAD_SAFE _LARGEFILE64_SOURCE _FILE_OFFSET_BITS=64) + if (QNX) + target_compile_definitions(Foundation PUBLIC POCO_HAVE_FD_POLL) + target_link_libraries(Foundation PUBLIC m socket) + else (QNX) + target_compile_definitions(Foundation PUBLIC _XOPEN_SOURCE=500 POCO_HAVE_FD_EPOLL) + target_link_libraries(Foundation PUBLIC pthread ${CMAKE_DL_LIBS} rt) + endif (QNX) + endif (APPLE) + endif(UNIX AND NOT ANDROID ) +endif (CYGWIN) + +if (CMAKE_SYSTEM MATCHES "SunOS") + target_compile_definitions(Foundation + PUBLIC + POCO_OS_FAMILY_UNIX + _XOPEN_SOURCE=500 + _REENTRANT + _THREAD_SAFE + _LARGEFILE64_SOURCE + _FILE_OFFSET_BITS=64 + ) + target_link_libraries(Foundation PUBLIC pthread socket xnet nsl resolv rt ${CMAKE_DL_LIBS}) +endif() + +if(CMAKE_COMPILER_IS_MINGW) + target_compile_definitions(Foundation + PUBLIC + WC_NO_BEST_FIT_CHARS=0x400 + POCO_WIN32_UTF8 + _WIN32 + MINGW32 + WINVER=0x500 + ODBCVER=0x0300 + POCO_THREAD_STACK_SIZE + ) +endif() + +# SunPro C++ +if(${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro") + target_compile_definitions(Foundation PUBLIC _BSD_SOURCE) + target_compile_options(Foundation PUBLIC -library=stlport4) +endif() + +# iOS +if (IOS) + target_compile_definitions(Foundation + PUBLIC + POCO_HAVE_IPv6 + POCO_NO_FPENVIRONMENT + POCO_NO_STAT64 + POCO_NO_SHAREDLIBS + POCO_NO_NET_IFTYPES + ) +endif() + +#Android +if (ANDROID) + target_compile_definitions(Foundation + PUBLIC + POCO_NO_FPENVIRONMENT + POCO_NO_WSTRING + POCO_NO_SHAREDMEMORY + ) + target_link_libraries(Foundation PUBLIC log) +endif() + +if(POCO_UNBUNDLED) + target_include_directories(Foundation PUBLIC "${PCRE_INCLUDE_DIRS}" "${ZLIB_INCLUDE_DIRS}") + target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED) +endif() + +POCO_INSTALL(Foundation) +POCO_GENERATE_PACKAGE(Foundation) if (ENABLE_TESTS) - add_subdirectory( samples ) - add_subdirectory( testsuite ) + add_subdirectory(samples) + add_subdirectory(testsuite) endif () diff --git a/Foundation/samples/ActiveMethod/CMakeLists.txt b/Foundation/samples/ActiveMethod/CMakeLists.txt index 9dabf9d2a..94596ea87 100644 --- a/Foundation/samples/ActiveMethod/CMakeLists.txt +++ b/Foundation/samples/ActiveMethod/CMakeLists.txt @@ -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 ) diff --git a/Foundation/samples/Activity/CMakeLists.txt b/Foundation/samples/Activity/CMakeLists.txt index 8e61f0211..9c2475ead 100644 --- a/Foundation/samples/Activity/CMakeLists.txt +++ b/Foundation/samples/Activity/CMakeLists.txt @@ -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 ) diff --git a/Foundation/samples/BinaryReaderWriter/CMakeLists.txt b/Foundation/samples/BinaryReaderWriter/CMakeLists.txt index 6e3d3c72c..0754edc7d 100644 --- a/Foundation/samples/BinaryReaderWriter/CMakeLists.txt +++ b/Foundation/samples/BinaryReaderWriter/CMakeLists.txt @@ -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 ) diff --git a/Foundation/samples/DateTime/CMakeLists.txt b/Foundation/samples/DateTime/CMakeLists.txt index db904b9e2..76db24170 100644 --- a/Foundation/samples/DateTime/CMakeLists.txt +++ b/Foundation/samples/DateTime/CMakeLists.txt @@ -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) diff --git a/Foundation/samples/LineEndingConverter/CMakeLists.txt b/Foundation/samples/LineEndingConverter/CMakeLists.txt index a8c443a94..e584f7ed3 100644 --- a/Foundation/samples/LineEndingConverter/CMakeLists.txt +++ b/Foundation/samples/LineEndingConverter/CMakeLists.txt @@ -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 ) diff --git a/Foundation/samples/LogRotation/CMakeLists.txt b/Foundation/samples/LogRotation/CMakeLists.txt index 8be93b269..72ed3b84e 100644 --- a/Foundation/samples/LogRotation/CMakeLists.txt +++ b/Foundation/samples/LogRotation/CMakeLists.txt @@ -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 ) diff --git a/Foundation/samples/Logger/CMakeLists.txt b/Foundation/samples/Logger/CMakeLists.txt index 574038287..b58fa0af3 100644 --- a/Foundation/samples/Logger/CMakeLists.txt +++ b/Foundation/samples/Logger/CMakeLists.txt @@ -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 ) diff --git a/Foundation/samples/NotificationQueue/CMakeLists.txt b/Foundation/samples/NotificationQueue/CMakeLists.txt index 35b2b61b0..3e72e97c2 100644 --- a/Foundation/samples/NotificationQueue/CMakeLists.txt +++ b/Foundation/samples/NotificationQueue/CMakeLists.txt @@ -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 ) diff --git a/Foundation/samples/StringTokenizer/CMakeLists.txt b/Foundation/samples/StringTokenizer/CMakeLists.txt index 3ad93f867..f0905ecf5 100644 --- a/Foundation/samples/StringTokenizer/CMakeLists.txt +++ b/Foundation/samples/StringTokenizer/CMakeLists.txt @@ -1,7 +1,2 @@ -set(SAMPLE_NAME "StringTokenizer") - -set(LOCAL_SRCS "") -aux_source_directory(src LOCAL_SRCS) - -add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) -target_link_libraries( ${SAMPLE_NAME} PocoJSON PocoXML PocoFoundation) +add_executable(StringTokenizer src/StringTokenizer.cpp) +target_link_libraries(StringTokenizer PUBLIC Poco::JSON Poco::XML Poco::Foundation) diff --git a/Foundation/samples/Timer/CMakeLists.txt b/Foundation/samples/Timer/CMakeLists.txt index 1f90c34c0..130bd1163 100644 --- a/Foundation/samples/Timer/CMakeLists.txt +++ b/Foundation/samples/Timer/CMakeLists.txt @@ -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 ) diff --git a/Foundation/samples/URI/CMakeLists.txt b/Foundation/samples/URI/CMakeLists.txt index c120f5631..05aef6df4 100644 --- a/Foundation/samples/URI/CMakeLists.txt +++ b/Foundation/samples/URI/CMakeLists.txt @@ -1,7 +1,2 @@ -set(SAMPLE_NAME "URI") - -set(LOCAL_SRCS "") -aux_source_directory(src LOCAL_SRCS) - -add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) -target_link_libraries( ${SAMPLE_NAME} PocoJSON PocoXML PocoFoundation ) +add_executable(URI src/URI.cpp) +target_link_libraries(URI PUBLIC Poco::JSON Poco::XML Poco::Foundation ) diff --git a/Foundation/samples/base64decode/CMakeLists.txt b/Foundation/samples/base64decode/CMakeLists.txt index 89a1e5e20..478acfd80 100644 --- a/Foundation/samples/base64decode/CMakeLists.txt +++ b/Foundation/samples/base64decode/CMakeLists.txt @@ -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 ) diff --git a/Foundation/samples/base64encode/CMakeLists.txt b/Foundation/samples/base64encode/CMakeLists.txt index fcac90cfe..340200aa2 100644 --- a/Foundation/samples/base64encode/CMakeLists.txt +++ b/Foundation/samples/base64encode/CMakeLists.txt @@ -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 ) diff --git a/Foundation/samples/deflate/CMakeLists.txt b/Foundation/samples/deflate/CMakeLists.txt index cce01c0ec..b399a55ca 100644 --- a/Foundation/samples/deflate/CMakeLists.txt +++ b/Foundation/samples/deflate/CMakeLists.txt @@ -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 ) diff --git a/Foundation/samples/dir/CMakeLists.txt b/Foundation/samples/dir/CMakeLists.txt index 58f010de6..27ada10b9 100644 --- a/Foundation/samples/dir/CMakeLists.txt +++ b/Foundation/samples/dir/CMakeLists.txt @@ -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 ) diff --git a/Foundation/samples/grep/CMakeLists.txt b/Foundation/samples/grep/CMakeLists.txt index 3b75a86b9..1cb4cce66 100644 --- a/Foundation/samples/grep/CMakeLists.txt +++ b/Foundation/samples/grep/CMakeLists.txt @@ -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 ) diff --git a/Foundation/samples/hmacmd5/CMakeLists.txt b/Foundation/samples/hmacmd5/CMakeLists.txt index 9c5eafbb3..d784ad36b 100644 --- a/Foundation/samples/hmacmd5/CMakeLists.txt +++ b/Foundation/samples/hmacmd5/CMakeLists.txt @@ -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 ) diff --git a/Foundation/samples/inflate/CMakeLists.txt b/Foundation/samples/inflate/CMakeLists.txt index cacfb0eb5..dcae66a3b 100644 --- a/Foundation/samples/inflate/CMakeLists.txt +++ b/Foundation/samples/inflate/CMakeLists.txt @@ -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 ) diff --git a/Foundation/samples/md5/CMakeLists.txt b/Foundation/samples/md5/CMakeLists.txt index 93c1ec30f..0063266d9 100644 --- a/Foundation/samples/md5/CMakeLists.txt +++ b/Foundation/samples/md5/CMakeLists.txt @@ -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 ) diff --git a/Foundation/samples/uuidgen/CMakeLists.txt b/Foundation/samples/uuidgen/CMakeLists.txt index 947259339..40cc91ec9 100644 --- a/Foundation/samples/uuidgen/CMakeLists.txt +++ b/Foundation/samples/uuidgen/CMakeLists.txt @@ -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 ) diff --git a/Foundation/testsuite/CMakeLists.txt b/Foundation/testsuite/CMakeLists.txt index be03f0592..c7c56ac25 100644 --- a/Foundation/testsuite/CMakeLists.txt +++ b/Foundation/testsuite/CMakeLists.txt @@ -1,4 +1,4 @@ -set(TESTUNIT "${LIBNAME}-testrunner") +set(TESTUNIT "Foundation-testrunner") # Sources file(GLOB SRCS_G "src/*.cpp") @@ -24,44 +24,43 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE src/WinCEDriver.cpp ) -add_executable( ${TESTUNIT} ${TEST_SRCS} ) +add_executable(Foundation-testrunner ${TEST_SRCS} ) if(ANDROID) - add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} "-DTEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/data;${CMAKE_BINARY_DIR}/bin/TestApp;${CMAKE_BINARY_DIR}/bin/TestLibrary.so" -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/${TESTUNIT} -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) + add_test(NAME Foundation WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} "-DTEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/data;${CMAKE_BINARY_DIR}/bin/TestApp;${CMAKE_BINARY_DIR}/bin/TestLibrary.so" -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/Foundation-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) else() - add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${TESTUNIT} -all) - set_tests_properties(${LIBNAME} PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=.") # The SharedLibaryTest has to look for shared libraries in the working directory + add_test(NAME Foundation WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND Foundation-testrunner -all) + set_tests_properties(Foundation PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=.") # The SharedLibaryTest has to look for shared libraries in the working directory # The test is run in the runtime directory. So the test data is copied there too - add_custom_command(TARGET ${TESTUNIT} POST_BUILD + add_custom_command(TARGET Foundation-testrunner POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/data ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/data ) endif() -target_link_libraries( ${TESTUNIT} PocoFoundation CppUnit ) +target_link_libraries(Foundation-testrunner PUBLIC Poco::Foundation CppUnit ) if(UNIX AND NOT ANDROID) - target_link_libraries( ${TESTUNIT} pthread) + target_link_libraries(Foundation-testrunner PUBLIC pthread) endif(UNIX AND NOT ANDROID) if(ENABLE_LONG_RUNNING_TESTS) - target_compile_definitions( ${TESTUNIT} PRIVATE ENABLE_LONG_RUNNING_TESTS) + target_compile_definitions(Foundation-testrunner PRIVATE ENABLE_LONG_RUNNING_TESTS) endif(ENABLE_LONG_RUNNING_TESTS) # TestApp if(WINCE) add_executable( TestApp src/TestApp_WINCE.cpp ) -set_target_properties(TestApp PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup") + set_target_properties(TestApp PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup") else() -add_executable( TestApp src/TestApp.cpp ) + add_executable( TestApp src/TestApp.cpp ) endif() # The test is run in the runtime directory. So the TestApp is built there too because it is used by the tests set_target_properties( TestApp PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ) -target_link_libraries( TestApp PocoFoundation ) +target_link_libraries( TestApp PUBLIC Poco::Foundation ) -if(NOT POCO_STATIC) # TestLibrary -add_library( TestLibrary SHARED src/TestLibrary.cpp src/TestPlugin.cpp src/TestPlugin.h ) -set_target_properties( TestLibrary PROPERTIES PREFIX "" DEBUG_POSTFIX "") # The test requires the library named TestLibrary. By default it is prefixed with lib. +add_library(TestLibrary SHARED src/TestLibrary.cpp src/TestPlugin.cpp src/TestPlugin.h ) +set_target_properties(TestLibrary PROPERTIES PREFIX "" DEBUG_POSTFIX "") # The test requires the library named TestLibrary. By default it is prefixed with lib. # The test is run in the runtime directory. So the TestLibrary is built there too because it is used by the tests -set_target_properties( TestLibrary PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ) -target_link_libraries( TestLibrary PocoFoundation ) -endif() +set_target_properties(TestLibrary PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ) +target_link_libraries(TestLibrary PUBLIC Poco::Foundation ) +add_dependencies(Foundation-testrunner TestApp TestLibrary) diff --git a/JSON/CMakeLists.txt b/JSON/CMakeLists.txt index b4684fed2..c5a9476ba 100644 --- a/JSON/CMakeLists.txt +++ b/JSON/CMakeLists.txt @@ -1,11 +1,4 @@ -set(LIBNAME "JSON") -set(POCO_LIBNAME "Poco${LIBNAME}") - # Sources -if (WIN32) - add_definitions(-D_CRT_SECURE_NO_WARNINGS) -endif (WIN32) - file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( SRCS ${SRCS_G}) @@ -13,30 +6,34 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G}) file(GLOB_RECURSE HDRS_G "include/*.h" ) POCO_HEADERS_AUTO( SRCS ${HDRS_G}) POCO_SOURCES(SRCS pdjson src/pdjson.c) -if(WIN32) - SET_SOURCE_FILES_PROPERTIES(src/pdjson.c PROPERTIES LANGUAGE CXX) -endif() -add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} ) -add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}") -set_target_properties( "${LIBNAME}" +add_library(JSON ${SRCS} ) +add_library(Poco::JSON ALIAS JSON) +set_target_properties(JSON PROPERTIES VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} - OUTPUT_NAME ${POCO_LIBNAME} + OUTPUT_NAME PocoJSON DEFINE_SYMBOL JSON_EXPORTS ) -target_link_libraries( "${LIBNAME}" Foundation) -target_include_directories( "${LIBNAME}" +target_link_libraries(JSON PUBLIC Poco::Foundation) +target_include_directories(JSON PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ) -target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS}) -POCO_INSTALL("${LIBNAME}") -POCO_GENERATE_PACKAGE("${LIBNAME}") +if(WIN32) + target_compile_definitions(JSON PRIVATE _CRT_SECURE_NO_WARNINGS) + set_source_files_properties(src/pdjson.c PROPERTIES LANGUAGE CXX) + set_property(TARGET JSON PROPERTY C_STANDARD 99) +else() + target_compile_features(JSON PUBLIC c_variadic_macros) +endif() + +POCO_INSTALL(JSON) +POCO_GENERATE_PACKAGE(JSON) if (ENABLE_TESTS) add_subdirectory(samples) diff --git a/JSON/samples/Benchmark/CMakeLists.txt b/JSON/samples/Benchmark/CMakeLists.txt index 4318ed395..f3197136c 100644 --- a/JSON/samples/Benchmark/CMakeLists.txt +++ b/JSON/samples/Benchmark/CMakeLists.txt @@ -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) diff --git a/JSON/testsuite/CMakeLists.txt b/JSON/testsuite/CMakeLists.txt index 2fb84a684..2b7b1b638 100644 --- a/JSON/testsuite/CMakeLists.txt +++ b/JSON/testsuite/CMakeLists.txt @@ -1,5 +1,3 @@ -set(TESTUNIT "${LIBNAME}-testrunner") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G}) @@ -16,15 +14,15 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE src/WinCEDriver.cpp ) -add_executable( ${TESTUNIT} ${TEST_SRCS} ) +add_executable(JSON-testrunner ${TEST_SRCS} ) if(ANDROID) - add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} "-DTEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/data;" -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/${TESTUNIT} -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) + add_test(NAME JSON WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} "-DTEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/data;" -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/JSON-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) else() - add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all) + add_test(NAME JSON WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND JSON-testrunner -all) # The test is run in the build directory. So the test data is copied there too - add_custom_command(TARGET ${TESTUNIT} POST_BUILD + add_custom_command(TARGET JSON-testrunner POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data ) endif() -target_link_libraries( ${TESTUNIT} PocoJSON PocoFoundation CppUnit ) +target_link_libraries(JSON-testrunner PUBLIC Poco::JSON CppUnit) diff --git a/MongoDB/CMakeLists.txt b/MongoDB/CMakeLists.txt index e9f443026..83c9935b7 100644 --- a/MongoDB/CMakeLists.txt +++ b/MongoDB/CMakeLists.txt @@ -1,6 +1,3 @@ -set(LIBNAME "MongoDB") -set(POCO_LIBNAME "Poco${LIBNAME}") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( SRCS ${SRCS_G}) @@ -9,26 +6,25 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G}) file(GLOB_RECURSE HDRS_G "include/*.h" ) POCO_HEADERS_AUTO( SRCS ${HDRS_G}) -add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} ) -add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}") -set_target_properties( "${LIBNAME}" +add_library(MongoDB ${SRCS} ) +add_library(Poco::MongoDB ALIAS MongoDB) +set_target_properties(MongoDB PROPERTIES VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} - OUTPUT_NAME ${POCO_LIBNAME} + OUTPUT_NAME PocoMongoDB DEFINE_SYMBOL MongoDB_EXPORTS ) -target_link_libraries( "${LIBNAME}" Net Foundation) -target_include_directories( "${LIBNAME}" +target_link_libraries(MongoDB PUBLIC Poco::Net) +target_include_directories(MongoDB PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ) -target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS}) -POCO_INSTALL("${LIBNAME}") -POCO_GENERATE_PACKAGE("${LIBNAME}") +POCO_INSTALL(MongoDB) +POCO_GENERATE_PACKAGE(MongoDB) if (ENABLE_TESTS) add_subdirectory(samples) diff --git a/MongoDB/samples/SQLToMongo/CMakeLists.txt b/MongoDB/samples/SQLToMongo/CMakeLists.txt index 023fbce23..20519e6c9 100644 --- a/MongoDB/samples/SQLToMongo/CMakeLists.txt +++ b/MongoDB/samples/SQLToMongo/CMakeLists.txt @@ -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) diff --git a/MongoDB/testsuite/CMakeLists.txt b/MongoDB/testsuite/CMakeLists.txt index 1964563f0..45f98477d 100644 --- a/MongoDB/testsuite/CMakeLists.txt +++ b/MongoDB/testsuite/CMakeLists.txt @@ -1,5 +1,3 @@ -set(TESTUNIT "${LIBNAME}-testrunner") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G}) @@ -16,13 +14,11 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE src/WinCEDriver.cpp ) -set(TESTUNIT "${LIBNAME}-testrunner") - -add_executable( ${TESTUNIT} ${TEST_SRCS} ) +add_executable(MongoDB-testrunner ${TEST_SRCS} ) if(ANDROID) - add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/${TESTUNIT} -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) + add_test(NAME MongoDB WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/MongoDB-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) else() - add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all) + add_test(NAME MongoDB WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND MongoDB-testrunner -all) endif() -target_link_libraries( ${TESTUNIT} PocoMongoDB PocoFoundation CppUnit ) +target_link_libraries(MongoDB-testrunner PUBLIC Poco::MongoDB CppUnit) diff --git a/Net/CMakeLists.txt b/Net/CMakeLists.txt index e6ef2636f..8198b1b2c 100644 --- a/Net/CMakeLists.txt +++ b/Net/CMakeLists.txt @@ -1,6 +1,3 @@ -set(LIBNAME "Net") -set(POCO_LIBNAME "Poco${LIBNAME}") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( SRCS ${SRCS_G}) @@ -9,35 +6,35 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G}) file(GLOB_RECURSE HDRS_G "include/*.h" ) POCO_HEADERS_AUTO( SRCS ${HDRS_G}) -# Windows and WindowsCE need additional libraries -if(WIN32) - if(WINCE) - set(SYSLIBS ${SYSLIBS} "ws2.lib" "iphlpapi.lib") - else() - set(SYSLIBS ${SYSLIBS} "ws2_32.lib" "iphlpapi.lib") - endif() -endif(WIN32) - -add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} ) -add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}") -set_target_properties( "${LIBNAME}" +add_library(Net ${SRCS} ) +add_library(Poco::Net ALIAS Net) +set_target_properties( Net PROPERTIES VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} - OUTPUT_NAME ${POCO_LIBNAME} + OUTPUT_NAME PocoNet DEFINE_SYMBOL Net_EXPORTS ) -target_link_libraries( "${LIBNAME}" Foundation ${SYSLIBS}) -target_include_directories( "${LIBNAME}" +target_link_libraries(Net PUBLIC Poco::Foundation) +# Windows and WindowsCE need additional libraries +if(WIN32) + target_link_libraries(Net PUBLIC "iphlpapi.lib") + if(WINCE) + target_link_libraries(Net PUBLIC "ws2.lib") + else() + target_link_libraries(Net PUBLIC "ws2_32.lib") + endif() +endif(WIN32) + +target_include_directories(Net PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ) -target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS}) -POCO_INSTALL("${LIBNAME}") -POCO_GENERATE_PACKAGE("${LIBNAME}") +POCO_INSTALL(Net) +POCO_GENERATE_PACKAGE(Net) if (ENABLE_TESTS) add_subdirectory(samples) diff --git a/Net/samples/EchoServer/CMakeLists.txt b/Net/samples/EchoServer/CMakeLists.txt index a4fa6a52a..28874fe9c 100644 --- a/Net/samples/EchoServer/CMakeLists.txt +++ b/Net/samples/EchoServer/CMakeLists.txt @@ -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) diff --git a/Net/samples/HTTPFormServer/CMakeLists.txt b/Net/samples/HTTPFormServer/CMakeLists.txt index 766095367..201fc513c 100644 --- a/Net/samples/HTTPFormServer/CMakeLists.txt +++ b/Net/samples/HTTPFormServer/CMakeLists.txt @@ -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) diff --git a/Net/samples/HTTPLoadTest/CMakeLists.txt b/Net/samples/HTTPLoadTest/CMakeLists.txt index 2a5d5ff7d..1cb5a2312 100644 --- a/Net/samples/HTTPLoadTest/CMakeLists.txt +++ b/Net/samples/HTTPLoadTest/CMakeLists.txt @@ -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) diff --git a/Net/samples/HTTPTimeServer/CMakeLists.txt b/Net/samples/HTTPTimeServer/CMakeLists.txt index 135c65293..7aea8e180 100644 --- a/Net/samples/HTTPTimeServer/CMakeLists.txt +++ b/Net/samples/HTTPTimeServer/CMakeLists.txt @@ -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) diff --git a/Net/samples/Mail/CMakeLists.txt b/Net/samples/Mail/CMakeLists.txt index 1546ea0d4..03438e362 100644 --- a/Net/samples/Mail/CMakeLists.txt +++ b/Net/samples/Mail/CMakeLists.txt @@ -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) diff --git a/Net/samples/Ping/CMakeLists.txt b/Net/samples/Ping/CMakeLists.txt index 63c769148..c5d0e5035 100644 --- a/Net/samples/Ping/CMakeLists.txt +++ b/Net/samples/Ping/CMakeLists.txt @@ -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) diff --git a/Net/samples/SMTPLogger/CMakeLists.txt b/Net/samples/SMTPLogger/CMakeLists.txt index eb84ca756..1ce0bae61 100644 --- a/Net/samples/SMTPLogger/CMakeLists.txt +++ b/Net/samples/SMTPLogger/CMakeLists.txt @@ -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) diff --git a/Net/samples/TimeServer/CMakeLists.txt b/Net/samples/TimeServer/CMakeLists.txt index ab9b46e14..68bc83349 100644 --- a/Net/samples/TimeServer/CMakeLists.txt +++ b/Net/samples/TimeServer/CMakeLists.txt @@ -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) diff --git a/Net/samples/WebSocketServer/CMakeLists.txt b/Net/samples/WebSocketServer/CMakeLists.txt index ceba96d63..0b3abfa13 100644 --- a/Net/samples/WebSocketServer/CMakeLists.txt +++ b/Net/samples/WebSocketServer/CMakeLists.txt @@ -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) diff --git a/Net/samples/dict/CMakeLists.txt b/Net/samples/dict/CMakeLists.txt index cb28ba7e4..ece1ff73b 100644 --- a/Net/samples/dict/CMakeLists.txt +++ b/Net/samples/dict/CMakeLists.txt @@ -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) diff --git a/Net/samples/download/CMakeLists.txt b/Net/samples/download/CMakeLists.txt index 9b378a37a..be916fcde 100644 --- a/Net/samples/download/CMakeLists.txt +++ b/Net/samples/download/CMakeLists.txt @@ -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) diff --git a/Net/samples/httpget/CMakeLists.txt b/Net/samples/httpget/CMakeLists.txt index 7833114fe..6eb7f21e2 100644 --- a/Net/samples/httpget/CMakeLists.txt +++ b/Net/samples/httpget/CMakeLists.txt @@ -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) diff --git a/Net/samples/ifconfig/CMakeLists.txt b/Net/samples/ifconfig/CMakeLists.txt index 4878d92dc..96ec823cd 100644 --- a/Net/samples/ifconfig/CMakeLists.txt +++ b/Net/samples/ifconfig/CMakeLists.txt @@ -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) diff --git a/Net/testsuite/CMakeLists.txt b/Net/testsuite/CMakeLists.txt index 7c8b966fb..af3423d59 100644 --- a/Net/testsuite/CMakeLists.txt +++ b/Net/testsuite/CMakeLists.txt @@ -1,5 +1,3 @@ -set(TESTUNIT "${LIBNAME}-testrunner") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G}) @@ -16,11 +14,11 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE src/WinCEDriver.cpp ) -add_executable( ${TESTUNIT} ${TEST_SRCS} ) +add_executable(Net-testrunner ${TEST_SRCS} ) if(ANDROID) - add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/${TESTUNIT} -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) + add_test(NAME Net WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/Net-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) else() - add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all) + add_test(NAME Net WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND Net-testrunner -all) endif() -target_link_libraries( ${TESTUNIT} PocoNet PocoUtil PocoXML PocoFoundation CppUnit) +target_link_libraries(Net-testrunner PUBLIC Poco::Net Poco::Util Poco::XML CppUnit) diff --git a/NetSSL_OpenSSL/CMakeLists.txt b/NetSSL_OpenSSL/CMakeLists.txt index b6e376a21..56f4fe595 100644 --- a/NetSSL_OpenSSL/CMakeLists.txt +++ b/NetSSL_OpenSSL/CMakeLists.txt @@ -1,6 +1,3 @@ -set(LIBNAME "NetSSL") -set(POCO_LIBNAME "Poco${LIBNAME}") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( SRCS ${SRCS_G}) @@ -9,26 +6,25 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G}) file(GLOB_RECURSE HDRS_G "include/*.h" ) POCO_HEADERS_AUTO( SRCS ${HDRS_G}) -add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} ) -add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}") -set_target_properties( "${LIBNAME}" +add_library(NetSSL ${SRCS} ) +add_library(Poco::NetSSL ALIAS NetSSL) +set_target_properties( NetSSL PROPERTIES VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} - OUTPUT_NAME ${POCO_LIBNAME} + OUTPUT_NAME PocoNetSSL DEFINE_SYMBOL NetSSL_EXPORTS ) -target_link_libraries( "${LIBNAME}" Crypto Net Util Foundation ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} ) -target_include_directories( "${LIBNAME}" +target_link_libraries(NetSSL PUBLIC Poco::Crypto Poco::Net Poco::Util) +target_include_directories(NetSSL PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ) -target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS}) -POCO_INSTALL("${LIBNAME}") -POCO_GENERATE_PACKAGE("${LIBNAME}") +POCO_INSTALL(NetSSL) +POCO_GENERATE_PACKAGE(NetSSL) if (ENABLE_TESTS) add_subdirectory(samples) diff --git a/NetSSL_OpenSSL/samples/HTTPSTimeServer/CMakeLists.txt b/NetSSL_OpenSSL/samples/HTTPSTimeServer/CMakeLists.txt index 0791da88d..c90df616f 100644 --- a/NetSSL_OpenSSL/samples/HTTPSTimeServer/CMakeLists.txt +++ b/NetSSL_OpenSSL/samples/HTTPSTimeServer/CMakeLists.txt @@ -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) diff --git a/NetSSL_OpenSSL/samples/Mail/CMakeLists.txt b/NetSSL_OpenSSL/samples/Mail/CMakeLists.txt index 6cf2176ce..1543875be 100644 --- a/NetSSL_OpenSSL/samples/Mail/CMakeLists.txt +++ b/NetSSL_OpenSSL/samples/Mail/CMakeLists.txt @@ -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) diff --git a/NetSSL_OpenSSL/samples/TwitterClient/CMakeLists.txt b/NetSSL_OpenSSL/samples/TwitterClient/CMakeLists.txt index 66907c034..7cfc66f8b 100644 --- a/NetSSL_OpenSSL/samples/TwitterClient/CMakeLists.txt +++ b/NetSSL_OpenSSL/samples/TwitterClient/CMakeLists.txt @@ -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) diff --git a/NetSSL_OpenSSL/samples/download/CMakeLists.txt b/NetSSL_OpenSSL/samples/download/CMakeLists.txt index 47ad799ef..a5ce9c081 100644 --- a/NetSSL_OpenSSL/samples/download/CMakeLists.txt +++ b/NetSSL_OpenSSL/samples/download/CMakeLists.txt @@ -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) diff --git a/NetSSL_OpenSSL/testsuite/CMakeLists.txt b/NetSSL_OpenSSL/testsuite/CMakeLists.txt index 7e98089bd..4adf281ab 100644 --- a/NetSSL_OpenSSL/testsuite/CMakeLists.txt +++ b/NetSSL_OpenSSL/testsuite/CMakeLists.txt @@ -1,5 +1,3 @@ -set(TESTUNIT "${LIBNAME}-testrunner") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G}) @@ -16,18 +14,18 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE src/WinCEDriver.cpp ) -add_executable( ${TESTUNIT} ${TEST_SRCS} ) +add_executable(NetSSL-testrunner ${TEST_SRCS} ) if(ANDROID) - add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} "-DTEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/any.pem;${CMAKE_CURRENT_SOURCE_DIR}/rootcert.pem;${CMAKE_CURRENT_SOURCE_DIR}/testrunner.xml" -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/${TESTUNIT} -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) + add_test(NAME NetSSL WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} "-DTEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/any.pem;${CMAKE_CURRENT_SOURCE_DIR}/rootcert.pem;${CMAKE_CURRENT_SOURCE_DIR}/testrunner.xml" -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/NetSSL-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) else() - add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${TESTUNIT} -all) + add_test(NAME NetSSL WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND NetSSL-testrunner -all) # The test is run in the build directory. So the test data is copied there too - add_custom_command(TARGET ${TESTUNIT} POST_BUILD + add_custom_command(TARGET NetSSL-testrunner POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/any.pem ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/rootcert.pem ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/testrunner.xml ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTUNIT}.xml + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/testrunner.xml ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/NetSSL-testrunner.xml ) endif() -target_link_libraries( ${TESTUNIT} PocoNetSSL PocoCrypto PocoNet PocoUtil PocoXML PocoFoundation CppUnit) +target_link_libraries(NetSSL-testrunner PUBLIC Poco::NetSSL Poco::Util Poco::XML CppUnit) diff --git a/NetSSL_Win/CMakeLists.txt b/NetSSL_Win/CMakeLists.txt index 6a9b13297..ef7609a8f 100644 --- a/NetSSL_Win/CMakeLists.txt +++ b/NetSSL_Win/CMakeLists.txt @@ -1,6 +1,3 @@ -set(LIBNAME "NetSSLWin") -set(POCO_LIBNAME "Poco${LIBNAME}") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( SRCS ${SRCS_G}) @@ -9,26 +6,25 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G}) file(GLOB_RECURSE HDRS_G "include/*.h" ) POCO_HEADERS_AUTO( SRCS ${HDRS_G}) -add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} ) -add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}") -set_target_properties( "${LIBNAME}" +add_library(NetSSLWin ${SRCS}) +add_library(Poco::NetSSLWin ALIAS NetSSLWin) +set_target_properties(NetSSLWin PROPERTIES VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} - OUTPUT_NAME ${POCO_LIBNAME} + OUTPUT_NAME PocoNetSSLWin DEFINE_SYMBOL NetSSL_Win_EXPORTS ) -target_link_libraries( "${LIBNAME}" Net Util Foundation Crypt32.lib ) -target_include_directories( "${LIBNAME}" +target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util Crypt32.lib) +target_include_directories(NetSSLWin PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ) -target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS}) -POCO_INSTALL("${LIBNAME}") -POCO_GENERATE_PACKAGE("${LIBNAME}") +POCO_INSTALL(NetSSLWin) +POCO_GENERATE_PACKAGE(NetSSLWin) if (ENABLE_TESTS) #TODO: Looks like the samples use crypto somehow? diff --git a/NetSSL_Win/samples/HTTPSTimeServer/CMakeLists.txt b/NetSSL_Win/samples/HTTPSTimeServer/CMakeLists.txt index ae5014ddb..90c115d15 100644 --- a/NetSSL_Win/samples/HTTPSTimeServer/CMakeLists.txt +++ b/NetSSL_Win/samples/HTTPSTimeServer/CMakeLists.txt @@ -1,7 +1,2 @@ -set(SAMPLE_NAME "HTTPSTimeServer-win") - -set(LOCAL_SRCS "") -aux_source_directory(src LOCAL_SRCS) - -add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) -target_link_libraries( ${SAMPLE_NAME} PocoNetSSLWin PocoCrypto PocoUtil PocoNet PocoXML PocoFoundation ) +add_executable(HTTPSTimeServer-win src/HTTPSTimeServer.cpp) +target_link_libraries(HTTPSTimeServer-win PUBLIC Poco::NetSSLWin Poco::Crypto Poco::XML) diff --git a/NetSSL_Win/samples/Mail/CMakeLists.txt b/NetSSL_Win/samples/Mail/CMakeLists.txt index c6fa18840..8b3932c39 100644 --- a/NetSSL_Win/samples/Mail/CMakeLists.txt +++ b/NetSSL_Win/samples/Mail/CMakeLists.txt @@ -1,7 +1,2 @@ -set(SAMPLE_NAME "Mail-ssl-win") - -set(LOCAL_SRCS "") -aux_source_directory(src LOCAL_SRCS) - -add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) -target_link_libraries( ${SAMPLE_NAME} PocoNetSSLWin PocoCrypto PocoUtil PocoNet PocoXML PocoFoundation ) +add_executable(Mail-ssl-win src/Mail.cpp) +target_link_libraries(Mail-ssl-win PUBLIC Poco::NetSSLWin Poco::Crypto Poco::XML) diff --git a/NetSSL_Win/samples/download/CMakeLists.txt b/NetSSL_Win/samples/download/CMakeLists.txt index b7a546005..05ae886d9 100644 --- a/NetSSL_Win/samples/download/CMakeLists.txt +++ b/NetSSL_Win/samples/download/CMakeLists.txt @@ -1,7 +1,7 @@ -set(SAMPLE_NAME "download-ssl-win") +set(SAMPLE_NAME "") set(LOCAL_SRCS "") aux_source_directory(src LOCAL_SRCS) -add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) -target_link_libraries( ${SAMPLE_NAME} PocoNetSSLWin PocoCrypto PocoUtil PocoNet PocoXML PocoFoundation ) +add_executable(download-ssl-win src/download.cpp) +target_link_libraries(download-ssl-win PUBLIC Poco::NetSSLWin Poco::Crypto Poco::XML) diff --git a/NetSSL_Win/testsuite/CMakeLists.txt b/NetSSL_Win/testsuite/CMakeLists.txt index 5819a70d9..e707ac373 100644 --- a/NetSSL_Win/testsuite/CMakeLists.txt +++ b/NetSSL_Win/testsuite/CMakeLists.txt @@ -1,5 +1,3 @@ -set(TESTUNIT "${LIBNAME}-testrunner") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G}) @@ -16,13 +14,13 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE src/WinCEDriver.cpp ) -add_executable( ${TESTUNIT} ${TEST_SRCS} ) -add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${TESTUNIT} -all) -target_link_libraries( ${TESTUNIT} PocoNetSSL PocoCrypto PocoNet PocoUtil PocoXML PocoFoundation CppUnit) +add_executable(NetSSLWin-testrunner ${TEST_SRCS} ) +add_test(NAME NetSSLWin WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND NetSSLWin-testrunner -all) +target_link_libraries(NetSSLWin-testrunner PUBLIC Poco::NetSSL Poco::Util Poco::XML CppUnit) # The test is run in the build directory. So the test data is copied there too -add_custom_command(TARGET ${TESTUNIT} POST_BUILD +add_custom_command(TARGET NetSSLWin-testrunner POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/any.pem ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/rootcert.pem ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/testrunner.xml ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTUNIT}.xml + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/testrunner.xml ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/NetSSLWin.xml ) diff --git a/PDF/CMakeLists.txt b/PDF/CMakeLists.txt index daac18184..904ea824f 100644 --- a/PDF/CMakeLists.txt +++ b/PDF/CMakeLists.txt @@ -1,6 +1,3 @@ -set(LIBNAME "PDF") -set(POCO_LIBNAME "Poco${LIBNAME}") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( SRCS ${SRCS_G}) @@ -13,8 +10,6 @@ POCO_HEADERS_AUTO( SRCS ${HDRS_G}) # The configuration will fail if the packages are not found if (POCO_UNBUNDLED) find_package(ZLIB REQUIRED) - set(SYSLIBS ${SYSLIBS} ${ZLIB_LIBRARIES}) - include_directories(${ZLIB_INCLUDE_DIRS}) else() # zlib POCO_SOURCES( SRCS zlib @@ -121,26 +116,30 @@ POCO_SOURCES( SRCS libpng #TODO: Can we put this with the below includes? PRIVAT eg. include_directories( "include/Poco/PDF" ) # zip src -add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} ) -add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}") -set_target_properties( "${LIBNAME}" +add_library(PDF ${SRCS} ) +add_library(Poco::PDF ALIAS PDF) +set_target_properties(PDF PROPERTIES VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} - OUTPUT_NAME ${POCO_LIBNAME} + OUTPUT_NAME PocoPDF DEFINE_SYMBOL PDF_EXPORTS ) -target_link_libraries( "${LIBNAME}" ${SYSLIBS} XML Util Foundation ) -target_include_directories( "${LIBNAME}" +target_link_libraries(PDF PUBLIC ${ZLIB_LIBRARIES} Poco::XML Poco::Util) +target_include_directories(PDF PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ) -target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS}) -POCO_INSTALL("${LIBNAME}") -POCO_GENERATE_PACKAGE("${LIBNAME}") +if (POCO_UNBUNDLED) + target_include_directories(PDF PUBLIC "${ZLIB_INCLUDE_DIRS}") + target_compile_definitions(PDF PUBLIC POCO_UNBUNDLED) +endif() + +POCO_INSTALL(PDF) +POCO_GENERATE_PACKAGE(PDF) if (ENABLE_TESTS) add_subdirectory(samples) diff --git a/PDF/samples/Image/CMakeLists.txt b/PDF/samples/Image/CMakeLists.txt index 755909710..2c5dda23a 100644 --- a/PDF/samples/Image/CMakeLists.txt +++ b/PDF/samples/Image/CMakeLists.txt @@ -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) diff --git a/PDF/samples/Template/CMakeLists.txt b/PDF/samples/Template/CMakeLists.txt index f35c82369..e72b98300 100644 --- a/PDF/samples/Template/CMakeLists.txt +++ b/PDF/samples/Template/CMakeLists.txt @@ -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) diff --git a/PDF/samples/Text/CMakeLists.txt b/PDF/samples/Text/CMakeLists.txt index 2522a2fb7..ab4df83dc 100644 --- a/PDF/samples/Text/CMakeLists.txt +++ b/PDF/samples/Text/CMakeLists.txt @@ -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) diff --git a/PDF/testsuite/CMakeLists.txt b/PDF/testsuite/CMakeLists.txt index e25f9a8f3..46829d4fa 100644 --- a/PDF/testsuite/CMakeLists.txt +++ b/PDF/testsuite/CMakeLists.txt @@ -1,5 +1,3 @@ -set(TESTUNIT "${LIBNAME}-testrunner") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G}) @@ -12,11 +10,11 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF src/WinDriver.cpp ) -add_executable( ${TESTUNIT} ${TEST_SRCS} ) +add_executable(PDF-testrunner ${TEST_SRCS} ) if(ANDROID) - add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/${TESTUNIT} -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) + add_test(NAME PDF WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/PDF-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) else() - add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all) + add_test(NAME PDF WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND PDF-testrunner -all) endif() -target_link_libraries( ${TESTUNIT} PocoPDF PocoFoundation CppUnit ) +target_link_libraries(PDF-testrunner PUBLIC Poco::PDF CppUnit ) diff --git a/PageCompiler/CMakeLists.txt b/PageCompiler/CMakeLists.txt index 3a55c5575..c0b093150 100644 --- a/PageCompiler/CMakeLists.txt +++ b/PageCompiler/CMakeLists.txt @@ -4,16 +4,16 @@ set(POCO_EXENAME "PageCompiler") file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( SRCS ${SRCS_G}) -add_executable( "${POCO_EXENAME}" ${SRCS} ) -set_target_properties( "${POCO_EXENAME}" +add_executable(PageCompiler ${SRCS} ) +set_target_properties(PageCompiler PROPERTIES OUTPUT_NAME cpspc ) -target_link_libraries( "${POCO_EXENAME}" Net Util XML JSON Foundation) +target_link_libraries(PageCompiler PUBLIC Poco::Net Poco::Util) install( - TARGETS "${POCO_EXENAME}" EXPORT "${POCO_EXENAME}Targets" + TARGETS PageCompiler EXPORT PageCompilerTargets LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX} RUNTIME DESTINATION bin diff --git a/PageCompiler/File2Page/CMakeLists.txt b/PageCompiler/File2Page/CMakeLists.txt index cb6d9694b..76b5dde97 100644 --- a/PageCompiler/File2Page/CMakeLists.txt +++ b/PageCompiler/File2Page/CMakeLists.txt @@ -1,19 +1,17 @@ -set(POCO_EXENAME "File2Page") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( SRCS ${SRCS_G}) -add_executable( "${POCO_EXENAME}" ${SRCS} ) -set_target_properties( "${POCO_EXENAME}" +add_executable(File2Page ${SRCS} ) +set_target_properties(File2Page PROPERTIES OUTPUT_NAME f2cpsp ) -target_link_libraries( "${POCO_EXENAME}" Net Util XML JSON Foundation) +target_link_libraries(File2Page PUBLIC Poco::Util) install( - TARGETS "${POCO_EXENAME}" EXPORT "${POCO_EXENAME}Targets" + TARGETS File2Page EXPORT File2PageTargets LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX} RUNTIME DESTINATION bin diff --git a/PocoDoc/CMakeLists.txt b/PocoDoc/CMakeLists.txt index 824168c08..56ea9ee19 100644 --- a/PocoDoc/CMakeLists.txt +++ b/PocoDoc/CMakeLists.txt @@ -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 diff --git a/Redis/CMakeLists.txt b/Redis/CMakeLists.txt index bd048482b..3e7bc16ed 100644 --- a/Redis/CMakeLists.txt +++ b/Redis/CMakeLists.txt @@ -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,31 +6,28 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G}) file(GLOB_RECURSE HDRS_G "include/*.h" ) POCO_HEADERS_AUTO( SRCS ${HDRS_G}) -add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} ) -add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}") -set_target_properties( "${LIBNAME}" +add_library(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 $ $ 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 (ENABLE_TESTS) add_subdirectory(testsuite) -endif () -if (ENABLE_SAMPLES) # add_subdirectory(samples) endif () diff --git a/Redis/testsuite/CMakeLists.txt b/Redis/testsuite/CMakeLists.txt index b4ca0bad5..4c3411730 100644 --- a/Redis/testsuite/CMakeLists.txt +++ b/Redis/testsuite/CMakeLists.txt @@ -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,16 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE src/WinCEDriver.cpp ) -set(TESTUNIT "${LIBNAME}-testrunner") - -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 CppUnit ) +target_link_libraries(Redis-testrunner PUBLIC ${CMAKE_THREAD_LIBS_INIT} Poco::Redis CppUnit ) if(OLD_REDIS_VERSION) - target_compile_definitions( ${TESTUNIT} PRIVATE OLD_REDIS_VERSION) + target_compile_definitions(Redis-testrunner PRIVATE OLD_REDIS_VERSION) endif(OLD_REDIS_VERSION) diff --git a/SevenZip/CMakeLists.txt b/SevenZip/CMakeLists.txt index fd13ee3a9..792ebc6fc 100644 --- a/SevenZip/CMakeLists.txt +++ b/SevenZip/CMakeLists.txt @@ -1,6 +1,3 @@ -set(LIBNAME "SevenZip") -set(POCO_LIBNAME "Poco${LIBNAME}") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( SRCS ${SRCS_G}) @@ -50,26 +47,25 @@ POCO_SOURCES( SRCS 7z # src/XzIn.c ) -add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} ) -add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}") -set_target_properties( "${LIBNAME}" +add_library(SevenZip ${SRCS} ) +add_library(Poco::SevenZip ALIAS SevenZip) +set_target_properties(SevenZip PROPERTIES VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} - OUTPUT_NAME ${POCO_LIBNAME} + OUTPUT_NAME PocoSevenZip DEFINE_SYMBOL SevenZip_EXPORTS ) -target_link_libraries( "${LIBNAME}" Util XML Foundation) -target_include_directories( "${LIBNAME}" +target_link_libraries(SevenZip PUBLIC Poco::Util Poco::XML) +target_include_directories(SevenZip PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ) -target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS}) -POCO_INSTALL("${LIBNAME}") -POCO_GENERATE_PACKAGE("${LIBNAME}") +POCO_INSTALL(SevenZip) +POCO_GENERATE_PACKAGE(SevenZip) if (ENABLE_TESTS) add_subdirectory(samples) diff --git a/SevenZip/samples/un7zip/CMakeLists.txt b/SevenZip/samples/un7zip/CMakeLists.txt index bfae9b5c8..13d076024 100644 --- a/SevenZip/samples/un7zip/CMakeLists.txt +++ b/SevenZip/samples/un7zip/CMakeLists.txt @@ -1,7 +1,2 @@ -set(SAMPLE_NAME "un7zip") - -set(LOCAL_SRCS "") -aux_source_directory(src LOCAL_SRCS) - -add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) -target_link_libraries( ${SAMPLE_NAME} PocoSevenZip PocoUtil PocoXML PocoFoundation ) +add_executable(un7zip src/un7zip.cpp) +target_link_libraries(un7zip PUBLIC Poco::SevenZip Poco::Util Poco::XML) diff --git a/Util/CMakeLists.txt b/Util/CMakeLists.txt index a367f12ea..a412a6be5 100644 --- a/Util/CMakeLists.txt +++ b/Util/CMakeLists.txt @@ -1,6 +1,3 @@ -set(LIBNAME "Util") -set(POCO_LIBNAME "Poco${LIBNAME}") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( SRCS ${SRCS_G}) @@ -15,37 +12,36 @@ POCO_SOURCES_AUTO_PLAT( SRCS WIN32 src/WinService.cpp ) -add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} ) -add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}") -set_target_properties( "${LIBNAME}" +add_library(Util ${SRCS} ) +add_library(Poco::Util ALIAS Util) +set_target_properties(Util PROPERTIES VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} - OUTPUT_NAME ${POCO_LIBNAME} + OUTPUT_NAME PocoUtil DEFINE_SYMBOL Util_EXPORTS ) -target_link_libraries( "${LIBNAME}" Foundation) +target_link_libraries(Util PUBLIC Poco::Foundation) if (ENABLE_XML) - target_link_libraries( "${LIBNAME}" XML) + target_link_libraries(Util PUBLIC Poco::XML) else () - add_definitions( -DPOCO_UTIL_NO_XMLCONFIGURATION ) + target_compile_definitions(Util PUBLIC POCO_UTIL_NO_XMLCONFIGURATION ) endif() if (ENABLE_JSON) - target_link_libraries( "${LIBNAME}" JSON) + target_link_libraries(Util PUBLIC Poco::JSON) else () - add_definitions( -DPOCO_UTIL_NO_JSONCONFIGURATION ) + target_compile_definitions(Util PUBLIC POCO_UTIL_NO_JSONCONFIGURATION ) endif() -target_include_directories( "${LIBNAME}" +target_include_directories(Util PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src - ) -target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS}) +) -POCO_INSTALL("${LIBNAME}") -POCO_GENERATE_PACKAGE("${LIBNAME}") +POCO_INSTALL(Util) +POCO_GENERATE_PACKAGE(Util) if (ENABLE_TESTS) add_subdirectory(samples) diff --git a/Util/samples/SampleApp/CMakeLists.txt b/Util/samples/SampleApp/CMakeLists.txt index e11469f27..30f2c787d 100644 --- a/Util/samples/SampleApp/CMakeLists.txt +++ b/Util/samples/SampleApp/CMakeLists.txt @@ -1,10 +1,5 @@ -set(SAMPLE_NAME "SampleApp") - -set(LOCAL_SRCS "") -aux_source_directory(src LOCAL_SRCS) - -add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) +add_executable(SampleApp src/SampleApp.cpp) if(WINCE) -set_target_properties( ${SAMPLE_NAME} PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup") + set_target_properties(SampleApp PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup") endif() -target_link_libraries( ${SAMPLE_NAME} PocoUtil PocoJSON PocoXML PocoFoundation ) +target_link_libraries(SampleApp PUBLIC Poco::Util Poco::JSON Poco::XML) diff --git a/Util/samples/SampleServer/CMakeLists.txt b/Util/samples/SampleServer/CMakeLists.txt index ccef003a8..e2bcfe0a3 100644 --- a/Util/samples/SampleServer/CMakeLists.txt +++ b/Util/samples/SampleServer/CMakeLists.txt @@ -1,10 +1,5 @@ -set(SAMPLE_NAME "SampleServer") - -set(LOCAL_SRCS "") -aux_source_directory(src LOCAL_SRCS) - -add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) +add_executable(SampleServer src/SampleServer.cpp) if(WINCE) -set_target_properties( ${SAMPLE_NAME} PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup") + set_target_properties(SampleServer PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup") endif() -target_link_libraries( ${SAMPLE_NAME} PocoUtil PocoJSON PocoXML PocoFoundation ) +target_link_libraries(SampleServer PUBLIC Poco::Util Poco::JSON Poco::XML) diff --git a/Util/samples/Units/CMakeLists.txt b/Util/samples/Units/CMakeLists.txt index aa3bb053c..6305ed876 100644 --- a/Util/samples/Units/CMakeLists.txt +++ b/Util/samples/Units/CMakeLists.txt @@ -1,7 +1,2 @@ -set(SAMPLE_NAME "Units") - -set(LOCAL_SRCS "") -aux_source_directory(src LOCAL_SRCS) - -add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) -target_link_libraries( ${SAMPLE_NAME} PocoUtil PocoJSON PocoXML PocoFoundation ) +add_executable(Units src/Units.cpp) +target_link_libraries(Units PUBLIC Poco::Util Poco::JSON Poco::XML) diff --git a/Util/samples/pkill/CMakeLists.txt b/Util/samples/pkill/CMakeLists.txt index 2b2ed8de5..9c34d001b 100644 --- a/Util/samples/pkill/CMakeLists.txt +++ b/Util/samples/pkill/CMakeLists.txt @@ -1,10 +1,5 @@ -set(SAMPLE_NAME "pkill") - -set(LOCAL_SRCS "") -aux_source_directory(src LOCAL_SRCS) - -add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) +add_executable(pkill src/pkill.cpp) if(WINCE) -set_target_properties( ${SAMPLE_NAME} PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup") + set_target_properties(pkill PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup") endif() -target_link_libraries( ${SAMPLE_NAME} PocoUtil PocoJSON PocoXML PocoFoundation ) +target_link_libraries(pkill PUBLIC Poco::Util Poco::JSON Poco::XML) diff --git a/Util/testsuite/CMakeLists.txt b/Util/testsuite/CMakeLists.txt index cf3b40d07..e429e5701 100644 --- a/Util/testsuite/CMakeLists.txt +++ b/Util/testsuite/CMakeLists.txt @@ -1,5 +1,3 @@ -set(TESTUNIT "${LIBNAME}-testrunner") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G}) @@ -22,11 +20,11 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE src/WinCEDriver.cpp ) -add_executable( ${TESTUNIT} ${TEST_SRCS} ) +add_executable(Util-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 Util WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/Util-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 Util WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND Util-testrunner -all) endif() -target_link_libraries( ${TESTUNIT} PocoUtil PocoJSON PocoXML PocoFoundation CppUnit) +target_link_libraries(Util-testrunner PUBLIC Poco::Util Poco::JSON Poco::XML CppUnit) diff --git a/XML/CMakeLists.txt b/XML/CMakeLists.txt index cdff6ecef..4db9de276 100644 --- a/XML/CMakeLists.txt +++ b/XML/CMakeLists.txt @@ -1,6 +1,3 @@ -set(LIBNAME "XML") -set(POCO_LIBNAME "Poco${LIBNAME}") - # Expat CPP sources to be excluded from globbed SRCS_G # They are added back on the list if POCO_UNBUNDLED is not set set(EXPAT_CPP "${CMAKE_CURRENT_SOURCE_DIR}/src/xmlparse.cpp") @@ -18,8 +15,6 @@ POCO_HEADERS_AUTO( SRCS ${HDRS_G}) # The configuration will fail if the packages are not found if (POCO_UNBUNDLED) find_package(EXPAT REQUIRED) - set(SYSLIBS ${SYSLIBS} ${EXPAT_LIBRARIES}) - include_directories(${EXPAT_INCLUDE_DIRS}) else() POCO_SOURCES( SRCS expat src/xmlparse.cpp @@ -30,36 +25,42 @@ else() ) endif (POCO_UNBUNDLED) -if(WIN32) -#TODO: Is XML_STATIC only required with Windows? What does it do? -add_definitions(-DXML_STATIC -DXML_NS -DXML_DTD -DHAVE_EXPAT_CONFIG_H) -else() -add_definitions(-DXML_NS -DXML_DTD -DHAVE_EXPAT_CONFIG_H) -endif() +add_library(XML ${SRCS} ) -add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} ) -add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}") -set_target_properties( "${LIBNAME}" +add_library(Poco::XML ALIAS XML) +set_target_properties( XML PROPERTIES VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} - OUTPUT_NAME ${POCO_LIBNAME} + OUTPUT_NAME PocoXML DEFINE_SYMBOL XML_EXPORTS ) -target_link_libraries( "${LIBNAME}" ${SYSLIBS} Foundation) -target_include_directories( "${LIBNAME}" +target_link_libraries(XML PUBLIC ${EXPAT_LIBRARIES} Poco::Foundation) +target_include_directories(XML PUBLIC $ $ 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(XML PUBLIC "${EXPAT_INCLUDE_DIRS}") + target_compile_definitions(XML PUBLIC POCO_UNBUNDLED) +else() + if(WIN32) + #TODO: Is XML_STATIC only required with Windows? What does it do? + target_compile_definitions(XML PUBLIC XML_STATIC) + endif() + target_compile_definitions(XML + PUBLIC XML_DTD + PRIVATE XML_NS HAVE_EXPAT_CONFIG_H) +endif() + +POCO_INSTALL(XML) +POCO_GENERATE_PACKAGE(XML) if (ENABLE_TESTS) - add_subdirectory(samples) - add_subdirectory(testsuite) + add_subdirectory(samples) + add_subdirectory(testsuite) endif () diff --git a/XML/samples/DOMParser/CMakeLists.txt b/XML/samples/DOMParser/CMakeLists.txt index eb10f936a..dbda42b15 100644 --- a/XML/samples/DOMParser/CMakeLists.txt +++ b/XML/samples/DOMParser/CMakeLists.txt @@ -1,7 +1,2 @@ -set(SAMPLE_NAME "DOMParser") - -set(LOCAL_SRCS "") -aux_source_directory(src LOCAL_SRCS) - -add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) -target_link_libraries( ${SAMPLE_NAME} PocoXML PocoFoundation ) +add_executable(DOMParser src/DOMParser.cpp) +target_link_libraries(DOMParser PUBLIC Poco::XML) diff --git a/XML/samples/DOMWriter/CMakeLists.txt b/XML/samples/DOMWriter/CMakeLists.txt index 52185ded6..c396caf35 100644 --- a/XML/samples/DOMWriter/CMakeLists.txt +++ b/XML/samples/DOMWriter/CMakeLists.txt @@ -1,7 +1,2 @@ -set(SAMPLE_NAME "DOMWriter") - -set(LOCAL_SRCS "") -aux_source_directory(src LOCAL_SRCS) - -add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) -target_link_libraries( ${SAMPLE_NAME} PocoXML PocoFoundation ) +add_executable(DOMWriter src/DOMWriter.cpp) +target_link_libraries(DOMWriter PUBLIC Poco::XML) diff --git a/XML/samples/PrettyPrint/CMakeLists.txt b/XML/samples/PrettyPrint/CMakeLists.txt index 297917678..4c49c985e 100644 --- a/XML/samples/PrettyPrint/CMakeLists.txt +++ b/XML/samples/PrettyPrint/CMakeLists.txt @@ -1,7 +1,2 @@ -set(SAMPLE_NAME "PrettyPrint") - -set(LOCAL_SRCS "") -aux_source_directory(src LOCAL_SRCS) - -add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) -target_link_libraries( ${SAMPLE_NAME} PocoXML PocoFoundation ) +add_executable(PrettyPrint src/PrettyPrint.cpp) +target_link_libraries(PrettyPrint PUBLIC Poco::XML) diff --git a/XML/samples/SAXParser/CMakeLists.txt b/XML/samples/SAXParser/CMakeLists.txt index 99f1567c8..f3c0f0a7e 100644 --- a/XML/samples/SAXParser/CMakeLists.txt +++ b/XML/samples/SAXParser/CMakeLists.txt @@ -1,7 +1,2 @@ -set(SAMPLE_NAME "SAXParser") - -set(LOCAL_SRCS "") -aux_source_directory(src LOCAL_SRCS) - -add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) -target_link_libraries( ${SAMPLE_NAME} PocoXML PocoFoundation ) +add_executable(SAXParser src/SAXParser.cpp) +target_link_libraries(SAXParser PUBLIC Poco::XML) diff --git a/XML/testsuite/CMakeLists.txt b/XML/testsuite/CMakeLists.txt index 97da09935..f15d3b069 100644 --- a/XML/testsuite/CMakeLists.txt +++ b/XML/testsuite/CMakeLists.txt @@ -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(XML-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 XML WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/XML-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 XML WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND XML-testrunner -all) endif() -target_link_libraries( ${TESTUNIT} PocoXML PocoFoundation CppUnit) +target_link_libraries(XML-testrunner PUBLIC Poco::XML CppUnit) diff --git a/Zip/CMakeLists.txt b/Zip/CMakeLists.txt index 5054baad1..b2739fd0d 100644 --- a/Zip/CMakeLists.txt +++ b/Zip/CMakeLists.txt @@ -1,6 +1,3 @@ -set(LIBNAME "Zip") -set(POCO_LIBNAME "Poco${LIBNAME}") - # Sources file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( SRCS ${SRCS_G}) @@ -9,26 +6,25 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G}) file(GLOB_RECURSE HDRS_G "include/*.h" ) POCO_HEADERS_AUTO( SRCS ${HDRS_G}) -add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} ) -add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}") -set_target_properties( "${LIBNAME}" +add_library(Zip ${SRCS} ) +add_library(Poco::Zip ALIAS Zip) +set_target_properties( Zip PROPERTIES VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} - OUTPUT_NAME ${POCO_LIBNAME} + OUTPUT_NAME PocoZip DEFINE_SYMBOL Zip_EXPORTS ) -target_link_libraries( "${LIBNAME}" Util XML Foundation) -target_include_directories( "${LIBNAME}" +target_link_libraries(Zip PUBLIC Poco::Util Poco::XML) +target_include_directories(Zip PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ) -target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS}) -POCO_INSTALL("${LIBNAME}") -POCO_GENERATE_PACKAGE("${LIBNAME}") +POCO_INSTALL(Zip) +POCO_GENERATE_PACKAGE(Zip) if (ENABLE_TESTS) add_subdirectory(samples) diff --git a/Zip/samples/unzip/CMakeLists.txt b/Zip/samples/unzip/CMakeLists.txt index 10586a7ed..e46f06ccf 100644 --- a/Zip/samples/unzip/CMakeLists.txt +++ b/Zip/samples/unzip/CMakeLists.txt @@ -1,10 +1,5 @@ -set(SAMPLE_NAME "sample-unzip") - -set(LOCAL_SRCS "") -aux_source_directory(src LOCAL_SRCS) - -add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) +add_executable(sample-unzip src/unzip.cpp) if(WINCE) -set_target_properties( ${SAMPLE_NAME} PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup") + set_target_properties(sample-unzip PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup") endif() -target_link_libraries( ${SAMPLE_NAME} PocoZip PocoUtil PocoXML PocoFoundation ) +target_link_libraries(sample-unzip PUBLIC Poco::Zip Poco::Util Poco::XML) diff --git a/Zip/samples/zip/CMakeLists.txt b/Zip/samples/zip/CMakeLists.txt index 3196b46a1..74de0707d 100644 --- a/Zip/samples/zip/CMakeLists.txt +++ b/Zip/samples/zip/CMakeLists.txt @@ -3,8 +3,8 @@ set(SAMPLE_NAME "sample-zip") set(LOCAL_SRCS "") aux_source_directory(src LOCAL_SRCS) -add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) +add_executable(sample-zip src/zip.cpp) if(WINCE) -set_target_properties( ${SAMPLE_NAME} PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup") + set_target_properties(sample-zip PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup") endif() -target_link_libraries( ${SAMPLE_NAME} PocoZip PocoUtil PocoXML PocoFoundation ) +target_link_libraries(sample-zip PUBLIC Poco::Zip Poco::Util Poco::XML) diff --git a/Zip/testsuite/CMakeLists.txt b/Zip/testsuite/CMakeLists.txt index b11cc58c8..61eb3e4fc 100644 --- a/Zip/testsuite/CMakeLists.txt +++ b/Zip/testsuite/CMakeLists.txt @@ -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(Zip-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 Zip 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/Zip-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 Zip WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND Zip-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 Zip-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} PocoZip PocoNet PocoFoundation CppUnit ) +target_link_libraries(Zip-testrunner PUBLIC Poco::Zip Poco::Net CppUnit) diff --git a/appveyor.yml b/appveyor.yml index 95c78feb1..dd51ea205 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,7 +5,5 @@ install: build_script: - set PATH=C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\bin;%PATH% - - mkdir cmake-build - - cd cmake-build - - cmake .. - - cmake --build . + - cmake -H. -Bcmake-build -DENABLE_DATA_POSTGRESQL=OFF + - cmake --build cmake-build diff --git a/build_cmake.cmd b/build_cmake.cmd index b20532a98..553e66fac 100644 --- a/build_cmake.cmd +++ b/build_cmake.cmd @@ -2,18 +2,13 @@ # POCO_UNBUNDLED - for no built-in version of libs # CMAKE_INSTALL_PREFIX=path - for install path -mkdir cmake-build -cd cmake-build -cmake ../. -DCMAKE_BUILD_TYPE=Debug -G"NMake Makefiles JOM" %1 %2 %3 %4 %5 -jom /j3 -jom install +cmake -H. -Bcmake-build -DCMAKE_BUILD_TYPE=Debug -G"NMake Makefiles JOM" %1 %2 %3 %4 %5 +cmake --build cmake-build --target all -- /j3 +cmake --build cmake-build --target install -del CMakeCache.txt +rmdir cmake-build -cmake ../. -DCMAKE_BUILD_TYPE=Release -G"NMake Makefiles JOM" %1 %2 %3 %4 %5 -jom /j3 -jom install - - -cd .. +cmake -H. -Bcmake-build -DCMAKE_BUILD_TYPE=Release -G"NMake Makefiles JOM" %1 %2 %3 %4 %5 +cmake --build cmake-build --target all -- /j3 +cmake --build cmake-build --target install diff --git a/build_cmake.sh b/build_cmake.sh index 70e4766d2..61d1b2915 100755 --- a/build_cmake.sh +++ b/build_cmake.sh @@ -5,18 +5,13 @@ # CMAKE_INSTALL_PREFIX=path - for install path rm -rf cmake-build -mkdir cmake-build -cd cmake-build -cmake ../. -DCMAKE_BUILD_TYPE=Debug $1 $2 $3 $4 $5 -make -j3 -make install +cmake -H. -Bcmake-build -DCMAKE_BUILD_TYPE=Debug $1 $2 $3 $4 $5 +cmake --build cmake-build --target all -- -j3 +cmake --build cmake-build --target install -rm -rf CMakeCache.txt +rm -rf cmake-build -cmake ../. -DCMAKE_BUILD_TYPE=Release $1 $2 $3 $4 $5 -make -j3 -make install - - -cd .. +cmake -H. -Bcmake-build -DCMAKE_BUILD_TYPE=Release $1 $2 $3 $4 $5 +cmake --build cmake-build --target all -- -j3 +cmake --build cmake-build --target install diff --git a/cmake/DefinePlatformSpecifc.cmake b/cmake/DefinePlatformSpecifc.cmake index f66454ac9..f3dca313f 100644 --- a/cmake/DefinePlatformSpecifc.cmake +++ b/cmake/DefinePlatformSpecifc.cmake @@ -48,8 +48,6 @@ if(MSVC) else(MSVC) # Other compilers then MSVC don't have a static STATIC_POSTFIX at the moment set(STATIC_POSTFIX "" CACHE STRING "Set static library postfix" FORCE) - set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG") endif(MSVC) @@ -71,57 +69,3 @@ endif() # OS Detection include(CheckTypeSize) find_package(Cygwin) - -if(WIN32) - add_definitions( -DPOCO_OS_FAMILY_WINDOWS -DUNICODE -D_UNICODE -D__LCC__) #__LCC__ define used by MySQL.h -endif(WIN32) - -if (CYGWIN) - add_definitions(-DPOCO_NO_FPENVIRONMENT -DPOCO_NO_WSTRING) - add_definitions(-D_XOPEN_SOURCE=500 -D__BSD_VISIBLE) -else (CYGWIN) - if (UNIX AND NOT ANDROID ) - add_definitions( -DPOCO_OS_FAMILY_UNIX ) - # Standard 'must be' defines - if (APPLE) - add_definitions( -DPOCO_HAVE_IPv6 -DPOCO_NO_STAT64) - set(SYSLIBS ${CMAKE_DL_LIBS}) - else (APPLE) - add_definitions( -D_REENTRANT -D_THREAD_SAFE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 ) - if (QNX) - add_definitions( -DPOCO_HAVE_FD_POLL) - set(SYSLIBS m socket) - else (QNX) - add_definitions( -D_XOPEN_SOURCE=500 -DPOCO_HAVE_FD_EPOLL) - set(SYSLIBS pthread ${CMAKE_DL_LIBS} rt) - endif (QNX) - endif (APPLE) - endif(UNIX AND NOT ANDROID ) -endif (CYGWIN) - -if (CMAKE_SYSTEM MATCHES "SunOS") - add_definitions( -DPOCO_OS_FAMILY_UNIX ) - # Standard 'must be' defines - add_definitions( -D_XOPEN_SOURCE=500 -D_REENTRANT -D_THREAD_SAFE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 ) - set(SYSLIBS pthread socket xnet nsl resolv rt ${CMAKE_DL_LIBS}) -endif(CMAKE_SYSTEM MATCHES "SunOS") - -if (CMAKE_COMPILER_IS_MINGW) - add_definitions(-DWC_NO_BEST_FIT_CHARS=0x400 -DPOCO_WIN32_UTF8) - add_definitions(-D_WIN32 -DMINGW32 -DWINVER=0x500 -DODBCVER=0x0300 -DPOCO_THREAD_STACK_SIZE) -endif (CMAKE_COMPILER_IS_MINGW) - -# SunPro C++ -if (${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro") - add_definitions( -D_BSD_SOURCE -library=stlport4) -endif (${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro") - -# iOS -if (IOS) - add_definitions( -DPOCO_HAVE_IPv6 -DPOCO_NO_FPENVIRONMENT -DPOCO_NO_STAT64 -DPOCO_NO_SHAREDLIBS -DPOCO_NO_NET_IFTYPES ) -endif(IOS) - -#Android -if (ANDROID) - add_definitions( -DPOCO_NO_FPENVIRONMENT -DPOCO_NO_WSTRING -DPOCO_NO_SHAREDMEMORY ) -endif(ANDROID) diff --git a/cmake/FindMySQL.cmake b/cmake/FindMySQL.cmake index 3defe8d92..7499723b0 100644 --- a/cmake/FindMySQL.cmake +++ b/cmake/FindMySQL.cmake @@ -45,7 +45,7 @@ if (WIN32) ${BINDIR32}/MySQL/lib $ENV{SystemDrive}/MySQL/*/lib/${libsuffixDist}) else (WIN32) - find_library(MYSQL_LIB NAMES mysqlclient_r + find_library(MYSQL_LIB NAMES mysqlclient mysqlclient_r PATHS /usr/lib/mysql /usr/local/lib/mysql diff --git a/cmake/FindPostgreSQL.cmake b/cmake/FindPostgreSQL.cmake index 6c383f0e3..afa2650bc 100644 --- a/cmake/FindPostgreSQL.cmake +++ b/cmake/FindPostgreSQL.cmake @@ -1,66 +1,196 @@ -# - Find libpq -# Find the native PostgreSQL includes and library +# TODO(Bjoe) This is taken from cmake 3.10. For poco we need some changes here. Maybe we create an issue on cmake project +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +#.rst: +# FindPostgreSQL +# -------------- # -# PGSQL_INCLUDE_DIR - where to find libpq-fe.h, etc. -# PGSQL_LIBRARIES - List of libraries when using PGSQL. -# PGSQL_FOUND - True if PGSQL found. +# Find the PostgreSQL installation. +# +# This module defines +# +# :: +# +# PostgreSQL_LIBRARIES - the PostgreSQL libraries needed for linking +# PostgreSQL_INCLUDE_DIRS - the directories of the PostgreSQL headers +# PostgreSQL_LIBRARY_DIRS - the link directories for PostgreSQL libraries +# PostgreSQL_VERSION_STRING - the version of PostgreSQL found (since CMake 2.8.8) -MACRO(FIND_PGSQL) -IF (PGSQL_INCLUDE_DIR) - # Already in cache, be silent - SET(PostgreSQL_FIND_QUIETLY TRUE) -ENDIF (PGSQL_INCLUDE_DIR) +# ---------------------------------------------------------------------------- +# History: +# This module is derived from the module originally found in the VTK source tree. +# +# ---------------------------------------------------------------------------- +# Note: +# PostgreSQL_ADDITIONAL_VERSIONS is a variable that can be used to set the +# version mumber of the implementation of PostgreSQL. +# In Windows the default installation of PostgreSQL uses that as part of the path. +# E.g C:\Program Files\PostgreSQL\8.4. +# Currently, the following version numbers are known to this module: +# "9.6" "9.5" "9.4" "9.3" "9.2" "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0" +# +# To use this variable just do something like this: +# set(PostgreSQL_ADDITIONAL_VERSIONS "9.2" "8.4.4") +# before calling find_package(PostgreSQL) in your CMakeLists.txt file. +# This will mean that the versions you set here will be found first in the order +# specified before the default ones are searched. +# +# ---------------------------------------------------------------------------- +# You may need to manually set: +# PostgreSQL_INCLUDE_DIR - the path to where the PostgreSQL include files are. +# PostgreSQL_LIBRARY_DIR - The path to where the PostgreSQL library files are. +# If FindPostgreSQL.cmake cannot find the include files or the library files. +# +# ---------------------------------------------------------------------------- +# The following variables are set if PostgreSQL is found: +# PostgreSQL_FOUND - Set to true when PostgreSQL is found. +# PostgreSQL_INCLUDE_DIRS - Include directories for PostgreSQL +# PostgreSQL_LIBRARY_DIRS - Link directories for PostgreSQL libraries +# PostgreSQL_LIBRARIES - The PostgreSQL libraries. +# +# ---------------------------------------------------------------------------- +# If you have installed PostgreSQL in a non-standard location. +# (Please note that in the following comments, it is assumed that +# points to the root directory of the include directory of PostgreSQL.) +# Then you have three options. +# 1) After CMake runs, set PostgreSQL_INCLUDE_DIR to /include and +# PostgreSQL_LIBRARY_DIR to wherever the library pq (or libpq in windows) is +# 2) Use CMAKE_INCLUDE_PATH to set a path to /PostgreSQL<-version>. This will allow find_path() +# to locate PostgreSQL_INCLUDE_DIR by utilizing the PATH_SUFFIXES option. e.g. In your CMakeLists.txt file +# set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "/include") +# 3) Set an environment variable called ${PostgreSQL_ROOT} that points to the root of where you have +# installed PostgreSQL, e.g. . +# +# ---------------------------------------------------------------------------- -FIND_PATH(PGSQL_INCLUDE_DIR libpq-fe.h - $ENV{ProgramFiles}/PostgreSQL/*/include - $ENV{SystemDrive}/PostgreSQL/*/include - /usr/local/pgsql/include - /usr/local/postgresql/include - /usr/local/include/pgsql - /usr/local/include/postgresql - /usr/local/include - /usr/include/pgsql - /usr/include/postgresql - /usr/include - /usr/pgsql/include - /usr/postgresql/include +set(PostgreSQL_INCLUDE_PATH_DESCRIPTION "top-level directory containing the PostgreSQL include directories. E.g /usr/local/include/PostgreSQL/8.4 or C:/Program Files/PostgreSQL/8.4/include") +set(PostgreSQL_INCLUDE_DIR_MESSAGE "Set the PostgreSQL_INCLUDE_DIR cmake cache entry to the ${PostgreSQL_INCLUDE_PATH_DESCRIPTION}") +set(PostgreSQL_LIBRARY_PATH_DESCRIPTION "top-level directory containing the PostgreSQL libraries.") +set(PostgreSQL_LIBRARY_DIR_MESSAGE "Set the PostgreSQL_LIBRARY_DIR cmake cache entry to the ${PostgreSQL_LIBRARY_PATH_DESCRIPTION}") +set(PostgreSQL_ROOT_DIR_MESSAGE "Set the PostgreSQL_ROOT system variable to where PostgreSQL is found on the machine E.g C:/Program Files/PostgreSQL/8.4") + + +set(PostgreSQL_KNOWN_VERSIONS ${PostgreSQL_ADDITIONAL_VERSIONS} + "9.6" "9.5" "9.4" "9.3" "9.2" "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0") + +# Define additional search paths for root directories. +set( PostgreSQL_ROOT_DIRECTORIES + ENV PostgreSQL_ROOT + ${PostgreSQL_ROOT} +) +foreach(suffix ${PostgreSQL_KNOWN_VERSIONS}) + if(WIN32) + list(APPEND PostgreSQL_LIBRARY_ADDITIONAL_SEARCH_SUFFIXES + "PostgreSQL/${suffix}/lib") + list(APPEND PostgreSQL_INCLUDE_ADDITIONAL_SEARCH_SUFFIXES + "PostgreSQL/${suffix}/include") + list(APPEND PostgreSQL_TYPE_ADDITIONAL_SEARCH_SUFFIXES + "PostgreSQL/${suffix}/include/server") + endif() + if(UNIX) + list(APPEND PostgreSQL_LIBRARY_ADDITIONAL_SEARCH_SUFFIXES + "pgsql-${suffix}/lib") + list(APPEND PostgreSQL_INCLUDE_ADDITIONAL_SEARCH_SUFFIXES + "pgsql-${suffix}/include") + list(APPEND PostgreSQL_TYPE_ADDITIONAL_SEARCH_SUFFIXES + "postgresql/${suffix}/server" + "pgsql-${suffix}/include/server") + endif() +endforeach() + +if(UNIX) + list(APPEND PostgreSQL_ROOT_DIRECTORIES + "/usr") + list(APPEND PostgreSQL_INCLUDE_ADDITIONAL_SEARCH_SUFFIXES + "include/postgresql") +endif() + +# +# Look for an installation. +# +find_path(PostgreSQL_INCLUDE_DIR + NAMES libpq-fe.h + PATHS + # Look in other places. + ${PostgreSQL_ROOT_DIRECTORIES} + PATH_SUFFIXES + pgsql + postgresql + include + ${PostgreSQL_INCLUDE_ADDITIONAL_SEARCH_SUFFIXES} + # Help the user find it if we cannot. + DOC "The ${PostgreSQL_INCLUDE_DIR_MESSAGE}" ) -SET(PGSQL_NAMES pq libpq) -SET(PGSQL_SEARCH_LIB_PATHS - ${PGSQL_SEARCH_LIB_PATHS} - $ENV{ProgramFiles}/PostgreSQL/*/lib - $ENV{SystemDrive}/PostgreSQL/*/lib - /usr/local/pgsql/lib - /usr/local/lib - /usr/lib -) -FIND_LIBRARY(PGSQL_LIBRARY - NAMES ${PGSQL_NAMES} - PATHS ${PGSQL_SEARCH_LIB_PATHS} -) +# TODO(Bjoe) It is not needed to build an PostgreSQL client. Maybe create an issue on cmake project +# find_path(PostgreSQL_TYPE_INCLUDE_DIR +# NAMES catalog/pg_type.h +# PATHS +# # Look in other places. +# ${PostgreSQL_ROOT_DIRECTORIES} +# PATH_SUFFIXES +# postgresql +# pgsql/server +# postgresql/server +# include/server +# ${PostgreSQL_TYPE_ADDITIONAL_SEARCH_SUFFIXES} +# # Help the user find it if we cannot. +# DOC "The ${PostgreSQL_INCLUDE_DIR_MESSAGE}" +# ) -IF (PGSQL_INCLUDE_DIR AND PGSQL_LIBRARY) - SET(PGSQL_FOUND TRUE) - SET( PGSQL_LIBRARIES ${PGSQL_LIBRARY} ) -ELSE (PGSQL_INCLUDE_DIR AND PGSQL_LIBRARY) - SET(PGSQL_FOUND FALSE) - SET( PGSQL_LIBRARIES ) -ENDIF (PGSQL_INCLUDE_DIR AND PGSQL_LIBRARY) +# The PostgreSQL library. +set (PostgreSQL_LIBRARY_TO_FIND pq) +# Setting some more prefixes for the library +set (PostgreSQL_LIB_PREFIX "") +if ( WIN32 ) + set (PostgreSQL_LIB_PREFIX ${PostgreSQL_LIB_PREFIX} "lib") + set (PostgreSQL_LIBRARY_TO_FIND ${PostgreSQL_LIB_PREFIX}${PostgreSQL_LIBRARY_TO_FIND}) +endif() -IF (PGSQL_FOUND) - IF (NOT PostgreSQL_FIND_QUIETLY) - MESSAGE(STATUS "Found PostgreSQL: ${PGSQL_LIBRARY}") - ENDIF (NOT PostgreSQL_FIND_QUIETLY) -ELSE (PGSQL_FOUND) - IF (PostgreSQL_FIND_REQUIRED) - MESSAGE(STATUS "Looked for PostgreSQL libraries named ${PGSQL_NAMES}.") - MESSAGE(FATAL_ERROR "Could NOT find PostgreSQL library") - ENDIF (PostgreSQL_FIND_REQUIRED) -ENDIF (PGSQL_FOUND) - -MARK_AS_ADVANCED( - PGSQL_LIBRARY - PGSQL_INCLUDE_DIR +find_library(PostgreSQL_LIBRARY + NAMES ${PostgreSQL_LIBRARY_TO_FIND} + PATHS + ${PostgreSQL_ROOT_DIRECTORIES} + PATH_SUFFIXES + lib + ${PostgreSQL_LIBRARY_ADDITIONAL_SEARCH_SUFFIXES} + # Help the user find it if we cannot. + DOC "The ${PostgreSQL_LIBRARY_DIR_MESSAGE}" ) -ENDMACRO(FIND_PGSQL) \ No newline at end of file +get_filename_component(PostgreSQL_LIBRARY_DIR ${PostgreSQL_LIBRARY} PATH) + +if (PostgreSQL_INCLUDE_DIR) + # Some platforms include multiple pg_config.hs for multi-lib configurations + # This is a temporary workaround. A better solution would be to compile + # a dummy c file and extract the value of the symbol. + file(GLOB _PG_CONFIG_HEADERS "${PostgreSQL_INCLUDE_DIR}/pg_config*.h") + foreach(_PG_CONFIG_HEADER ${_PG_CONFIG_HEADERS}) + if(EXISTS "${_PG_CONFIG_HEADER}") + file(STRINGS "${_PG_CONFIG_HEADER}" pgsql_version_str + REGEX "^#define[\t ]+PG_VERSION[\t ]+\".*\"") + if(pgsql_version_str) + string(REGEX REPLACE "^#define[\t ]+PG_VERSION[\t ]+\"([^\"]*)\".*" + "\\1" PostgreSQL_VERSION_STRING "${pgsql_version_str}") + break() + endif() + endif() + endforeach() + unset(pgsql_version_str) +endif() + +# Did we find anything? +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(PostgreSQL + REQUIRED_VARS PostgreSQL_LIBRARY PostgreSQL_INCLUDE_DIR #PostgreSQL_TYPE_INCLUDE_DIR + VERSION_VAR PostgreSQL_VERSION_STRING) +set(PostgreSQL_FOUND ${POSTGRESQL_FOUND}) + +# Now try to get the include and library path. +if(PostgreSQL_FOUND) + set(PostgreSQL_INCLUDE_DIRS ${PostgreSQL_INCLUDE_DIR} ) #${PostgreSQL_TYPE_INCLUDE_DIR} ) + set(PostgreSQL_LIBRARY_DIRS ${PostgreSQL_LIBRARY_DIR} ) + set(PostgreSQL_LIBRARIES ${PostgreSQL_LIBRARY}) +endif() + +mark_as_advanced(PostgreSQL_INCLUDE_DIR PostgreSQL_LIBRARY ) #PostgreSQL_TYPE_INCLUDE_DIR diff --git a/cmake/V33/FindOpenSSL.cmake b/cmake/V33/FindOpenSSL.cmake new file mode 100644 index 000000000..d44a3aa3a --- /dev/null +++ b/cmake/V33/FindOpenSSL.cmake @@ -0,0 +1,463 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +#.rst: +# FindOpenSSL +# ----------- +# +# Find the OpenSSL encryption library. +# +# Imported Targets +# ^^^^^^^^^^^^^^^^ +# +# This module defines the following :prop_tgt:`IMPORTED` targets: +# +# ``OpenSSL::SSL`` +# The OpenSSL ``ssl`` library, if found. +# ``OpenSSL::Crypto`` +# The OpenSSL ``crypto`` library, if found. +# +# Result Variables +# ^^^^^^^^^^^^^^^^ +# +# This module will set the following variables in your project: +# +# ``OPENSSL_FOUND`` +# System has the OpenSSL library. +# ``OPENSSL_INCLUDE_DIR`` +# The OpenSSL include directory. +# ``OPENSSL_CRYPTO_LIBRARY`` +# The OpenSSL crypto library. +# ``OPENSSL_SSL_LIBRARY`` +# The OpenSSL SSL library. +# ``OPENSSL_LIBRARIES`` +# All OpenSSL libraries. +# ``OPENSSL_VERSION`` +# This is set to ``$major.$minor.$revision$patch`` (e.g. ``0.9.8s``). +# +# Hints +# ^^^^^ +# +# Set ``OPENSSL_ROOT_DIR`` to the root directory of an OpenSSL installation. +# Set ``OPENSSL_USE_STATIC_LIBS`` to ``TRUE`` to look for static libraries. +# Set ``OPENSSL_MSVC_STATIC_RT`` set ``TRUE`` to choose the MT version of the lib. + +if (UNIX) + find_package(PkgConfig QUIET) + pkg_check_modules(_OPENSSL QUIET openssl) +endif () + +# Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES +if(OPENSSL_USE_STATIC_LIBS) + set(_openssl_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) + if(WIN32) + set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) + else() + set(CMAKE_FIND_LIBRARY_SUFFIXES .a ) + endif() +endif() + +if (WIN32) + # http://www.slproweb.com/products/Win32OpenSSL.html + set(_OPENSSL_ROOT_HINTS + ${OPENSSL_ROOT_DIR} + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;Inno Setup: App Path]" + ENV OPENSSL_ROOT_DIR + ) + file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles) + set(_OPENSSL_ROOT_PATHS + "${_programfiles}/OpenSSL" + "${_programfiles}/OpenSSL-Win32" + "${_programfiles}/OpenSSL-Win64" + "C:/OpenSSL/" + "C:/OpenSSL-Win32/" + "C:/OpenSSL-Win64/" + ) + unset(_programfiles) +else () + set(_OPENSSL_ROOT_HINTS + ${OPENSSL_ROOT_DIR} + ENV OPENSSL_ROOT_DIR + ) +endif () + +set(_OPENSSL_ROOT_HINTS_AND_PATHS + HINTS ${_OPENSSL_ROOT_HINTS} + PATHS ${_OPENSSL_ROOT_PATHS} + ) + +find_path(OPENSSL_INCLUDE_DIR + NAMES + openssl/ssl.h + ${_OPENSSL_ROOT_HINTS_AND_PATHS} + HINTS + ${_OPENSSL_INCLUDEDIR} + PATH_SUFFIXES + include +) + +if(WIN32 AND NOT CYGWIN) + if(MSVC) + # /MD and /MDd are the standard values - if someone wants to use + # others, the libnames have to change here too + # use also ssl and ssleay32 in debug as fallback for openssl < 0.9.8b + # enable OPENSSL_MSVC_STATIC_RT to get the libs build /MT (Multithreaded no-DLL) + # In Visual C++ naming convention each of these four kinds of Windows libraries has it's standard suffix: + # * MD for dynamic-release + # * MDd for dynamic-debug + # * MT for static-release + # * MTd for static-debug + + # Implementation details: + # We are using the libraries located in the VC subdir instead of the parent directory eventhough : + # libeay32MD.lib is identical to ../libeay32.lib, and + # ssleay32MD.lib is identical to ../ssleay32.lib + # enable OPENSSL_USE_STATIC_LIBS to use the static libs located in lib/VC/static + + if (OPENSSL_MSVC_STATIC_RT) + set(_OPENSSL_MSVC_RT_MODE "MT") + else () + set(_OPENSSL_MSVC_RT_MODE "MD") + endif () + + # Since OpenSSL 1.1, lib names are like libcrypto32MTd.lib and libssl32MTd.lib + if( "${CMAKE_SIZEOF_VOID_P}" STREQUAL "8" ) + set(_OPENSSL_MSVC_ARCH_SUFFIX "64") + else() + set(_OPENSSL_MSVC_ARCH_SUFFIX "32") + endif() + + if(OPENSSL_USE_STATIC_LIBS) + set(_OPENSSL_PATH_SUFFIXES + "lib/VC/static" + "VC/static" + "lib" + ) + else() + set(_OPENSSL_PATH_SUFFIXES + "lib/VC" + "VC" + "lib" + ) + endif () + + find_library(LIB_EAY_DEBUG + NAMES + libcrypto${_OPENSSL_MSVC_ARCH_SUFFIX}${_OPENSSL_MSVC_RT_MODE}d + libcrypto${_OPENSSL_MSVC_RT_MODE}d + libcryptod + libeay32${_OPENSSL_MSVC_RT_MODE}d + libeay32d + NAMES_PER_DIR + ${_OPENSSL_ROOT_HINTS_AND_PATHS} + PATH_SUFFIXES + ${_OPENSSL_PATH_SUFFIXES} + ) + + find_library(LIB_EAY_RELEASE + NAMES + libcrypto${_OPENSSL_MSVC_ARCH_SUFFIX}${_OPENSSL_MSVC_RT_MODE} + libcrypto${_OPENSSL_MSVC_RT_MODE} + libcrypto + libeay32${_OPENSSL_MSVC_RT_MODE} + libeay32 + crypto + NAMES_PER_DIR + ${_OPENSSL_ROOT_HINTS_AND_PATHS} + PATH_SUFFIXES + ${_OPENSSL_PATH_SUFFIXES} + ) + + find_library(SSL_EAY_DEBUG + NAMES + libssl${_OPENSSL_MSVC_ARCH_SUFFIX}${_OPENSSL_MSVC_RT_MODE}d + libssl${_OPENSSL_MSVC_RT_MODE}d + libssld + ssleay32${_OPENSSL_MSVC_RT_MODE}d + ssleay32d + NAMES_PER_DIR + ${_OPENSSL_ROOT_HINTS_AND_PATHS} + PATH_SUFFIXES + ${_OPENSSL_PATH_SUFFIXES} + ) + + find_library(SSL_EAY_RELEASE + NAMES + libssl${_OPENSSL_MSVC_ARCH_SUFFIX}${_OPENSSL_MSVC_RT_MODE} + libssl${_OPENSSL_MSVC_RT_MODE} + libssl + ssleay32${_OPENSSL_MSVC_RT_MODE} + ssleay32 + ssl + NAMES_PER_DIR + ${_OPENSSL_ROOT_HINTS_AND_PATHS} + PATH_SUFFIXES + ${_OPENSSL_PATH_SUFFIXES} + ) + + set(LIB_EAY_LIBRARY_DEBUG "${LIB_EAY_DEBUG}") + set(LIB_EAY_LIBRARY_RELEASE "${LIB_EAY_RELEASE}") + set(SSL_EAY_LIBRARY_DEBUG "${SSL_EAY_DEBUG}") + set(SSL_EAY_LIBRARY_RELEASE "${SSL_EAY_RELEASE}") + + include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) + select_library_configurations(LIB_EAY) + select_library_configurations(SSL_EAY) + + mark_as_advanced(LIB_EAY_LIBRARY_DEBUG LIB_EAY_LIBRARY_RELEASE + SSL_EAY_LIBRARY_DEBUG SSL_EAY_LIBRARY_RELEASE) + set(OPENSSL_SSL_LIBRARY ${SSL_EAY_LIBRARY} ) + set(OPENSSL_CRYPTO_LIBRARY ${LIB_EAY_LIBRARY} ) + elseif(MINGW) + # same player, for MinGW + set(LIB_EAY_NAMES crypto libeay32) + set(SSL_EAY_NAMES ssl ssleay32) + find_library(LIB_EAY + NAMES + ${LIB_EAY_NAMES} + NAMES_PER_DIR + ${_OPENSSL_ROOT_HINTS_AND_PATHS} + PATH_SUFFIXES + "lib/MinGW" + "lib" + ) + + find_library(SSL_EAY + NAMES + ${SSL_EAY_NAMES} + NAMES_PER_DIR + ${_OPENSSL_ROOT_HINTS_AND_PATHS} + PATH_SUFFIXES + "lib/MinGW" + "lib" + ) + + mark_as_advanced(SSL_EAY LIB_EAY) + set(OPENSSL_SSL_LIBRARY ${SSL_EAY} ) + set(OPENSSL_CRYPTO_LIBRARY ${LIB_EAY} ) + unset(LIB_EAY_NAMES) + unset(SSL_EAY_NAMES) + else() + # Not sure what to pick for -say- intel, let's use the toplevel ones and hope someone report issues: + find_library(LIB_EAY + NAMES + libcrypto + libeay32 + NAMES_PER_DIR + ${_OPENSSL_ROOT_HINTS_AND_PATHS} + HINTS + ${_OPENSSL_LIBDIR} + PATH_SUFFIXES + lib + ) + + find_library(SSL_EAY + NAMES + libssl + ssleay32 + NAMES_PER_DIR + ${_OPENSSL_ROOT_HINTS_AND_PATHS} + HINTS + ${_OPENSSL_LIBDIR} + PATH_SUFFIXES + lib + ) + + mark_as_advanced(SSL_EAY LIB_EAY) + set(OPENSSL_SSL_LIBRARY ${SSL_EAY} ) + set(OPENSSL_CRYPTO_LIBRARY ${LIB_EAY} ) + endif() +else() + + find_library(OPENSSL_SSL_LIBRARY + NAMES + ssl + ssleay32 + ssleay32MD + NAMES_PER_DIR + ${_OPENSSL_ROOT_HINTS_AND_PATHS} + HINTS + ${_OPENSSL_LIBDIR} + PATH_SUFFIXES + lib + ) + + find_library(OPENSSL_CRYPTO_LIBRARY + NAMES + crypto + NAMES_PER_DIR + ${_OPENSSL_ROOT_HINTS_AND_PATHS} + HINTS + ${_OPENSSL_LIBDIR} + PATH_SUFFIXES + lib + ) + + mark_as_advanced(OPENSSL_CRYPTO_LIBRARY OPENSSL_SSL_LIBRARY) + + # compat defines + set(OPENSSL_SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY}) + set(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY}) + +endif() + +function(from_hex HEX DEC) + string(TOUPPER "${HEX}" HEX) + set(_res 0) + string(LENGTH "${HEX}" _strlen) + + while (_strlen GREATER 0) + math(EXPR _res "${_res} * 16") + string(SUBSTRING "${HEX}" 0 1 NIBBLE) + string(SUBSTRING "${HEX}" 1 -1 HEX) + if (NIBBLE STREQUAL "A") + math(EXPR _res "${_res} + 10") + elseif (NIBBLE STREQUAL "B") + math(EXPR _res "${_res} + 11") + elseif (NIBBLE STREQUAL "C") + math(EXPR _res "${_res} + 12") + elseif (NIBBLE STREQUAL "D") + math(EXPR _res "${_res} + 13") + elseif (NIBBLE STREQUAL "E") + math(EXPR _res "${_res} + 14") + elseif (NIBBLE STREQUAL "F") + math(EXPR _res "${_res} + 15") + else() + math(EXPR _res "${_res} + ${NIBBLE}") + endif() + + string(LENGTH "${HEX}" _strlen) + endwhile() + + set(${DEC} ${_res} PARENT_SCOPE) +endfunction() + +if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h") + file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str + REGEX "^#[\t ]*define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*") + + if(openssl_version_str) + # The version number is encoded as 0xMNNFFPPS: major minor fix patch status + # The status gives if this is a developer or prerelease and is ignored here. + # Major, minor, and fix directly translate into the version numbers shown in + # the string. The patch field translates to the single character suffix that + # indicates the bug fix state, which 00 -> nothing, 01 -> a, 02 -> b and so + # on. + + string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F]).*$" + "\\1;\\2;\\3;\\4;\\5" OPENSSL_VERSION_LIST "${openssl_version_str}") + list(GET OPENSSL_VERSION_LIST 0 OPENSSL_VERSION_MAJOR) + list(GET OPENSSL_VERSION_LIST 1 OPENSSL_VERSION_MINOR) + from_hex("${OPENSSL_VERSION_MINOR}" OPENSSL_VERSION_MINOR) + list(GET OPENSSL_VERSION_LIST 2 OPENSSL_VERSION_FIX) + from_hex("${OPENSSL_VERSION_FIX}" OPENSSL_VERSION_FIX) + list(GET OPENSSL_VERSION_LIST 3 OPENSSL_VERSION_PATCH) + + if (NOT OPENSSL_VERSION_PATCH STREQUAL "00") + from_hex("${OPENSSL_VERSION_PATCH}" _tmp) + # 96 is the ASCII code of 'a' minus 1 + math(EXPR OPENSSL_VERSION_PATCH_ASCII "${_tmp} + 96") + unset(_tmp) + # Once anyone knows how OpenSSL would call the patch versions beyond 'z' + # this should be updated to handle that, too. This has not happened yet + # so it is simply ignored here for now. + string(ASCII "${OPENSSL_VERSION_PATCH_ASCII}" OPENSSL_VERSION_PATCH_STRING) + endif () + + set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_FIX}${OPENSSL_VERSION_PATCH_STRING}") + endif () +endif () + +include(FindPackageHandleStandardArgs) + +set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} ) + +if (OPENSSL_VERSION) + find_package_handle_standard_args(OpenSSL + REQUIRED_VARS + #OPENSSL_SSL_LIBRARY # FIXME: require based on a component request? + OPENSSL_CRYPTO_LIBRARY + OPENSSL_INCLUDE_DIR + VERSION_VAR + OPENSSL_VERSION + FAIL_MESSAGE + "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR" + ) +else () + find_package_handle_standard_args(OpenSSL "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR" + #OPENSSL_SSL_LIBRARY # FIXME: require based on a component request? + OPENSSL_CRYPTO_LIBRARY + OPENSSL_INCLUDE_DIR + ) +endif () + +mark_as_advanced(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES) + +if(OPENSSL_FOUND) + if(NOT TARGET OpenSSL::Crypto AND + (EXISTS "${OPENSSL_CRYPTO_LIBRARY}" OR + EXISTS "${LIB_EAY_LIBRARY_DEBUG}" OR + EXISTS "${LIB_EAY_LIBRARY_RELEASE}") + ) + add_library(OpenSSL::Crypto UNKNOWN IMPORTED) + set_target_properties(OpenSSL::Crypto PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${OPENSSL_INCLUDE_DIR}") + if(EXISTS "${OPENSSL_CRYPTO_LIBRARY}") + set_target_properties(OpenSSL::Crypto PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + IMPORTED_LOCATION "${OPENSSL_CRYPTO_LIBRARY}") + endif() + if(EXISTS "${LIB_EAY_LIBRARY_RELEASE}") + set_property(TARGET OpenSSL::Crypto APPEND PROPERTY + IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(OpenSSL::Crypto PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C" + IMPORTED_LOCATION_RELEASE "${LIB_EAY_LIBRARY_RELEASE}") + endif() + if(EXISTS "${LIB_EAY_LIBRARY_DEBUG}") + set_property(TARGET OpenSSL::Crypto APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(OpenSSL::Crypto PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C" + IMPORTED_LOCATION_DEBUG "${LIB_EAY_LIBRARY_DEBUG}") + endif() + endif() + if(NOT TARGET OpenSSL::SSL AND + (EXISTS "${OPENSSL_SSL_LIBRARY}" OR + EXISTS "${SSL_EAY_LIBRARY_DEBUG}" OR + EXISTS "${SSL_EAY_LIBRARY_RELEASE}") + ) + add_library(OpenSSL::SSL UNKNOWN IMPORTED) + set_target_properties(OpenSSL::SSL PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${OPENSSL_INCLUDE_DIR}") + if(EXISTS "${OPENSSL_SSL_LIBRARY}") + set_target_properties(OpenSSL::SSL PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + IMPORTED_LOCATION "${OPENSSL_SSL_LIBRARY}") + endif() + if(EXISTS "${SSL_EAY_LIBRARY_RELEASE}") + set_property(TARGET OpenSSL::SSL APPEND PROPERTY + IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(OpenSSL::SSL PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C" + IMPORTED_LOCATION_RELEASE "${SSL_EAY_LIBRARY_RELEASE}") + endif() + if(EXISTS "${SSL_EAY_LIBRARY_DEBUG}") + set_property(TARGET OpenSSL::SSL APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(OpenSSL::SSL PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C" + IMPORTED_LOCATION_DEBUG "${SSL_EAY_LIBRARY_DEBUG}") + endif() + if(TARGET OpenSSL::Crypto) + set_target_properties(OpenSSL::SSL PROPERTIES + INTERFACE_LINK_LIBRARIES OpenSSL::Crypto) + endif() + endif() +endif() + +# Restore the original find library ordering +if(OPENSSL_USE_STATIC_LIBS) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${_openssl_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) +endif() diff --git a/doc/00200-GettingStarted.page b/doc/00200-GettingStarted.page index 0bdd65c9f..5566106df 100644 --- a/doc/00200-GettingStarted.page +++ b/doc/00200-GettingStarted.page @@ -233,32 +233,86 @@ source. !!Building using CMake As an alternative to the platform specific Makefiles and Solutions, CMake can be used -to do build Poco. CMake is a cross platform Makefile generator that also supports -Microsoft Visual Studio and Apple Xcode. -Poco requires CMake 3.0 or higher. Static binaries for many platforms can be downloaded from http://www.cmake.org/ +to do build POCO C++ Libraries on any platform with any compiler. CMake is a meta build system and it +generate native makefiles and workspaces that can be used in the compiler environment of +your choice. For a quick overview see http://cgold.readthedocs.io/en/latest/overview/cmake-can.html -CMake supports out of source builds and this is the recommended way to build Poco using CMake. +POCO C++ Libraries requires CMake 3.2 or higher. Static binaries for many platforms can be downloaded from http://www.cmake.org/ -Assuming you are currently in the Poco source directory on a Unix machine -and you like to build Poco with the generated Makefiles just type the following commands. +CMake supports out of source builds and this is the recommended way to build POCO C++ Libraries using CMake. - $ mkdir cmake_build - $ cd cmake_build - $ cmake .. - $ make +Assuming the POCO C++ Libraries source is located in /path/to/poco directory and you like to build POCO C++ Libraries just type the +following commands (Command parameters are all the same on any platform). -This will build Poco in a subdirectory <*cmake_build*>. All files produced during build are located in this directory. + $ cmake -H/path/to/poco -B/path/to/poco-build + $ cmake --build /path/to/poco-build --target all -CMake allows you to set some build time options. As an example: to disable the SevenZip support +This will build POCO C++ Libraries in a subdirectory <*poco-build*>. All files produced during build are located in this directory. + +POCO C++ Libraries allows you to set some build time options. As an example: to disable the SevenZip support type the following command: - $ cmake -DENABLE_SEVENZIP=OFF .. + $ cmake -H/path/to/poco -B/path/to/poco-build -DENABLE_SEVENZIP=OFF + $ cmake --build /path/to/poco-build --target all -Similar options are available for other components (see: CMakeLists.txt). +Similar options are available for other components. To see and enable or disable available options execute following command: -If you cannot or do not want to build with CMake, there are other options, -described in the following. + $ cmake-gui /path/to/poco-build +or for console only: + + $ ccmake /path/to/poco-build + +POCO C++ Libraries options are prefixed with <*ENABLE_*>. (This will be changed in POCO 2.x.x to <*POCO_*>) + +To use POCO C++ Libraries in your cmake project, add following line in your project for example to use crypto: + + find_package(Poco REQUIRED PocoCrypto) + .... + target_link_libraries(yourTargetName ... Poco::Crypto) + +If you get an error like 'By not providing "FindPoco.cmake"', then you should set CMAKE_PREFIX_PATH to the installation directory of your POCO C++ Libraries. For example: + + $ cmake -H/path/to/yourProject -B/path/to/yourProject-build -DCMAKE_PREFIX_PATH=/path/to/installationOf/poco + +Some other Hints: + +To use the compiler of your choice for example clang compiler, execute following cmake command: + + $ cmake -H/path/to/poco -B/path/to/poco-build -DCMAKE_C_COMPILER=/path/to/clang -DCMAKE_CXX_COMPILER=/path/to/clang++ + $ cmake --build /path/to/poco-build --target all + +To cross compile POCO C++ Libraries for another architecture/device you should have a <*cmake toolchain file*> and execute following command: + + $ cmake -H/path/to/poco -B/path/to/poco-build -DCMAKE_TOOLCHAIN_FILE=/path/to/toolchainfile + $ cmake --build /path/to/poco-build --target all + +See https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html for more information. + +For a faster build, use ninja as build system. See https://ninja-build.org/ +For example on Ubuntu execute following commands: + + $ sudo apt-get install ninja-build + +This install <*ninja*> command. To use ninja-build execute following cmake commands: + + $ cmake -H/path/to/poco -B/path/to/poco-build -GNinja + $ cmake --build /path/to/poco-build --target all + +See https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html for other generators. + +To enable verbose output from Makefile builds, execute following cmake commands: + + $ cmake -H/path/to/poco -B/path/to/poco-build -DCMAKE_VERBOSE_MAKEFILE=ON + $ cmake --build /path/to/poco-build --target all + + +Some more infos about cmake see: + +$ cmake --help-full +https://cmake.org/cmake/help/latest/ +http://cgold.readthedocs.io/en/latest/index.html + !!Building On Windows