poco/README.md

156 lines
5.0 KiB
Markdown
Raw Normal View History

2018-03-07 17:35:20 +01:00
![alt text][logo]
2015-01-19 14:43:59 +01:00
2021-06-16 21:33:52 +02:00
[![poco-ci](https://github.com/pocoproject/poco/actions/workflows/ci.yml/badge.svg?branch=poco-1.11.0)](https://github.com/pocoproject/poco/actions/workflows/ci.yml)
2018-03-07 17:35:20 +01:00
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/370/badge)](https://bestpractices.coreinfrastructure.org/projects/370)
2015-01-19 14:43:59 +01:00
2016-03-12 16:42:25 +01:00
2020-01-27 09:07:10 +01:00
### POCO (Portable Components) C++ Libraries are:
2018-03-08 10:55:58 +01:00
2020-01-27 09:07:10 +01:00
- A collection of C++ class libraries, conceptually similar to the Java Class Library or the .NET Framework.
2013-06-05 06:16:05 +02:00
- Focused on solutions to frequently-encountered practical problems.
2020-01-27 09:07:10 +01:00
- Focused on "internet-age" network-centric applications.
2013-06-05 06:16:05 +02:00
- Written in efficient, modern, 100% ANSI/ISO Standard C++.
- Based on and complementing the C++ Standard Library/STL.
2017-11-10 14:14:19 +01:00
- Highly portable and available on many different platforms, from embedded to server.
2016-03-12 16:42:25 +01:00
- Open Source, licensed under the [Boost Software License](https://spdx.org/licenses/BSL-1.0).
2018-03-07 17:35:20 +01:00
![alt text][overview]
2017-11-10 14:14:19 +01:00
To start using POCO, see the [Guided Tour](https://pocoproject.org/docs/00100-GuidedTour.html)
and [Getting Started](https://pocoproject.org/docs/00200-GettingStarted.html) documents.
2014-10-14 03:26:02 +02:00
2020-01-27 09:07:10 +01:00
## Quick Start (with CMake)
### Prerequisites
- CMake 3.5 or newer
- A C++14 compiler (Visual C++ 2015, GCC 5.0, Clang 3.4, or newer)
2020-01-27 09:25:45 +01:00
- OpenSSL headers and libraries (optional, but recommended)
- MySQL, PostgreSQL and ODBC client libraries (optional)
2020-01-27 09:07:10 +01:00
2020-01-27 09:25:45 +01:00
Most Unix/Linux systems already have OpenSSL preinstalled. If your system
does not have OpenSSL, please get it from <http://www.openssl.org> or
another source. You do not have to build OpenSSL yourself - a binary
distribution is fine. For example, via Debian APT:
```
$ apt-get install openssl libssl-dev
```
On macOS, the easiest way to install OpenSSL is via [Homebrew](https://brew.sh):
```
$ brew install openssl
```
The easiest way to install OpenSSL on Windows is to use a binary
(prebuild) release, for example the one from Shining Light
Productions that comes with a
[Windows installer](https://www.slproweb.com/products/Win32OpenSSL.html).
On Windows, POCO can also use the native Windows TLS APIs (SChannel).
### Installing All Dependencies (Linux and macOS)
All dependencies can be installed with the following commands:
#### Debian Linux (including Ubuntu and Raspbian)
```
$ sudo apt-get -y update && sudo apt-get -y install git g++ make cmake libssl-dev
```
#### RedHat Linux
```
$ sudo yum install -y git gcc-c++ make cmake3 openssl-devel
```
#### macOS (with Homebrew)
```
$ brew install cmake openssl
```
### Building with CMake (Linux, macOS, Windows)
[CMake](https://cmake.org) (version 3.5 or newer) is the recommended build system for
building the POCO C++ Libraries.
2020-01-27 09:07:10 +01:00
```
$ git clone -b master https://github.com/pocoproject/poco.git
$ cd poco
$ mkdir cmake-build
$ cd cmake-build
2020-01-27 09:25:45 +01:00
$ cmake ..
$ cmake --build . --config Release
```
On macOS, it's necessary to tell CMake where to find the OpenSSL headers
and libraries by setting the `OPENSSL_ROOT_DIR` CMake variable.
For example, if OpenSSL has been installed with Homebrew,
the `cmake` invocation becomes:
```
$ cmake .. -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl
```
Other common ways of building with CMake (e.g., `cmake-gui`) will also work.
There are also a number of project-specific CMake variables that can be changed.
#### Cross-Compiling
With a proper CMake toolchain file (specified via the `CMAKE_TOOLCHAIN_FILE` CMake variable),
the POCO C++ Libraries can be cross-compiled for embedded Linux systems:
2020-01-27 09:07:10 +01:00
```
2020-01-27 09:25:45 +01:00
$ cmake .. -DCMAKE_TOOLCHAIN_FILE=/path/to/mytoolchain.cmake -DCMAKE_INSTALL_PREFIX=/path/to/target
```
#### Installing
2020-01-27 09:07:10 +01:00
2020-01-27 09:25:45 +01:00
The POCO C++ Libraries headers and libraries can be optionally be installed by building the `install` target.
2020-01-27 09:07:10 +01:00
```
$ sudo cmake --build . --target install
```
2020-01-27 09:25:45 +01:00
The default install location is `/usr/local/` on Linux and macOS and
`C:\Program Files (x64)\` on Windows and can be overridden by setting
the `CMAKE_INSTALL_PREFIX` CMake variable.
### Building Without CMake
2020-01-27 09:07:10 +01:00
If you do not want to or cannot use CMake, POCO can also be built with Visual Studio
2020-01-27 09:25:45 +01:00
(project and solution files included) or GNU Make (Linux, macOS and other supported Unix platforms).
2020-01-27 09:07:10 +01:00
Please refer to the [documentation](https://pocoproject.org/docs) for more information.
2020-01-27 09:25:45 +01:00
### Getting POCO via a Package Manager
2020-01-27 09:07:10 +01:00
POCO can also be obtained via different [package managers](https://pocoproject.org/download.html).
2020-01-27 09:25:45 +01:00
2020-01-27 09:07:10 +01:00
## Community and Contributing
POCO has an active user and contributing community, please visit our [website](https://pocoproject.org) and [blog](https://pocoproject.org/blog).
2016-09-13 07:42:41 +02:00
Answers to POCO-related questions can also be found on [Stack Overflow](https://stackoverflow.com/questions/tagged/poco-libraries).
Please see [CONTRIBUTING](CONTRIBUTING.md) for submitting contributions, bugs reports, feature requests or security issues.
2013-06-05 06:16:05 +02:00
2020-01-27 09:07:10 +01:00
### POCO vs. Boost
2014-10-14 03:26:52 +02:00
In regards to Boost, in spite of some functional overlapping,
POCO is best thought of as a Boost complement (rather than replacement).
2016-03-12 16:42:25 +01:00
Side-by-side use of Boost and POCO is a very common occurrence.
2013-06-05 06:16:05 +02:00
2018-03-08 10:55:58 +01:00
[overview]: doc/images/overview.png "Poco Overview"
[logo]: doc/images/logo.png "Poco Logo"