mirror of
https://github.com/eosswedenorg/libantelope
synced 2026-06-19 04:50:03 +02:00
Initial Commit
This commit is contained in:
commit
137d5cbe31
22 changed files with 1168 additions and 0 deletions
27
cmake/OpenSSL.cmake
Normal file
27
cmake/OpenSSL.cmake
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
|
||||
# On Windows if OPENSSL_ROOT_DIR is not explicitly set
|
||||
# we use a local static version.
|
||||
if (WIN32 AND NOT OPENSSL_ROOT_DIR)
|
||||
set( VENDOR_DIR ${CMAKE_CURRENT_SOURCE_DIR}/vendor)
|
||||
set( OPENSSL_ZIP_FILE ${VENDOR_DIR}/openssl-1.1.1e-win-static.zip )
|
||||
set( OPENSSL_ROOT_DIR ${VENDOR_DIR}/openssl-1.1.1e )
|
||||
# Force static.
|
||||
set( OPENSSL_USE_STATIC_LIBS TRUE )
|
||||
|
||||
if (NOT EXISTS ${OPENSSL_ROOT_DIR})
|
||||
message( "Unpacking ${OPENSSL_ZIP_FILE} to ${OPENSSL_ROOT_DIR}" )
|
||||
execute_process( COMMAND ${CMAKE_COMMAND} -E make_directory ${OPENSSL_ROOT_DIR} )
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E tar -xf ${OPENSSL_ZIP_FILE}
|
||||
WORKING_DIRECTORY ${OPENSSL_ROOT_DIR}
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# OpenSSL
|
||||
find_package(OpenSSL 1.1 REQUIRED)
|
||||
|
||||
# Bug in FindOpenSSL. Win needs to link to these if static libs are used.
|
||||
if (WIN32 AND OPENSSL_USE_STATIC_LIBS)
|
||||
set (OPENSSL_CRYPTO_LIBRARY "${OPENSSL_CRYPTO_LIBRARY};Crypt32;ws2_32")
|
||||
endif()
|
||||
124
cmake/cpack_custom.cmake
Normal file
124
cmake/cpack_custom.cmake
Normal file
|
|
@ -0,0 +1,124 @@
|
|||
# Custom script to setup cpack properly.
|
||||
|
||||
# --------------------------------
|
||||
# System variables
|
||||
# --------------------------------
|
||||
|
||||
# check CMAKE_SIZEOF_VOID_P to know if we are 32 or 64 bit.
|
||||
set( CPACK_SYSTEM_ARCH "x86" )
|
||||
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set( CPACK_SYSTEM_ARCH "${CPACK_SYSTEM_ARCH}_64" )
|
||||
endif()
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
|
||||
# Set CPACK_SYSTEM_NAME, CPACK_SYSTEM_VERSION
|
||||
# and CPACK_DEBIAN_PACKAGE_ARCHITECTURE correctly for debian based systems.
|
||||
execute_process(COMMAND lsb_release -is OUTPUT_VARIABLE SYS OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if (SYS)
|
||||
string(TOLOWER "${SYS}" CPACK_SYSTEM_NAME )
|
||||
|
||||
# Set CPACK_SYSTEM_VERSION
|
||||
execute_process(COMMAND lsb_release -rs OUTPUT_VARIABLE SYS_VER OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if (SYS_VER)
|
||||
set( CPACK_SYSTEM_VERSION ${SYS_VER} )
|
||||
endif(SYS_VER)
|
||||
|
||||
# Try setting CPACK_DEBIAN_PACKAGE_ARCHITECTURE based on dpkg
|
||||
if (NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
|
||||
execute_process(
|
||||
COMMAND dpkg --print-architecture
|
||||
OUTPUT_VARIABLE ARCH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
if (ARCH)
|
||||
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${ARCH})
|
||||
endif()
|
||||
endif()
|
||||
endif(SYS)
|
||||
|
||||
|
||||
# set CPACK_DEBIAN_PACKAGE_ARCHITECTURE to somthing sane by default.
|
||||
if (NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
|
||||
|
||||
# debian uses different names for 32/64 bit.
|
||||
if (CPACK_SYSTEM_ARCH STREQUAL "x86")
|
||||
set( ARCH "i386" )
|
||||
else()
|
||||
set( ARCH "amd64" )
|
||||
endif()
|
||||
|
||||
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${ARCH})
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
# CPACK_SYSTEM_NAME defaults are weird. so we set good default here.
|
||||
if (NOT CPACK_SYSTEM_NAME)
|
||||
set (CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
|
||||
endif()
|
||||
|
||||
# CPACK_SYSTEM_VERSION does not exist in original CPack. so we set a default here.
|
||||
if (NOT CPACK_SYSTEM_VERSION)
|
||||
set (CPACK_SYSTEM_VERSION ${CMAKE_SYSTEM_VERSION})
|
||||
endif()
|
||||
|
||||
|
||||
# --------------------------------
|
||||
# Package variables
|
||||
# --------------------------------
|
||||
|
||||
if (NOT CPACK_PACKAGE_NAME)
|
||||
set( CPACK_PACKAGE_NAME ${PROJECT_NAME} )
|
||||
endif()
|
||||
|
||||
# Forward some variables not handled by CPack.
|
||||
if (NOT CPACK_PACKAGE_CONTACT AND PROJECT_MAINTAINER)
|
||||
set( CPACK_PACKAGE_CONTACT ${PROJECT_MAINTAINER} )
|
||||
endif()
|
||||
|
||||
# Set "correct" filename that also include system version.
|
||||
if (CPACK_SYSTEM_VERSION)
|
||||
set( CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${PROJECT_VERSION}_${CPACK_SYSTEM_NAME}-${CPACK_SYSTEM_VERSION}_${CPACK_SYSTEM_ARCH}" )
|
||||
else()
|
||||
set( CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${PROJECT_VERSION}_${CPACK_SYSTEM_NAME}_${CPACK_SYSTEM_ARCH}" )
|
||||
endif()
|
||||
|
||||
|
||||
# .deb specific
|
||||
|
||||
# Set release version default 1.
|
||||
set( CPACK_DEBIAN_PACKAGE_RELEASE "1" CACHE STRING "Debian package release version" )
|
||||
|
||||
# For some reason CPackDeb does not honor CPACK_PACKAGE_HOMEPAGE_URL (that is set correctly)
|
||||
# if CPACK_DEBIAN_PACKAGE_HOMEPAGE (that the docs says it should.)
|
||||
# So we have to do it here.
|
||||
set( CPACK_DEBIAN_PACKAGE_HOMEPAGE "${PROJECT_HOMEPAGE_URL}" )
|
||||
|
||||
# Set "correct" filename that also include system version and architecture.
|
||||
set( CPACK_DEBIAN_FILE_NAME
|
||||
"${CPACK_PACKAGE_NAME}-${PROJECT_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}-${CPACK_SYSTEM_NAME}-${CPACK_SYSTEM_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb"
|
||||
)
|
||||
|
||||
|
||||
# --------------------------------
|
||||
# Generator default
|
||||
# --------------------------------
|
||||
|
||||
|
||||
# Default to gzip tar on unix. zip otherwise.
|
||||
if (NOT CPACK_GENERATOR)
|
||||
if (UNIX)
|
||||
set( CPACK_GENERATOR "TGZ" )
|
||||
else()
|
||||
set( CPACK_GENERATOR "ZIP" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
# --------------------------------
|
||||
# Include original CPack module.
|
||||
# --------------------------------
|
||||
|
||||
include( CPack )
|
||||
26
cmake/libeosioConfig.cmake.in
Normal file
26
cmake/libeosioConfig.cmake.in
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# This script provides the libeosio as an import target
|
||||
# ----------------------------------------------------------
|
||||
#
|
||||
# Use find_package() so cmake will find libeosio:
|
||||
#
|
||||
# find_package(libeosio) # No specific version
|
||||
# find_package(libeosio REQUIRED) # No specific version, but the library must be found.
|
||||
# find_package(libeosio 0.1) # any 0.1.x, but the library is optional.
|
||||
# find_package(libeosio 0.1.0) # 0.1.0 or greater, but the library is optional.
|
||||
#
|
||||
# Then you just link the you target with eoskeygen target:
|
||||
#
|
||||
# target_link_libraries( ${PROGRAM_EXE} PUBLIC libeosio )
|
||||
#
|
||||
# if you do not specify REQUIRED. you must check the variable libeosio_FOUND
|
||||
# and and only link to it if it's defined:
|
||||
#
|
||||
# if (libeosio_FOUND)
|
||||
# ...
|
||||
# target_link_libraries( ${PROGRAM_EXE} PUBLIC libeosio )
|
||||
# ..
|
||||
# endif()
|
||||
|
||||
set(LIBEOSIO_VERSION "@PROJECT_VERSION@")
|
||||
|
||||
include ( "${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake" )
|
||||
Loading…
Add table
Add a link
Reference in a new issue