From bdf895ae9e31aa2e2c4686655dfc787979f823d9 Mon Sep 17 00:00:00 2001 From: Alexey Rybalchenko Date: Thu, 4 Jun 2020 20:29:30 +0200 Subject: [PATCH] Add PicoSHA2 dependency --- CMakeLists.txt | 2 ++ cmake/FairMQLib.cmake | 2 ++ cmake/FindPicoSHA2.cmake | 21 +++++++++++++++++++++ fairmq/CMakeLists.txt | 2 ++ 4 files changed, 27 insertions(+) create mode 100644 cmake/FindPicoSHA2.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 6661b2b5..ef4cd28c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -146,6 +146,8 @@ if(BUILD_FAIRMQ) find_package2(PRIVATE ZeroMQ REQUIRED VERSION 4.1.4 ) + build_bundled(PicoSHA2 extern/PicoSHA2) + find_package2(PRIVATE PicoSHA2 REQUIRED) endif() if(BUILD_TESTING) diff --git a/cmake/FairMQLib.cmake b/cmake/FairMQLib.cmake index f32778fa..386a0492 100644 --- a/cmake/FairMQLib.cmake +++ b/cmake/FairMQLib.cmake @@ -498,6 +498,8 @@ function(build_bundled package bundle) set(${package}_BUILD_INCLUDE_DIR ${${package}_SOURCE_DIR}/asio/include CACHE PATH "Bundled ${package} build-interface include dir") set(${package}_INSTALL_INCLUDE_DIR ${PROJECT_INSTALL_INCDIR}/bundled CACHE PATH "Bundled ${package} install-interface include dir") set(${package}_ROOT ${${package}_SOURCE_DIR}/asio) + elseif(${package} STREQUAL PicoSHA2) + set(${package}_ROOT ${${package}_SOURCE_DIR}) endif() string(TOUPPER ${package} package_upper) diff --git a/cmake/FindPicoSHA2.cmake b/cmake/FindPicoSHA2.cmake new file mode 100644 index 00000000..3f7e15f6 --- /dev/null +++ b/cmake/FindPicoSHA2.cmake @@ -0,0 +1,21 @@ +################################################################################ +# Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # +# # +# This software is distributed under the terms of the # +# GNU Lesser General Public Licence (LGPL) version 3, # +# copied verbatim in the file "LICENSE" # +################################################################################ + +find_path(PicoSHA2_INCLUDE_DIR NAMES picosha2.h) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(PicoSHA2 + REQUIRED_VARS PicoSHA2_INCLUDE_DIR +) + +if(PicoSHA2_FOUND) + add_library(PicoSHA2 INTERFACE IMPORTED) + set_target_properties(PicoSHA2 PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${PicoSHA2_INCLUDE_DIR}" + ) +endif() diff --git a/fairmq/CMakeLists.txt b/fairmq/CMakeLists.txt index 6050903a..af16d8b6 100644 --- a/fairmq/CMakeLists.txt +++ b/fairmq/CMakeLists.txt @@ -325,6 +325,7 @@ if(BUILD_FAIRMQ) PRIVATE # only libFairMQ links against private dependencies libzmq + PicoSHA2 ${OFI_DEPS} ) set_target_properties(${_target} PROPERTIES @@ -377,6 +378,7 @@ if(BUILD_FAIRMQ) Boost::boost Boost::date_time Boost::program_options + PicoSHA2 ) target_include_directories(fairmq-shmmonitor PUBLIC $