2

I need to use rapidjson as a third party library to replace libjson. I'm trying to figure out how to build it so I can use it's build files in my project (dependency list).

I downloaded rapidjson from github, and I'm trying to get a buildable project. I'm looking at the instructions at rapidjson website, and it's showing that I need to do the following, below (Installation).

  1. We don't use git, so what would I need to do instead of the git submodule update --init step?

  2. Why would I need a build dir in the include/rapidjson directory with nothing in it?

  3. When I cd to build and type cmake, it seems to be missing parameters. What is the full cmake command? Thanks!

Installation

RapidJSON is a header-only C++ library. Just copy the include/rapidjson folder to system or project's include path.

RapidJSON uses following software as its dependencies: •CMake as a general build tool •(optional)Doxygen to build documentation •(optional)googletest for unit and performance testing

To generate user documentation and run tests please proceed with the steps below: 1.Execute git submodule update --init to get the files of thirdparty submodules (google test). 2.Create directory called build in rapidjson source directory. 3.Change to build directory and run cmake .. command to configure your build. Windows users can do the same with cmake-gui application. 4.On Windows, build the solution found in the build directory. On Linux, run make from the build directory.

On successfull build you will find compiled test and example binaries in bin directory. The generated documentation will be available in doc/html directory of the build tree. To run tests after finished build please run make test or ctest from your build tree. You can get detailed output using ctest -V command.

It is possible to install library system-wide by running make install command from the build tree with administrative privileges. This will install all files according to system preferences. Once RapidJSON is installed, it is possible to use it from other CMake projects by adding find_package(RapidJSON) line to your CMakeLists.txt.

Michele
  • 3,617
  • 12
  • 47
  • 81

1 Answers1

5

It is header-only library. So if you just want to integrate it into your project, just copy the /include folder to your project, and it should works.

All other instructions are for building unit tests, performance tests and documentation.

Milo Yip
  • 4,902
  • 2
  • 25
  • 27