From f6fd4b7c8a9933a5a323e3a7d04323fbb5d7885e Mon Sep 17 00:00:00 2001 From: tobtoht Date: Thu, 7 Jul 2022 17:35:08 +0200 Subject: [PATCH] Polyseed submodule --- .gitmodules | 3 +++ CMakeLists.txt | 3 +++ cmake/FindPolyseed.cmake | 9 +++++++-- src/third-party/polyseed | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) create mode 160000 src/third-party/polyseed diff --git a/.gitmodules b/.gitmodules index 6e4f896..2abd6f1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "src/third-party/singleapplication"] path = src/third-party/singleapplication url = https://github.com/itay-grudev/SingleApplication.git +[submodule "src/third-party/polyseed"] + path = src/third-party/polyseed + url = https://github.com/tevador/polyseed.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 27356e2..2f5940e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,6 +79,9 @@ add_subdirectory(contrib/monero-seed) # Polyseed 16 word mnemonic seeds find_package(Polyseed REQUIRED) +if(Polyseed_SUBMODULE) + add_subdirectory(src/third-party/polyseed) +endif() # libzip find_package(zlib CONFIG) diff --git a/cmake/FindPolyseed.cmake b/cmake/FindPolyseed.cmake index aa00788..7879ff3 100644 --- a/cmake/FindPolyseed.cmake +++ b/cmake/FindPolyseed.cmake @@ -1,5 +1,10 @@ find_path(POLYSEED_INCLUDE_DIR polyseed.h) -message(STATUS "POLYSEED PATH ${POLYSEED_INCLUDE_DIR}") - find_library(POLYSEED_LIBRARY polyseed) +if (NOT POLYSEED_INCLUDE_DIR OR NOT POLYSEED_LIBRARY) + MESSAGE(STATUS "Could not find installed Polyseed, using submodule instead") + set(Polyseed_SUBMODULE "ON") + set(POLYSEED_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src/third-party/polyseed/include) + set(POLYSEED_LIBRARY polyseed) +endif() +message(STATUS "POLYSEED PATH ${POLYSEED_INCLUDE_DIR}") message(STATUS "POLYSEED LIBARY ${POLYSEED_LIBRARY}") \ No newline at end of file diff --git a/src/third-party/polyseed b/src/third-party/polyseed new file mode 160000 index 0000000..e385165 --- /dev/null +++ b/src/third-party/polyseed @@ -0,0 +1 @@ +Subproject commit e38516561c647522e2e2608f13eabdeab61d9a5d