# Loco-Utils
A small set of C/C++ helper functions and macros that I used alongside various
projects related to the `Loco` framework I'm currently developing.
## Build Status
| Build | Status
| ------- | ------------------------------
| Ubuntu | [![ci-linux][0]][1] |
| Windows | [![ci-windows][2]][3] |
| MacOS | [![ci-macos][4]][5] |
## How to Use
This is a `CMake` based project, and all dependencies are managed by this tool
itself (i.e., we make use of `FetchContent`), so no additional dependencies have
to be installed. So, there are two ways you can use this project alongside yours:
* Include via `add_subdirectory`: This is the quickest way to integrate the
project alongside yours. You'll have to download the source code to some folder
either by cloning the repo, or by adding it as a `git-submodule`. Either way,
let's say you placed the source into `SOME_FOLDER/loco_utils`. Then you'll just
have to do the following in some part of your CMake setup:
```cmake
# On some part of your CMake configuration rules
add_subdirectory(SOME_FOLDER/loco_utils)
```
* Get it via `FetchContent`: This is an option that doesn't require for you to
directly clone or link the repo. You can use `FetchContent` and `FetchContent_MakeAvailable`
to add this project directly into your CMake build workflow, as shown below:
```cmake
# Set where to place source-code and where to place binaries/logs
set(SOME_SRC_PATH "Some-source-path-here")
set(SOME_BUILD_PATH "Some-build-path-here")
# Define some extra cmake-args to pass to this project (loco_utils)
set(SOME_CMAKE_ARGS "-DLOCOUTILS_BUILD_EXAMPLES=OFF -DLOCOUTILS_BUILD_DOCS=OFF")
# On some part where you setup third-party dependencies
FetchContent(loco_utils
GIT_REPOSITORY "https://github.com/wpumacay/loco_utils.git"
GIT_PROGRESS TRUE
USES_TERMINAL_DOWNLOAD TRUE
PREFIX "${SOME_SRC_PATH}/loco_utils"
DOWNLOAD_DIR "${SOME_SRC_PATH}/loco_utils"
SOURCE_DIR "${SOME_SRC_PATH}/loco_utils/source"
BINARY_DIR "${SOME_BUILD_PATH}/loco_utils/build"
STAMP_DIR "${SOME_BUILD_PATH}/loco_utils/stamp"
TMP_DIR "${SOME_BUILD_PATH}/loco_utils/tmp"
CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release
-DCMAKE_GENERATOR=${CMAKE_GENERATOR}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
-DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR}
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
-DCMAKE_INSTALL_DOCDIR=${CMAKE_INSTALL_DOCDIR}
-DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR}
-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
${SOME_CMAKE_ARGS}
BUILD_ALWAYS OFF)
```
* Install and use `find_package`: This last option is not available yet, but once
we add the install rules for the CMake project, you'll be able to just **install**
the library into your system, import it using **find_package**, and **linking**
using the exposed `LocoUtilsCpp` target, as shown below:
* *Installing the project*
```shell
mkdir build
cmake -S . -B build
cmake --build build
cmake --install build
```
* *Including using `find_package`*
```cmake
# Locate the installed project using find_package()
find_package(LocoUtils REQUIRED)
```
## Install the Python bindings
There are some Python bindings (generated using Pybind11), which you can install
using the provided `setup.py` script. Just run either `python setup.py install`,
or `pip install --verbose .` (add verbose just to check if everything went well)
```shell
# Install python bindings
# Option-1
python setup.py install
# Option-2
pip install --verbose .
```
---
[0]: <https://github.com/wpumacay/loco_utils/actions/workflows/ci-linux.yml/badge.svg> (ci-linux-badge)
[1]: <https://github.com/wpumacay/loco_utils/actions/workflows/ci-linux.yml> (ci-linux-status)
[2]: <https://github.com/wpumacay/loco_utils/actions/workflows/ci-windows.yml/badge.svg> (ci-windows-badge)
[3]: <https://github.com/wpumacay/loco_utils/actions/workflows/ci-windows.yml> (ci-windows-status)
[4]: <https://github.com/wpumacay/loco_utils/actions/workflows/ci-macos.yml/badge.svg> (ci-macos-badge)
[5]: <https://github.com/wpumacay/loco_utils/actions/workflows/ci-macos.yml> (ci-macos-status)
Raw data
{
"_id": null,
"home_page": "https://github.com/wpumacay/tiny_utils",
"name": "wp-utils",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "C C++ Utils",
"author": "Wilbert Santos Pumacay Huallpa",
"author_email": "wpumacay@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/fb/58/f1183d2748ef5eef54bae9508b9a7872ee9dcf68d9aeeb02c17cbfa75fe9/wp_utils-0.2.12.tar.gz",
"platform": null,
"description": "# Loco-Utils\n\nA small set of C/C++ helper functions and macros that I used alongside various\nprojects related to the `Loco` framework I'm currently developing.\n\n## Build Status\n\n| Build | Status\n| ------- | ------------------------------\n| Ubuntu | [![ci-linux][0]][1] |\n| Windows | [![ci-windows][2]][3] |\n| MacOS | [![ci-macos][4]][5] |\n\n## How to Use\n\nThis is a `CMake` based project, and all dependencies are managed by this tool\nitself (i.e., we make use of `FetchContent`), so no additional dependencies have\nto be installed. So, there are two ways you can use this project alongside yours:\n\n* Include via `add_subdirectory`: This is the quickest way to integrate the\n project alongside yours. You'll have to download the source code to some folder\n either by cloning the repo, or by adding it as a `git-submodule`. Either way,\n let's say you placed the source into `SOME_FOLDER/loco_utils`. Then you'll just\n have to do the following in some part of your CMake setup:\n\n ```cmake\n # On some part of your CMake configuration rules\n add_subdirectory(SOME_FOLDER/loco_utils)\n ```\n\n* Get it via `FetchContent`: This is an option that doesn't require for you to\n directly clone or link the repo. You can use `FetchContent` and `FetchContent_MakeAvailable`\n to add this project directly into your CMake build workflow, as shown below:\n\n ```cmake\n # Set where to place source-code and where to place binaries/logs\n set(SOME_SRC_PATH \"Some-source-path-here\")\n set(SOME_BUILD_PATH \"Some-build-path-here\")\n # Define some extra cmake-args to pass to this project (loco_utils)\n set(SOME_CMAKE_ARGS \"-DLOCOUTILS_BUILD_EXAMPLES=OFF -DLOCOUTILS_BUILD_DOCS=OFF\")\n # On some part where you setup third-party dependencies\n FetchContent(loco_utils\n GIT_REPOSITORY \"https://github.com/wpumacay/loco_utils.git\"\n GIT_PROGRESS TRUE\n USES_TERMINAL_DOWNLOAD TRUE\n PREFIX \"${SOME_SRC_PATH}/loco_utils\"\n DOWNLOAD_DIR \"${SOME_SRC_PATH}/loco_utils\"\n SOURCE_DIR \"${SOME_SRC_PATH}/loco_utils/source\"\n BINARY_DIR \"${SOME_BUILD_PATH}/loco_utils/build\"\n STAMP_DIR \"${SOME_BUILD_PATH}/loco_utils/stamp\"\n TMP_DIR \"${SOME_BUILD_PATH}/loco_utils/tmp\"\n CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release\n -DCMAKE_GENERATOR=${CMAKE_GENERATOR}\n -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}\n -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}\n -DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR}\n -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}\n -DCMAKE_INSTALL_DOCDIR=${CMAKE_INSTALL_DOCDIR}\n -DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR}\n -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}\n ${SOME_CMAKE_ARGS}\n BUILD_ALWAYS OFF)\n ```\n\n* Install and use `find_package`: This last option is not available yet, but once\n we add the install rules for the CMake project, you'll be able to just **install**\n the library into your system, import it using **find_package**, and **linking**\n using the exposed `LocoUtilsCpp` target, as shown below:\n\n * *Installing the project*\n\n ```shell\n mkdir build\n cmake -S . -B build\n cmake --build build\n cmake --install build\n ```\n\n * *Including using `find_package`*\n\n ```cmake\n # Locate the installed project using find_package()\n find_package(LocoUtils REQUIRED)\n ```\n\n## Install the Python bindings\n\nThere are some Python bindings (generated using Pybind11), which you can install\nusing the provided `setup.py` script. Just run either `python setup.py install`,\nor `pip install --verbose .` (add verbose just to check if everything went well)\n\n```shell\n # Install python bindings\n # Option-1\n python setup.py install\n # Option-2\n pip install --verbose .\n```\n\n---\n\n[0]: <https://github.com/wpumacay/loco_utils/actions/workflows/ci-linux.yml/badge.svg> (ci-linux-badge)\n[1]: <https://github.com/wpumacay/loco_utils/actions/workflows/ci-linux.yml> (ci-linux-status)\n[2]: <https://github.com/wpumacay/loco_utils/actions/workflows/ci-windows.yml/badge.svg> (ci-windows-badge)\n[3]: <https://github.com/wpumacay/loco_utils/actions/workflows/ci-windows.yml> (ci-windows-status)\n[4]: <https://github.com/wpumacay/loco_utils/actions/workflows/ci-macos.yml/badge.svg> (ci-macos-badge)\n[5]: <https://github.com/wpumacay/loco_utils/actions/workflows/ci-macos.yml> (ci-macos-status)\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "A small C/C++ helper library",
"version": "0.2.12",
"project_urls": {
"Homepage": "https://github.com/wpumacay/tiny_utils"
},
"split_keywords": [
"c",
"c++",
"utils"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "fb58f1183d2748ef5eef54bae9508b9a7872ee9dcf68d9aeeb02c17cbfa75fe9",
"md5": "7c698e6c8036bccb21acb70c775db34c",
"sha256": "248dbff921f7584d4d435b778e57a6b74dc72f9df85bfb2e8ecf325c2d63e467"
},
"downloads": -1,
"filename": "wp_utils-0.2.12.tar.gz",
"has_sig": false,
"md5_digest": "7c698e6c8036bccb21acb70c775db34c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 30244,
"upload_time": "2024-11-24T22:34:45",
"upload_time_iso_8601": "2024-11-24T22:34:45.421469Z",
"url": "https://files.pythonhosted.org/packages/fb/58/f1183d2748ef5eef54bae9508b9a7872ee9dcf68d9aeeb02c17cbfa75fe9/wp_utils-0.2.12.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-24 22:34:45",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "wpumacay",
"github_project": "tiny_utils",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "setuptools",
"specs": []
},
{
"name": "pytest",
"specs": []
}
],
"lcname": "wp-utils"
}