mirror of
https://github.com/eosswedenorg/antelope-keygen
synced 2026-07-03 11:53:41 +02:00
CMakeModules/libeoskeygen.cmake: adding find_package() and use git repo as fallback.
This commit is contained in:
parent
fc00d97d40
commit
a9a45363df
1 changed files with 16 additions and 10 deletions
|
|
@ -8,18 +8,24 @@ if(CUSTOM_LIBEOSKEYGEN)
|
||||||
include(${CUSTOM_LIBEOSKEYGEN}/libeoskeygenTargets.cmake)
|
include(${CUSTOM_LIBEOSKEYGEN}/libeoskeygenTargets.cmake)
|
||||||
else()
|
else()
|
||||||
|
|
||||||
# TODO: find_package() here if libeoskeygen is installed on the system.
|
set( LIBEOSKEYGEN_WANTED_VERSION 0.1.0 )
|
||||||
# otherwise we will download with FetchContent.
|
|
||||||
|
|
||||||
message ("Using libeoskeygen from: https://github.com/eosswedenorg/libeoskeygen.git")
|
# Try finding the package on the system.
|
||||||
|
find_package(libeoskeygen ${LIBEOSKEYGEN_WANTED_VERSION} QUIET)
|
||||||
|
if (libeoskeygen_FOUND)
|
||||||
|
message ("Using libeoskeygen in: ${libeoskeygen_DIR}")
|
||||||
|
# Not found, download from git.
|
||||||
|
else()
|
||||||
|
message ("Using libeoskeygen from: https://github.com/eosswedenorg/libeoskeygen.git@v${LIBEOSKEYGEN_WANTED_VERSION}")
|
||||||
|
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
libeoskeygen
|
libeoskeygen
|
||||||
GIT_REPOSITORY https://github.com/eosswedenorg/libeoskeygen.git
|
GIT_REPOSITORY https://github.com/eosswedenorg/libeoskeygen.git
|
||||||
GIT_TAG master
|
GIT_TAG v${LIBEOSKEYGEN_WANTED_VERSION}
|
||||||
)
|
)
|
||||||
|
|
||||||
FetchContent_MakeAvailable(libeoskeygen)
|
FetchContent_MakeAvailable(libeoskeygen)
|
||||||
|
endif()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue