forked from lthn/blockchain
This pull request introduces a comprehensive new API interface for the blockchain, leveraging OpenAPI v3 to facilitate direct consumption of chain data by GUI and web applications. This change significantly refines the project's build infrastructure, incorporating Conan for dependency management and CMake for configuration, alongside the integration of an OpenAPI Generator to produce SDKs for multiple languages. ### Highlights * **New API Interface**: Introduced a new API interface using OpenAPI v3 to enable GUI/WEB development to consume chain data without needing custom server applications. * **Build System Enhancements**: Significant updates to the build system, including Makefile, CMake, and Conan configurations, to streamline the build process and support new functionalities. * **Multi-language SDK Generation**: Integrated OpenAPI Generator to automatically create SDKs for various programming languages, including Go, Angular, and PHP, simplifying client-side integration.
88 lines
No EOL
3.8 KiB
CMake
88 lines
No EOL
3.8 KiB
CMake
|
||
|
||
if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel" OR CMAKE_BUILD_TYPE STREQUAL "")
|
||
set(CPACK_PACKAGE_NAME "${package_name}")
|
||
set(CPACK_PACKAGE_VENDOR "${package_vendor}")
|
||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${package_description}")
|
||
set(CPACK_PACKAGE_VERSION "${BUILD_VERSION}")
|
||
set(CPACK_PACKAGE_CONTACT "${package_contact}")
|
||
set(CPACK_PACKAGE_HOMEPAGE_URL "${package_website}")
|
||
|
||
#set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/local") # Linux/macOS default
|
||
#if(WIN32)
|
||
# set(CPACK_PACKAGING_INSTALL_PREFIX "C:/Program Files/${PROJECT_NAME}")
|
||
#endif()
|
||
|
||
if(APPLE)
|
||
if("${package_macos_installer}" STREQUAL "DMG")
|
||
# set(CPACK_GENERATOR "DragNDrop")
|
||
# set(CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_SOURCE_DIR}/resources/dmg_background.png")
|
||
# set(CPACK_DMG_VOLUME_NAME "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
|
||
# message(STATUS "Registered CPACK_GENERATOR: DragNDrop")
|
||
else ()
|
||
# set(CPACK_GENERATOR "productbuild")
|
||
# set(CPACK_PRODUCTBUILD_IDENTIFIER "${package_macos_pkg_productbuild_identifier}")
|
||
# set(CPACK_PRODUCTBUILD_SIGNING_IDENTITY "Developer ID Installer: Your Company (TEAMID)")
|
||
# message(STATUS "Registered CPACK_GENERATOR: productbuild")
|
||
endif ()
|
||
elseif(WIN32)
|
||
set(CPACK_GENERATOR "NSIS")
|
||
set(CPACK_NSIS_MODIFY_PATH ON)
|
||
set(CPACK_NSIS_HELP_LINK "https://lt.hn/getting-started/chain.html")
|
||
set(CPACK_NSIS_URL_INFO_ABOUT "https://lt.hn")
|
||
set(CPACK_NSIS_CONTACT "support@lt.hn")
|
||
set(CPACK_NSIS_UNINSTALL_NAME "Lethean CLI")
|
||
set(CPACK_NSIS_BRANDING_TEXT "Lethean Community")
|
||
set(CPACK_NSIS_MUI_FINISHPAGE_RUN "lethean-testnet-chain-node.exe")
|
||
|
||
message(STATUS "Registered CPACK_GENERATOR: Inno exe")
|
||
# set(CPACK_WIX_PRODUCT_ICON "${CMAKE_SOURCE_DIR}/resources/windows_icon.ico")
|
||
# set(CPACK_WIX_LICENSE_RTF "${CMAKE_SOURCE_DIR}/LICENSE.rtf")
|
||
# set(CPACK_WIX_UPGRADE_GUID "D3F5A9C1-4B2E-4F5A-9C71-123456789ABC") # change once per major version
|
||
else()
|
||
set(CPACK_GENERATOR "DEB")
|
||
set(CPACK_GENERATOR "RPM")
|
||
message(STATUS "Registered CPACK_GENERATOR: deb")
|
||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${package_contact}")
|
||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.28)")
|
||
set(CPACK_DEBIAN_PACKAGE_SECTION "utils")
|
||
set(CPACK_DEBIAN_ARCHITECTURE "${CMAKE_SYSTEM_PROCESSOR}")
|
||
# post‑install script (e.g., to register a systemd service)
|
||
# set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
|
||
# "${CMAKE_SOURCE_DIR}/scripts/postinstall.sh")
|
||
endif()
|
||
|
||
list(APPEND CPACK_GENERATOR "TXZ" "ZIP")
|
||
message(STATUS "Registered CPACK_GENERATOR: tgz")
|
||
message(STATUS "Registered CPACK_GENERATOR: zip")
|
||
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF)
|
||
set(CPACK_ARCHIVE_COMPONENT_INSTALL OFF)
|
||
set(CPACK_COMPONENTS_ALL)
|
||
set(CPACK_MONOLITHIC_INSTALL OFF)
|
||
set(CPACK_PACKAGE_CHECKSUM SHA256)
|
||
message(STATUS "Using SHA256 Checksums")
|
||
|
||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.txt")
|
||
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md")
|
||
|
||
set(CPACK_PACKAGE_DIRECTORY "${CMAKE_SOURCE_DIR}/build/packages")
|
||
|
||
install(FILES README.md LICENSE.txt
|
||
DESTINATION "share/doc/${PROJECT_NAME}"
|
||
)
|
||
|
||
set(_arch "${CMAKE_SYSTEM_PROCESSOR}")
|
||
|
||
if(_arch MATCHES "AMD64|x86_64")
|
||
set(_arch "x86_64")
|
||
elseif(_arch MATCHES "arm64|aarch64")
|
||
set(_arch "arm64")
|
||
endif()
|
||
|
||
string(TOLOWER "${CMAKE_SYSTEM_NAME}" _sys_name_lc)
|
||
|
||
set(CPACK_PACKAGE_FILE_NAME
|
||
"${package_name}-${CPACK_PACKAGE_VERSION}-${_sys_name_lc}-${_arch}")
|
||
|
||
include(CPack)
|
||
endif() |