Repository navigation
example.custom.config.id
Ruslan Baratov edited this page Apr 22, 2015
·
5 revisions
Package version and extra CMake options can be set in user's config.cmake file.
- HunterGate
- hunter_config
- Custom build types (e.g. Release/Debug)
# CMakeLists.txt
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.8.10.tar.gz"
SHA1 "9308d01ea52c7b8cf1347073c982c679dbac3c09"
LOCAL # <----- Use local config.cmake
)
...
hunter_add_package(GTest)# cmake/Hunter/config.cmake
hunter_config(GTest VERSION 1.7.0-hunter-9)
hunter_config(ZLIB VERSION 1.2.8-hunter-1)# cmake/Hunter/config.cmake
hunter_config(GTest VERSION 1.7.0-hunter-9 CMAKE_ARGS GTEST_SUPER_MODE=ON)
hunter_config(ZLIB VERSION 1.2.8-hunter-1 CMAKE_ARGS ZLIB_FEATURES=FEATURE1;FEATURE2)If you set HUNTER_STATUS_DEBUG=ON you can see that options added to build:
-- [hunter *** DEBUG *** 2015-04-20T15:40:12] Add extra CMake args: 'GTEST_SUPER_MODE' = 'ON'
-- [hunter *** DEBUG *** 2015-04-20T15:40:12] Add package: GTest
-- [hunter *** DEBUG *** 2015-04-20T15:40:12] Download scheme: url_sha1_release_debug
-- [hunter *** DEBUG *** 2015-04-20T15:40:12] Url: https://github.com/hunter-packages/gtest/archive/v1.7.0-hunter-9.tar.gz
-- [hunter *** DEBUG *** 2015-04-20T15:40:12] SHA1: 8a47fe9c4e550f4ed0e2c05388dd291a059223d9
-- [hunter *** DEBUG *** 2015-04-20T15:40:54] Add extra CMake args: 'ZLIB_FEATURES' = 'FEATURE1'
-- [hunter *** DEBUG *** 2015-04-20T15:40:54] Add extra CMake args: 'ZLIB_FEATURES' += 'FEATURE2'
-- [hunter *** DEBUG *** 2015-04-20T15:40:54] Add package: ZLIB
-- [hunter *** DEBUG *** 2015-04-20T15:40:54] Download scheme: url_sha1_release_debug
-- [hunter *** DEBUG *** 2015-04-20T15:40:54] Url: https://github.com/hunter-packages/zlib/archive/v1.2.8-hunter-1.tar.gz
-- [hunter *** DEBUG *** 2015-04-20T15:40:54] SHA1: 24c89e4b193a56bb411fa9878968002ebe2c6209
Note that this file configured internally in Hunter. E.g. variable from config.cmake will not be visible in CMakeLists.txt:
# cmake/Hunter/config.cmake
hunter_config(GTest VERSION 1.7.0-hunter-9 CMAKE_ARGS GTEST_SUPER_MODE=ON)
set(HELLO_FROM_CONFIG "Hello")# CMakeLists.txt
HunterGate(...)
message("Config say: '${HELLO_FROM_CONFIG}'")> cmake -H. -B_builds
Config say: ''config.cmake is a usual CMake-code file, so such commands like if and global variables like WIN32 can be used:
if(WIN32)
hunter_config(GTest VERSION 1.7.0-hunter-9 CMAKE_ARGS GTEST_SUPER_MODE=ON)
endif()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.