Skip to content

Helpful CMake modules for project management and export

License

Notifications You must be signed in to change notification settings

LecrisUT/CMakeExtraUtils

Repository files navigation

CMakeExtraUtils

Extra utilities for cmake:

Installation

These utilities can be included using both find_package() and ExternalProject, e.g. if CMakeExtraUtils is already installed on your system:

cmake_minimum_required(VERSION 3.20)

find_package(CMakeExtraUtils REQUIRED)

include(DynamicVersion)
dynamic_version()

project(MyProject
        VERSION ${PROJECT_VERSION})

or if you want to download a specific version:

cmake_minimum_required(VERSION 3.20)

FetchContet_Declare(CMakeExtraUtils
        GIT_REPOSITORY https://github.com/LecriUT/CMakeExtraUtils
        GIT_TAG v0.1.1)
FetchContent_MakeAvailable(CMakeExtraUtils)

include(DynamicVersion)
dynamic_version()

project(MyProject
        VERSION ${PROJECT_VERSION})

TODO for v1.0

  • Automation:
  • Add simple pre-commit and pyproject.toml environment
  • Fix DynamicVersion to work with buildable projects
  • Test coverage:
    • DynamicVersion
    • PackageComps