Skip to main content

A small C/C++ helper library

Project description

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
Windows ci-windows
MacOS ci-macos

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:

      # 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:

      # 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
      mkdir build
      cmake -S . -B build
      cmake --build build
      cmake --install build
    
    • Including using find_package
      # 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)

  # Install python bindings
  # Option-1
  python setup.py install
  # Option-2
  pip install --verbose .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wp_utils-0.2.13.tar.gz (30.3 kB view details)

Uploaded Source

File details

Details for the file wp_utils-0.2.13.tar.gz.

File metadata

  • Download URL: wp_utils-0.2.13.tar.gz
  • Upload date:
  • Size: 30.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for wp_utils-0.2.13.tar.gz
Algorithm Hash digest
SHA256 01f8b91ba35c91e7b8975218baa582e19ca7e0dba0e17bea19a73c53250fa772
MD5 61b09c1e52ee74708418caae2b8afb7e
BLAKE2b-256 49b3489d5de9a66b40c0dfd7522536c5afc2528836ca857b942cae70ce72fabb

See more details on using hashes here.

Provenance

The following attestation bundles were made for wp_utils-0.2.13.tar.gz:

Publisher: cd-sdist-pypi.yml on wpumacay/utils

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page