From 658312c30de0d0a72f0b36f51e17e23591403d58 Mon Sep 17 00:00:00 2001 From: Dmitriy Khaustov Date: Tue, 7 Apr 2020 21:35:12 +0300 Subject: [PATCH] Change cmake-files for using internal fork of Hunter package manager (#68) Change cmake-files for using internal fork of Hunter package manager Signed-off-by: Dmitriy Khaustov aka xDimon Co-authored-by: Yura Zarudniy --- CMakeLists.txt | 3 ++- cmake/Hunter/config.cmake | 48 +++++---------------------------------- cmake/Hunter/init.cmake | 8 ++++--- cmake/dependencies.cmake | 4 ++-- 4 files changed, 15 insertions(+), 48 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b88f614..cdb5f2ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,8 @@ set(CMAKE_TOOLCHAIN_FILE ) include("cmake/Hunter/init.cmake") -project(libp2p C CXX) +cmake_policy(SET CMP0048 NEW) +project(libp2p VERSION 0.0.1 LANGUAGES C CXX) include(cmake/print.cmake) print("C flags: ${CMAKE_C_FLAGS}") diff --git a/cmake/Hunter/config.cmake b/cmake/Hunter/config.cmake index 6de17440..09e8f98d 100644 --- a/cmake/Hunter/config.cmake +++ b/cmake/Hunter/config.cmake @@ -1,42 +1,6 @@ -hunter_config( - Boost - VERSION 1.70.0-p0 -) - -hunter_config(GSL - URL https://github.com/microsoft/GSL/archive/v2.0.0.tar.gz - SHA1 9bbdea551b38d7d09ab7aa2e89b91a66dd032b4a - CMAKE_ARGS GSL_TEST=OFF - ) - -hunter_config( - GTest - VERSION 1.8.0-hunter-p11 - CMAKE_ARGS "CMAKE_CXX_FLAGS=-Wno-deprecated-copy" -) - -hunter_config( - spdlog - URL https://github.com/gabime/spdlog/archive/v1.4.2.zip - SHA1 4b10e9aa17f7d568e24f464b48358ab46cb6f39c -) - -hunter_config( - tsl_hat_trie - URL https://github.com/masterjedy/hat-trie/archive/343e0dac54fc8491065e8a059a02db9a2b1248ab.zip - SHA1 7b0051e9388d629f382752dd6a12aa8918cdc022 -) - -hunter_config( - Boost.DI - URL https://github.com/masterjedy/di/archive/c5287ee710ad90f5286d0cc2b9e49b72d89267a6.zip - SHA1 802b64a6242be45771f3d4c86257eac0a3c7b289 - # disable building examples and tests, disable testing - CMAKE_ARGS BOOST_DI_OPT_BUILD_TESTS=OFF BOOST_DI_OPT_BUILD_EXAMPLES=OFF -) - -hunter_config( - SQLiteModernCpp - URL https://github.com/soramitsu/libp2p-sqlite-modern-cpp/archive/fc3b700064cb57ab6b598c9bc7a12b2842f78da2.zip - SHA1 d913f2a0360892a30bc7cd8820a0475800b47d76 -) +## Template for add custom hunter config +#hunter_config( +# package-name +# VERSION 0.0.0-package-version +# CMAKE_ARGS "CMAKE_VARIABLE=value" +#) diff --git a/cmake/Hunter/init.cmake b/cmake/Hunter/init.cmake index d2c806d1..daf99093 100644 --- a/cmake/Hunter/init.cmake +++ b/cmake/Hunter/init.cmake @@ -7,6 +7,9 @@ string(COMPARE EQUAL "$ENV{GITHUB_HUNTER_USERNAME}" "" username_is_empty) if (NOT password_is_empty AND NOT username_is_empty) option(HUNTER_RUN_UPLOAD "Upload cache binaries" YES) message("Binary cache uploading is ENABLED.") +else() + option(HUNTER_RUN_UPLOAD "Upload cache binaries" NO) + message("Binary cache uploading is DISABLED.") endif () set( @@ -25,11 +28,10 @@ set( "Binary cache server" ) - include(${CMAKE_CURRENT_LIST_DIR}/HunterGate.cmake) HunterGate( - URL "https://github.com/cpp-pm/hunter/archive/v0.23.216.tar.gz" - SHA1 "a492a1879bee60c29f7af17ef56b45f0d7766241" + URL "https://github.com/soramitsu/soramitsu-hunter/archive/v0.23.253-soramitsu1.tar.gz" + SHA1 2b8e570843e8b6a0c96d70a8d312dda425fa52a9 LOCAL ) diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake index 3dfa6d03..e9eb5b62 100644 --- a/cmake/dependencies.cmake +++ b/cmake/dependencies.cmake @@ -5,10 +5,10 @@ find_package(GMock CONFIG REQUIRED) # https://docs.hunter.sh/en/latest/packages/pkg/Boost.html hunter_add_package(Boost COMPONENTS random filesystem program_options) -find_package(Boost CONFIG REQUIRED random filesystem program_options) +find_package(Boost CONFIG REQUIRED random filesystem program_options) # added from hunter_config -hunter_add_package(GSL) +hunter_add_package(Microsoft.GSL) # https://www.openssl.org/ hunter_add_package(OpenSSL)