Git Product home page Git Product logo

bencode's Introduction

Bencode

A bencode parser implement by C.

build codecov

Usage

With CMake

bencode.cmake:

include(ExternalProject)
ExternalProject_Add(bencode_ep
        URL https://github.com/WingLim/bencode/archive/v1.0.0.tar.gz

        CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
        -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
        -DBUILD_STATIC_LIB=ON
        -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG:PATH=Debug
        -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE:PATH=Release
        -DUNIT_TEST=OFF

        BUILD_COMMAND $(MAKE) bencode
        INSTALL_COMMAND "")

add_library(bencode STATIC IMPORTED GLOBAL)
ExternalProject_Get_Property(bencode_ep binary_dir)

set_property(TARGET bencode PROPERTY IMPORTED_LOCATION "${binary_dir}/src/libbencode.a")
set_property(TARGET bencode PROPERTY IMPORTED_LOCATION_DEBUG "${binary_dir}/src/Debug/libbencode.a")
set_property(TARGET bencode PROPERTY IMPORTED_LOCATION_RELEASE "${binary_dir}/src/Release/libbencode.a")

add_dependencies(bencode bencode_ep)

ExternalProject_Get_Property(bencode_ep source_dir)
set(BENCODE_INCLUDE_DIR ${source_dir}/include GLOBAL)

Add below include in your CMakeLists.txt:

include(bencode.cmake)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.