Giter Site home page Giter Site logo

cmake_third_party's Introduction

cmake third party

Functionality

common third dependencies

  • boost
  • protobuf
  • gflags
  • glog
  • cityhash
  • sparsehash
  • thrift
  • libevent
  • gperftools
  • eigen

find package

  • first search package in local machine
  • if not exist, download package and build

compile proto file

  • automatically compile proto files when building

compile thrift file

  • automatically compile thrift files when building

Build this project as a demo

mkdir cmake_build_tmp && cd cmake_build_tmp
cmake ..
make
./hello --logtostderr=1

Usage this project in your project

  • copy third_party to your project

  • load third dependency cmake file in your CMakeLists.txt

    # third party dependencies cmake
    list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/third_party)
    
    # boost
    find_package(Boost COMPONENTS system program_options)
    
    # cityhash
    find_package(Cityhash)
    
    # gflags
    find_package(Gflags)
    
    # glog
    find_package(Glog)
    
    # protobuf
    find_package(Protobuf)
    
  • proto auto compile

    # compile pb
    include(proto/CMakeLists.txt)
    set_source_files_properties(${PB_SOURCES} ${PB_HEADERS} PROPERTIES GENERATED TRUE)
    
    # add pb dependency
    add_dependencies(your_target ${PB_TARGETS})
    

cmake_third_party's People

Contributors

formath avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

vamoscc

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.