hunter_cacheableΒΆ

This command will give permission to package so it can be saved in cache. Usually each root <hunter-id>/<toolchain-id>/<config-id> directory can be shared between unlimited number of projects but need to build from scratch every time. Binary cache allow to save builds in cache directory and share this cache between several <hunter-id>/<toolchain-id>/<config-id> roots. Note that all dependencies of this package and the package itself must be relocatable.

Example of hunter.cmake file:

# cmake/project/TIFF/hunter.cmake

include(hunter_add_version)
include(hunter_cacheable)
include(hunter_download)

hunter_add_version(...)

hunter_cacheable(TIFF)
hunter_download(PACKAGE_NAME TIFF)

Messages in logs:

  • successful build of cacheable package:
-- [hunter] Cache saved: /.../.hunter/_Base/Cache/raw/752c8b96f5613ee865c0cda5f3306d67e463a977.tar.bz2
  • successful cache look-up (reuse/unpacked from cache):
-- [hunter] Cache HIT: TIFF