Code Monkey home page Code Monkey logo

cpp-sdk's Introduction

LeanCloud C++ SDK

How to set up a playground on Mac OS X

The instructions below have been tested only on Mavericks.

Prerequisites

  • homebrew, a package management tool for Mac OS X

      ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)
    
  • CMake, the cross-platform, open-source build system

      brew install cmake
    
  • Doxygen, the de facto standard tool for generating documentation from annotated C++ sources

      brew install doxygen
    
  • Boost, a set of libraries for the C++ programming language that provide support for tasks and structures such as linear algebra, pseudorandom number generation, multithreading, image processing, regular expressions, and unit testing.

      brew install boost
    

Build

We use cmake to build our C++ SDK

  • Get git submodules

      $ git submodule init
      $ git submodule update
    
  • build and install cpp-netlib

      $ cd lib/cpp-netlib
      $ mkdir cpp-netlib-build
      $ cd cpp-netlib-build
      $ cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
      $ make -j4 && make install
    
  • build and install jsoncpp

      $ cd lib/jsoncpp
      $ mkdir jsoncpp-build
      $ cd jsoncpp-build
      $ cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
      $ make -j4 && make install
    
  • build AVOSCloud C++ SDK

      $ cd cpp-sdk
      $ mkdir cpp-sdk-build
      $ cd cpp-sdk-build
      $ cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
      $ make -j4 && make install
    

If you want to build this project for ARM, do as follows:

  • build and install cpp-netlib for ARM

      $ cd lib/cpp-netlib
      $ mkdir cpp-netlib-build
      $ cd cpp-netlib-build
      $ cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=../ToolchainARM.cmake
      $ make -j4 && make install		
    
  • build and install jsoncpp for ARM

      $ cd lib/jsoncpp
      $ mkdir jsoncpp-build
      $ cd jsoncpp-build
      $ cmake .. -DCMAKE_BUILD_TYPE=Debug -DMAKE_TOOLCHAIN_FILE=../ToolchainARM.cmake
      $ make -j4 && make install
    
  • build AVOSCloud C++ SDK for ARM

      $ cd lib/cpp-sdk
      $ mkdir cpp-sdk-build
      $ cd cpp-sdk-build
      $ cmake .. -DCMAKE_BUILD_TYPE=Debug -DMAKE_TOOLCHAIN_FILE=../ToolchainARM.cmake
      $ make -j4 && make install
    

More about CMake Cross Compiling is here.

Docs

We can generate cpp api docs using doxygen.

	$ cd cpp-sdk
	$ doxygen Doxyfile

Then, a docs directory will be generated.

Code style

Usually, we try to follow the google-cpp-code-style. There is a tool named as cpplint.py that reads source files and identifies many style errors. We can check the code sytle of our project by the following command:

	scripts/check-cpp-code-style.sh

High-level file hierarchy

  • include: header files of AVOSCloud

  • src: source code of AVOSCloud

  • tests: unit test cases

  • scripts: some useful scripts

  • lib: third-party libraries

  • Doxyfile: used to generate C++ docs

  • README.md: brief introduction to this project

  • CMakeLists.txt: cmake script which will be used to generate Makefile

Contact

If you have any question about the cpp-sdk for AVOSCloud, please contact

Chaozhong Yang <[email protected]>

License

Distributed under GNU Lesser General Public License .

cpp-sdk's People

Contributors

debugger87 avatar sparanoid avatar

Watchers

Richie avatar

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.