miloyip/rapidjson — pull request #126 by thebusytypist (2014-08-31 04:39:26+00:00)
Title: CMake Build(issue #82)

This pull request is for CMake build system support in RapidJSON.

It includes build scripts for examples, unittests, and a CMake module of RapidJSON.

Usage:
1. Run CMake client, then select the source path of RapidJSON and a build path(I suggest to use out-of-source build).
2. Configure and set some variables.
For some version of Visual C++ on Windows, you may need to check `gtest_force_shared_crt` to ensure projects are linked to same type of CRT(multi-threaded dynamic).
3. Generate

*Differences from current build system(premake):*
* Code Generation Settings
In premake build scripts, project test and project example have inconsistent code generation settings. In project test SSE4.2(-msse4.2) is enabled only for gmake configuration.While in project example, SSE2(flags { "Optimize", "EnableSSE2" }) is enabled for release configuration.

Currently I leave the SSE optimization settings unset for both project unittest and project example.

This does not affect the intrinsic sets you use(which is controlled by CMake variable `RapidJSON_SIMD_OPTIMIZATION`).

* Working Directory
For Visual C++ you should set working directory manually because CMake cannot set it in an official documented way.

*Please delay merging of this pull request. I have to test this on Xcode on a Mac OS X machine.*