1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-keygen synced 2026-06-17 03:50:03 +02:00

CMakeModules/libeoskeygen.cmake: handle custom libeoskeygen via LIBEOSKEYGEN_SOURCE_DIR variable correctly.

by include()'ing the targets file. cmake only knows how to link but not to build.
The proper ways is to use add_subdirectory()
This commit is contained in:
Henrik Hautakoski 2020-03-25 16:52:27 +01:00
parent 1924feacb0
commit 47767e3443

View file

@ -21,15 +21,15 @@ macro(fromGit tag)
FetchContent_MakeAvailable(libeoskeygen)
endmacro()
# If we have a custom libeoskeygen
if(CUSTOM_LIBEOSKEYGEN)
macro(buildLocal src)
message ("Using local libeoskeygen at: ${src}")
add_subdirectory(${src} ${src}/build)
endmacro()
message ("Using libeoskeygen in: ${CUSTOM_LIBEOSKEYGEN}")
# Include targets.
include(${CUSTOM_LIBEOSKEYGEN}/libeoskeygenTargets.cmake)
# If we have a local libeoskeygen
if (LIBEOSKEYGEN_SOURCE_DIR)
buildLocal( ${LIBEOSKEYGEN_SOURCE_DIR} )
else()
# Try finding the package on the system.
find_package(libeoskeygen ${LIBEOSKEYGEN_WANTED_VERSION} QUIET)
if (libeoskeygen_FOUND)
@ -38,5 +38,4 @@ else()
else()
fromGit( v${LIBEOSKEYGEN_WANTED_VERSION} )
endif()
endif()