Repository navigation
error.huntergate.before.project
Ruslan Baratov edited this page Mar 8, 2016
·
4 revisions
- CMake fatal error with message:
[hunter ** FATAL ERROR **] Please set HunterGate *before* project command
- Hunter designed to set some internal stuff like
CMAKE_CXX_COMPILER. Such variables must be modified beforeprojectcommand to work correctly
- In general sequence must looks like this (see also error.hunteraddpackage.after.project):
# 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 (must exist, see note below)
project(Foo)
# Use hunter_add_package after project command
hunter_add_package(Boo)- Note that if there is no
projectcommand inCMakeLists.txtthen CMake will setPROJECT_NAMEtoProjectwhich is same side-effect as callingproject(Project)beforeHunterGate. It means there must be at least oneprojectcall inCMakeLists.txt(which usually quite normal requirement). Related: https://github.com/ruslo/hunter/issues/285. Quite the same will happen ifprojectcommand is in subdirectory so next code will not work too:
# CMakeLists.txt
cmake_minimum_required(VERSION 3.0)
include("cmake/HunterGate.cmake")
HunterGate(URL ... SHA1 ...)
add_subdirectory(subdir1)# subdir1/CMakeLists.txt
project(Foo)Fix is to place project in top CMakeLists.txt before add_subdirectory:
# CMakeLists.txt
cmake_minimum_required(VERSION 3.0)
include("cmake/HunterGate.cmake")
HunterGate(URL ... SHA1 ...)
project(Foo) # <--------------- before add_subdirectory
add_subdirectory(subdir1)Feel free to open new issue if you want to ask any questions.
- HOME
- Packages
- Android-Apk
- Android-Modules
- Android-SDK
- ArrayFire
- Assimp
- Async++
- Avahi
- BZip2
- Boost
- Boost.compute
- Boost.process
- CLAPACK
- Comet
- CppNetlib.URI
- CsvParserCPlusPlus
- Eigen
- Expat
- GPUImage
- GSL
- GTest
- GMock
- Igloo
- IntSizeof
- Jpeg
- JsonSpirit
- LLVM (Clang)
- Leathers
- Libssh2
- Lua
- MySQL-client
- nlohmann::json
- OpenCV
- OpenSSL
- PNG
- Poco C++
- PostgreSQL
- Protobuf
- Qt
- Qt-Android-CMake
- QtQmlManager
- RapidJSON
- Sugar
- TIFF
- Washer
- WTL
- ZeroMQ
- ZMQPP
- ZLIB
- rabbitmq-c
- sparsehash
- ccv
- cereal
- convertutf
- crashpad
- cvmatio
- dest
- dlib
- eos
- flatbuffers
- fmt
- freetype
- glm
- glog
- half
- hdf5
- ios_sim
- irrXML
- libyuv
- log4cplus
- minizip
- odb-pgsql
- odb-mysql
- ogles_gpgpu
- openddlparser
- poly2tri
- polyclipping
- spdlog
- szip
- thread-pool-cpp
- tinydir
- websocketpp
- msgpack
- wxWidgets
- xgboost
Don't see packages you need? Feel free to leave a package request.