Skip to content

error.huntergate.before.project

Ruslan Baratov edited this page Jun 29, 2015 · 4 revisions
What happens
  • CMake fatal error with message: [hunter ** FATAL ERROR **] Please set HunterGate *before* project command
Explanation
  • Hunter designed to set some internal stuff like CMAKE_CXX_COMPILER. Such variables must be modified before project command to work correctly
What to do
# Check CMake version before any commands
cmake_minimum_required(VERSION 3.0)

# Load HunterGate module
include("cmake/HunterGate.cmake")

# Use HunterGate module before first `project` command
HunterGate(
    URL ...
    SHA1 ...
)

# Your project
project(Foo)

# Use hunter_add_package after project command
hunter_add_package(Boo)

Clone this wiki locally