Skip to content
Ruslan Baratov edited this page Apr 21, 2015 · 11 revisions

CMake variables

HUNTER_ENABLED

  • Turn on/off Hunter package manager. If this variable is OFF HunterGate module will do nothing, hunter_add_package command will have no effects. You can add this variable as option while experimenting to keep backward compatibility with old package manager:
option(HUNTER_ENABLED "Enable Hunter package manager" OFF)
HunterGate(...) # ignored
if(WITH_FOO)
  hunter_add_package(Foo) # ignored
  find_package(Foo) # found in standard location
endif()
  • Default: ON

HUNTER_ROOT

  • Path to Hunter root directory. Set this variable if you don't want to install Hunter packages to default location
  • See HunterGate

HUNTER_STATUS_PRINT

  • Print current build status
  • Default: ON

HUNTER_STATUS_DEBUG

  • Print a lot of info
  • Set this variable to ON before submitting bugs
  • Default: OFF

HUNTER_JOBS_NUMBER

  • Number of parallel builds that will be used in such native tools like make -jN or xcodebuild -jobs N
  • For Visual Studio flag /MP will be used
  • Set variable to 0 to disable adding any flags: HUNTER_JOBS_NUMBER=0
  • Default: NUMBER_OF_LOGICAL_CORES

HUNTER_RUN_INSTALL

  • Set this variable to ON to run auto-install procedure if it's disabled by HUNTER_DISABLE_AUTOINSTALL environment variable
  • See HUNTER_DISABLE_AUTOINSTALL

Environment variables

HUNTER_BINARY_DIR

  • Use external directory HUNTER_BINARY_DIR for building external projects. This variable can be used to fix "path too long" error on windows

HUNTER_DISABLE_AUTOINSTALL

  • Set this environment variable to non-empty value (e.g. HUNTER_DISABLE_AUTOINSTALL=ON) to disable automatic initialization of Hunter root directory by HunterGate module. This will give you more control in some advanced usage situations, see examples. Set HUNTER_RUN_INSTALL=ON CMake variable each time you want to run auto-install procedure. Note that there is no need to set any variables if Hunter root is already installed.

Clone this wiki locally