Under developement! Not usable at time. README.md only as draft, work in progress.
This is a fork of the Portable SDK for UPnP Devices (pupnp) with the aim of a complete re-engeneering based on UPnP™ Device Architecture 2.0. The following general goals are in progress or planned:
- Drop in compatibillity with the old pUPnP library
- Continue optimization for embedded devices
- Based on C++ instead of C
- Object oriented programming
- Unit-Test driven developement
- Using CMake for managing the code
- Focus on IPv6 support
Here you can find the Technical Documentation.\n If you want to be compatible with the classic pUPnP library here you find the [Compatible API](\ref compaAPI).\n To use the new written object oriented part of the library here you find its [UPnPlib API](\ref upnplibAPI).
We follow the Semantic Versioning. In short it defines
- MAJOR version when you make incompatible API changes,
- MINOR version when you add or modify functionality in a backwards compatible manner, and
- PATCH version when you make backwards compatible bug fixes.
The UPnpLib version starts with 0.1.0. Major version 0 means it's not a productive version but under developement. Because we will use CMake to manage the code it can be seen as integral part of the project. The UPnPlib version number will also reflect changes to the CMake configuration.
This fork is based on release-1.14.19 of the pupnp library.
- Ongoing: create extensive Unit Tests without modification of the old source code
- Ongoing: define C++ interfaces for the API
- Ongoing: change old C program to C++ objects but preserve drop in compatibility
- Ongoing: support IP6
- Ongoing: support OpenSSL
If nothing others said we are always staying at the root directory of the project (CMAKE_SOURCE_DIR), that is upnplib_project/ if you don't changed the name.
First configure then build:
upnplib_project$ cmake -S . -B build -D UPNPLIB_WITH_SAMPLES=YES
upnplib_project$ cmake --build build
To clean up a build just delete the build folder:
upnplib_project$ rm -rf build
The developement of this UPnP Library has started on Linux. So for historical reasons it uses POSIX threads (pthreads) as specified by The Open Group. Unfortunately Microsoft Windows does not support it so I have to use a third party library. I use the well known and well supported pthreads4w library. It will be downloaded on Microsoft Windows and compiled with building the project and should do out of the box. To build the UPnPlib you need a Developer Command Prompt. How to install it is out of scope of this description. Microsoft has good documentation about it. For example this is the prompt I used:
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.9.5
** Copyright (c) 2021 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
ingo@WIN10-DEVEL C:\Users\ingo> pwsh
PowerShell 7.4.1
PS C:\Users\ingo>
First configure then build:
PS C: upnplib_project> cmake -S . -B build -D UPNPLIB_WITH_SAMPLES=YES
PS C: upnplib_project> cmake --build build --config Release
After build don't forget to copy the needed ./build/_deps/pthreads4w-build/pthread*.dll
library file to a location where your program can find it. Copying it to your programs directory or to the system directory Windows\System32
will always do. Within the project developement directory tree (default root upnplib_project/) built programs and libraries find its dll files. There is nothing to do.
To clean up a build just delete the build folder:
PS C: upnplib_project> rm -rf build
If you need more details about installation of POSIX threads on Microsoft Windows I have made an example at github pthreadsWinLin.
I strongly recommend to use shared gtest libraries for this project because there are situations where static and shared libraries are linked together. Using static linked Googletest libraries may fail then. If you know what you ar doing and you are able to manage possible linker errors you can try to use static built Googletest libraries.
# strongly recommended shared libs
upnplib_project$ cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -D UPNPLIB_WITH_GOOGLETEST=ON
upnplib_project$ cmake --build build --config Debug
# or alternative static libs
upnplib_project$ cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -D UPNPLIB_WITH_GOOGLETEST=ON -D GTESTS_WITH_SHARED_LIBS=OFF
upnplib_project$ cmake --build build --config Debug
Using build type "Debug" is not necessary for Googletest but it will enable additional debug messages from the library. if you don't need it you can just use "Release" instead of "Debug" above as option.
No limits documented so far.
Copyright (C) 2021+ GPL 3 and higher by Ingo Höft, \ Redistribution only with this Copyright remark. Last modified: 2024-08-04