Skip to content

Commit

Permalink
Support custom specify RapidJSON include path on cmake or luarocks co…
Browse files Browse the repository at this point in the history
…mmand line.
  • Loading branch information
xpol committed Jan 29, 2016
1 parent 0a6c198 commit 9b46c91
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ if (NOT LUA_INCLUDE_DIR)
find_package(Lua REQUIRED)
endif()

include_directories(${LUA_INCLUDE_DIR} rapidjson/include)
if (NOT RAPIDJSON_INCLUDE_DIRS)
set(RAPIDJSON_INCLUDE_DIRS=rapidjson/include)
endif()

include_directories(${LUA_INCLUDE_DIR} ${RAPIDJSON_INCLUDE_DIRS})

add_library (rapidjson MODULE src/rapidjson.cpp)

Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ bug report and feature request.

luarocks install rapidjson

or if you like to use your own version of RapidJSON, use:

luarocks install rapidjson RAPIDJSON_INCLUDE_DIRS=path/to/rapidjson/include/dir

```Lua
local rapidjson = require('rapidjson')

Expand Down Expand Up @@ -310,6 +314,10 @@ The current loaded rapidjson version. `"scm"` when not build with luarocks.

## Changelog

### 0.4.3

* CMakeLists.txt supports command line defined `RAPIDJSON_INCLUDE_DIRS` to specified RapidJSON include directory.

### 0.4.2

* Update RapidJSON to latest HEAD version.
Expand Down
2 changes: 1 addition & 1 deletion rapidjson-0.4.2-1.rockspec → rapidjson-0.4.3-1.rockspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package = "rapidjson"
version = "0.4.2-1"
version = "0.4.3-1"
local v = version:gsub("%-%d", "")
source = {
url = "git://github.com/xpol/lua-rapidjson",
Expand Down

0 comments on commit 9b46c91

Please sign in to comment.