Skip to content

Commit 9fd934e

Browse files
committed
[PR 128] CMake: Add Findcppcodec.cmake for building without Hunter
1 parent 78668af commit 9fd934e

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

cmake/dependencies.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# hunter dependencies
22
# https://docs.hunter.sh/en/latest/packages/
33

4+
# Append local modules path if Hunter is not enabled
5+
if (NOT HUNTER_ENABLED)
6+
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)
7+
endif()
8+
49
if (TESTING)
510
# https://docs.hunter.sh/en/latest/packages/pkg/GTest.html
611
hunter_add_package(GTest)
@@ -45,4 +50,4 @@ find_package(libp2p CONFIG REQUIRED)
4550

4651
# https://docs.hunter.sh/en/latest/packages/pkg/cppcodec.html
4752
hunter_add_package(cppcodec)
48-
find_package(cppcodec CONFIG REQUIRED)
53+
find_package(cppcodec REQUIRED)

cmake/modules/Findcppcodec.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Try to find cppcodec
2+
# Once done, this will define
3+
#
4+
# CPPCODEC_FOUND - system has cppcodec
5+
6+
find_package(PkgConfig)
7+
if (PKG_CONFIG_FOUND)
8+
pkg_check_modules(CPPCODEC cppcodec)
9+
endif()

0 commit comments

Comments
 (0)