From 528f4480aa7d9675a2e79078ea0e97e2e60ad6c2 Mon Sep 17 00:00:00 2001 From: tastytea Date: Sat, 11 Jun 2022 08:30:44 +0200 Subject: [PATCH] Use FetchContent for identiconpp --- .drone.yml | 6 ------ .gitmodules | 3 --- CMakeLists.txt | 20 ++++++++++++++++++-- dist/identiconpp | 1 - 4 files changed, 18 insertions(+), 12 deletions(-) delete mode 160000 dist/identiconpp diff --git a/.drone.yml b/.drone.yml index 537603f..10d76e9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -13,12 +13,6 @@ trigger: - tag steps: -- name: submodules - image: docker:git - commands: - - git submodule init - - git submodule update --recursive - - name: GCC 8 / clang 7 image: debian:buster-slim pull: always diff --git a/.gitmodules b/.gitmodules index 37d2fa6..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "dist/identiconpp"] - path = dist/identiconpp - url = https://schlomp.space/tastytea/identiconpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 4759c41..f1d1353 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,9 +27,25 @@ if(NOT libcryptopp_FOUND) pkg_check_modules(libcryptopp REQUIRED IMPORTED_TARGET libcrypto++) endif() if (LIBRAVATAR_BUNDLED_IDENTICONPP) - add_subdirectory(dist/identiconpp) + include(FetchContent) + FetchContent_Declare(identiconpp + GIT_REPOSITORY https://schlomp.space/tastytea/identiconpp.git + GIT_TAG 0.7.3 + ) + if (NOT CMAKE_VERSION VERSION_LESS 3.14) + FetchContent_MakeAvailable(identiconpp) + else() + FetchContent_GetProperties(identiconpp) + if(NOT identiconpp_POPULATED) + FetchContent_Populate(identiconpp) + add_subdirectory(${identiconpp_SOURCE_DIR} ${identiconpp_BINARY_DIR}) + endif() +endif() + + add_library(identiconpp::identiconpp ALIAS identiconpp) +else() + find_package(identiconpp REQUIRED CONFIG) endif() -find_package(identiconpp REQUIRED CONFIG) find_package(Filesystem REQUIRED COMPONENTS Final Experimental) diff --git a/dist/identiconpp b/dist/identiconpp deleted file mode 160000 index 9070f15..0000000 --- a/dist/identiconpp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9070f154a462abab5edca7b9050ce4f4893d3999