poafloc

Parser Of Arguments For Lines Of Commands
git clone git://git.dimitrijedobrota.com/poafloc.git
Log | Files | Refs | README | LICENSE | HACKING | CONTRIBUTING | CODE_OF_CONDUCT | BUILDING

commit 5c4cf9d0404e3ccdfd69206e6d9faeef1203666a
parent 133e6c73f6dbdf0d5ba6f3171afbae7e04897e4f
author Dimitrije Dobrota <mail@dimitrijedobrota.com>
date Sun, 9 Mar 2025 19:53:04 +0100

Add support for vcpkg

Diffstat:
M CMakePresets.json | ++++++++++++++++++++++++++ ----------------------
M CONTRIBUTING.md | -
M HACKING.md | ++++++++++++ --------------------------
M README.md | ++++++ -------
M cmake/install-config.cmake | ++
A vcpkg.json | +++++++++++++

6 files changed, 59 insertions(+), 56 deletions(-)


diff --git a/ CMakePresets.json b/ CMakePresets.json

@@ -7,26 +7,25 @@ }, "configurePresets": [ {
"name": "cmake-pedantic",
"name": "dev-mode",
"hidden": true,
"warnings": {
"dev": true,
"deprecated": true,
"uninitialized": true,
"unusedCli": true,
"systemVars": false
},
"errors": {
"dev": true,
"deprecated": true
"cacheVariables": {
"package_DEVELOPER_MODE": "ON",
"VCPKG_MANIFEST_FEATURES": "test"
} }, {
"name": "dev-mode",
"name": "vcpkg",
"hidden": true,
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
}
},
{
"name": "vcpkg-win64-static",
"hidden": true,
"inherits": "cmake-pedantic",
"cacheVariables": {
"poafloc_DEVELOPER_MODE": "ON"
"VCPKG_TARGET_TRIPLET": "x64-windows-static-md"
} }, {

@@ -93,7 +92,10 @@ "name": "ci-darwin", "inherits": ["flags-appleclang", "ci-std"], "generator": "Xcode",
"hidden": true
"hidden": true,
"cacheVariables": {
"CMAKE_CATCH_DISCOVER_TESTS_DISCOVERY_MODE": "PRE_TEST"
}
}, { "name": "ci-win64",

@@ -112,12 +114,13 @@ "CMAKE_BUILD_TYPE": "Coverage", "CMAKE_CXX_FLAGS_COVERAGE": "-Og -g --coverage -fkeep-inline-functions -fkeep-static-functions", "CMAKE_EXE_LINKER_FLAGS_COVERAGE": "--coverage",
"CMAKE_SHARED_LINKER_FLAGS_COVERAGE": "--coverage"
"CMAKE_SHARED_LINKER_FLAGS_COVERAGE": "--coverage",
"CMAKE_MAP_IMPORTED_CONFIG_COVERAGE": "Coverage;RelWithDebInfo;Release;Debug;"
} }, { "name": "ci-coverage",
"inherits": ["coverage-linux", "dev-mode"],
"inherits": ["coverage-linux", "dev-mode", "vcpkg"],
"cacheVariables": { "COVERAGE_HTML_COMMAND": "" }

@@ -125,10 +128,11 @@ { "name": "ci-sanitize", "binaryDir": "${sourceDir}/build/sanitize",
"inherits": ["ci-linux", "dev-mode"],
"inherits": ["ci-linux", "dev-mode", "vcpkg"],
"cacheVariables": { "CMAKE_BUILD_TYPE": "Sanitize",
"CMAKE_CXX_FLAGS_SANITIZE": "-U_FORTIFY_SOURCE -O2 -g -fsanitize=address,undefined -fno-omit-frame-pointer -fno-common"
"CMAKE_CXX_FLAGS_SANITIZE": "-U_FORTIFY_SOURCE -O2 -g -fsanitize=address,undefined -fno-omit-frame-pointer -fno-common",
"CMAKE_MAP_IMPORTED_CONFIG_SANITIZE": "Sanitize;RelWithDebInfo;Release;Debug;"
} }, {

@@ -146,15 +150,15 @@ }, { "name": "ci-macos",
"inherits": ["ci-build", "ci-darwin", "dev-mode", "ci-multi-config"]
"inherits": ["ci-build", "ci-darwin", "dev-mode", "ci-multi-config", "vcpkg"]
}, { "name": "ci-ubuntu",
"inherits": ["ci-build", "ci-linux", "clang-tidy", "cppcheck", "dev-mode"]
"inherits": ["ci-build", "ci-linux", "clang-tidy", "vcpkg", "cppcheck", "dev-mode"]
}, { "name": "ci-windows",
"inherits": ["ci-build", "ci-win64", "dev-mode", "ci-multi-config"]
"inherits": ["ci-build", "ci-win64", "dev-mode", "ci-multi-config", "vcpkg", "vcpkg-win64-static"]
} ] }

diff --git a/ CONTRIBUTING.md b/ CONTRIBUTING.md

@@ -4,7 +4,6 @@ Please see the [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md) document.
## Getting started Helpful notes for developers can be found in the [`HACKING.md`](HACKING.md)

diff --git a/ HACKING.md b/ HACKING.md

@@ -41,7 +41,7 @@ the project: { "name": "dev", "binaryDir": "${sourceDir}/build/dev",
"inherits": ["dev-mode", "ci-<os>"],
"inherits": ["dev-mode", "vcpkg", "ci-<os>"],
"cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" }

@@ -87,6 +87,17 @@ in the terminal. > in `Tools > Options > CMake` **prior to opening the project**, after which > you can manually configure using `Project > Configure Cache`.
### Dependency manager
The above preset will make use of the [vcpkg][vcpkg] dependency manager. After
installing it, make sure the `VCPKG_ROOT` environment variable is pointing at
the directory where the vcpkg executable is. On Windows, you might also want
to inherit from the `vcpkg-win64-static` preset, which will make vcpkg install
the dependencies as static libraries. This is only necessary if you don't want
to setup `PATH` to run tests.
[vcpkg]: https://github.com/microsoft/vcpkg
### Configure, build and test If you followed the above instructions, then you can configure, build and test

@@ -145,30 +156,5 @@ These targets run the codespell tool on the codebase to check errors and to fix them respectively. Customization available using the `SPELL_COMMAND` cache variable.
## Running tests on Windows with `BUILD_SHARED_LIBS=ON`
If you are building a shared library on Windows, you must add the path to the
DLL file to `PATH` when you want to run tests. One way you could do that is by
using PowerShell and writing a script for it, e.g. `env.ps1` at the project
root:
```powershell
$oldPrompt = (Get-Command prompt).ScriptBlock
function prompt() { "(Debug) $(& $oldPrompt)" }
$VsInstallPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -Property InstallationPath
$Env:Path += ";$VsInstallPath\Common7\IDE;$Pwd\build\dev\Debug"
```
Then you can source this script by running `. env.ps1`. This particular
example will only work for Debug builds.
### Passing `PATH` to editors
Make sure you launch your editor of choice from the console with the above
script sourced. Look for `(Debug)` in the prompt to confirm, then run e.g.
`code .` for VScode or `devenv .` for Visual Studio.
[1]: https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html [2]: https://cmake.org/download/

diff --git a/ README.md b/ README.md

@@ -22,18 +22,18 @@ be understood first, and later implemented. ## Dependencies
* CMake 3.25.2 or latter
* Compiler with C++20 support (tested: clang 16.0.5, gcc 13.2.0)
* CMake 3.14 or latter
* Compiler with C++20 support (tested on clang version 19.1.7)
## Building and installing
See the [BUILDING](BUILDING.md) document.
See the [`BUILDING`](BUILDING.md) document.
## Usage
> Please reference example folder for relevant usage example.
> Please reference example folder for relevant usage examples.
## Help

@@ -57,13 +57,12 @@ Refer to [GNU argp documentation](https://www.gnu.org/software/libc/manual/html_ ## Contributing
See the [CONTRIBUTING](CONTRIBUTING.md) document.
See the [`CONTRIBUTING`](CONTRIBUTING.md) document.
## License
This project is licensed under the MIT License -
see the [LICENSE](LICENSE.md) document for details
This project is licensed under the MIT License - see the [`LICENSE`](LICENSE.md) file for details
## Acknowledgments

diff --git a/ cmake/install-config.cmake b/ cmake/install-config.cmake

@@ -1,1 +1,3 @@
include(CMakeFindDependencyMacro)
include("${CMAKE_CURRENT_LIST_DIR}/poaflocTargets.cmake")

diff --git a/ vcpkg.json b/ vcpkg.json

@@ -0,0 +1,13 @@
{
"name": "poafloc",
"version-semver": "1.2.0",
"dependencies": [],
"default-features": [],
"features": {
"test": {
"description": "Dependencies for testing",
"dependencies": []
}
},
"builtin-baseline": "eba7c6a894fce24146af4fdf161fef8e90dd6be3"
}