Giter Club home page Giter Club logo

hunter-simple's Introduction

Linux/OSX Windows
TravisCI AppVeyor

Example of downloading/installing dependencies using Hunter package manager.

Requirements

Usage

  • Set HUNTER_ROOT environment variable (recommended, see alternatives)
  • Generate project: cmake -H. -B_builds -DHUNTER_STATUS_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug
  • Run build: cmake --build _builds --config Debug
  • Run test: cd _builds && ctest -C Debug -VV

Output

  • Download starts in HUNTER_ROOT directory:
-- [hunter] Initializing Hunter workspace (0ccc3f3fd571676a1804723984598f9f90a4d6bc)
-- [hunter]   https://github.com/ruslo/hunter/archive/v0.12.40.tar.gz
-- [hunter]   -> /home/travis/.hunter/_Base/Download/Hunter/0.12.40/0ccc3f3
  • After download done cmake variable HUNTER_ROOT set:
-- [hunter] HUNTER_ROOT: /home/travis/.hunter
-- [hunter] GTEST_ROOT: /home/travis/.hunter/_Base/0ccc3f3/b874e31/3ef6df8/Install (ver.: 1.7.0-hunter-11)
  • If local configuration match binary cache from server then it will be used without building from sources:
https://raw.githubusercontent.com/ingenue/hunter-cache/.../cache.sha1
  -> /home/travis/.hunter/_Base/Cache/meta/.../cache.sha1
Cache HIT: GTest
https://github.com/ingenue/hunter-cache/.../da62fc35901e07d30db7a1c19b7358855978e11f.tar.bz2
  -> /home/travis/.hunter/_Base/Cache/raw/da62fc35901e07d30db7a1c19b7358855978e11f.tar.bz2

Note: since cache uploaded from Travis/AppVeyor CI hence configuration will always match.

Usage (toolchains)

Build functionality can be extended using toolchains:

  • Download toolchains archive (unix-style):
> export POLLY_VERSION="0.9.0"
> wget "https://github.com/ruslo/polly/archive/v${POLLY_VERSION}.tar.gz"
> tar xf "v${POLLY_VERSION}.tar.gz"
> export POLLY_ROOT="`pwd`/polly-${POLLY_VERSION}" # not needed in general
> export PATH="${POLLY_ROOT}/bin:${PATH}"
  • Now build.py python3 script from ${POLLY_ROOT}/bin directory can be used to start for example Xcode project:
> build.py --toolchain xcode --open --nobuild --verbose

This script equivalent to:

> cmake -H. -B_builds/xcode -DHUNTER_STATUS_DEBUG=ON -DCMAKE_TOOLCHAIN_FILE=${POLLY_ROOT}/xcode.cmake -GXcode
> open _builds/xcode/HunterSimple.xcodeproj

Check GTest directories:

/home/travis/.hunter/_Base/0ccc3f3/b874e31/3ef6df8/Install # install directory
/home/travis/.hunter/_Base/Download/GTest/1.7.0-hunter-11/c6ae948/ # path to downloaded archive

For building with iOS need to be used patched version of CMake

More

hunter-simple's People

Contributors

ruslo avatar

Watchers

Tomas Korcak avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.