cmake: Add Findrhash.cmake
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9540 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 95341c293c88b1d8d45e351336983b3b152b238d Former-commit-id: c834c4137793fb5d7e4e22ede64bf02c4e8686d0
This commit is contained in:
parent
5e72503eb1
commit
f7dd89b2ad
1 changed files with 39 additions and 0 deletions
39
cmake/Findrhash.cmake
Normal file
39
cmake/Findrhash.cmake
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
# Copyright (C) 2024 Xavier Del Campo Romero
|
||||||
|
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||||
|
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||||
|
|
||||||
|
find_path(rhash_INCLUDE_DIRS
|
||||||
|
NAMES
|
||||||
|
rhash.h
|
||||||
|
rhash_torrent.h
|
||||||
|
HINTS
|
||||||
|
ENV rhash_PATH
|
||||||
|
PATH_SUFFIXES
|
||||||
|
include
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(rhash_LIBRARIES
|
||||||
|
NAMES
|
||||||
|
rhash
|
||||||
|
HINTS
|
||||||
|
ENV rhash_PATH
|
||||||
|
PATH_SUFFIXES
|
||||||
|
lib
|
||||||
|
)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
|
find_package_handle_standard_args(rhash
|
||||||
|
REQUIRED_VARS
|
||||||
|
rhash_LIBRARIES rhash_INCLUDE_DIRS
|
||||||
|
)
|
||||||
|
|
||||||
|
if(rhash_FOUND)
|
||||||
|
if(NOT TARGET rhash::rhash)
|
||||||
|
add_library(rhash::rhash INTERFACE IMPORTED)
|
||||||
|
target_include_directories(rhash::rhash
|
||||||
|
INTERFACE "${rhash_INCLUDE_DIRS}")
|
||||||
|
set_target_properties(rhash::rhash PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${rhash_LIBRARIES}")
|
||||||
|
endif()
|
||||||
|
endif()
|
Loading…
Reference in a new issue