mirror of
https://github.com/eosswedenorg/antelope-keygen
synced 2026-06-18 04:00:03 +02:00
CMakeModules/libeoskeygen.cmake: define fromGit macro and use it.
This commit is contained in:
parent
a9a45363df
commit
1924feacb0
1 changed files with 23 additions and 12 deletions
|
|
@ -1,4 +1,26 @@
|
|||
|
||||
# --------------------------------
|
||||
# Variables
|
||||
# --------------------------------
|
||||
set( LIBEOSKEYGEN_GIT_URL "https://github.com/eosswedenorg/libeoskeygen.git" )
|
||||
set( LIBEOSKEYGEN_WANTED_VERSION 0.1.0 )
|
||||
|
||||
# --------------------------------
|
||||
# Macros
|
||||
# --------------------------------
|
||||
macro(fromGit tag)
|
||||
|
||||
message ("Using libeoskeygen from: ${LIBEOSKEYGEN_GIT_URL}@${tag}")
|
||||
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(libeoskeygen
|
||||
GIT_REPOSITORY ${LIBEOSKEYGEN_GIT_URL}
|
||||
GIT_TAG ${tag}
|
||||
)
|
||||
|
||||
FetchContent_MakeAvailable(libeoskeygen)
|
||||
endmacro()
|
||||
|
||||
# If we have a custom libeoskeygen
|
||||
if(CUSTOM_LIBEOSKEYGEN)
|
||||
|
||||
|
|
@ -8,24 +30,13 @@ if(CUSTOM_LIBEOSKEYGEN)
|
|||
include(${CUSTOM_LIBEOSKEYGEN}/libeoskeygenTargets.cmake)
|
||||
else()
|
||||
|
||||
set( LIBEOSKEYGEN_WANTED_VERSION 0.1.0 )
|
||||
|
||||
# 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)
|
||||
FetchContent_Declare(
|
||||
libeoskeygen
|
||||
GIT_REPOSITORY https://github.com/eosswedenorg/libeoskeygen.git
|
||||
GIT_TAG v${LIBEOSKEYGEN_WANTED_VERSION}
|
||||
)
|
||||
|
||||
FetchContent_MakeAvailable(libeoskeygen)
|
||||
fromGit( v${LIBEOSKEYGEN_WANTED_VERSION} )
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue