Skip to content

Commit

Permalink
#10: Removed JsonCpp cmake, rewritten to use rapidjson instead. Need …
Browse files Browse the repository at this point in the history
…to be tested with -DUSE_SYSTEM_RAPIDJSON=NO.
  • Loading branch information
johniez committed Jul 12, 2019
1 parent 0dd63ee commit 411986d
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 419 deletions.
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "external/jsoncpp"]
path = external/jsoncpp
url = https://github.com/open-source-parsers/jsoncpp
[submodule "external/rapidjson"]
path = external/rapidjson
url = https://github.com/Tencent/rapidjson
[submodule "external/cpr"]
path = external/cpr
url = https://github.com/whoshuu/cpr
Expand Down
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ get_variable(BUILD_ELASTICLIENT_EXAMPLE "Build exmaple program which using elast

get_variable(USE_ALL_SYSTEM_LIBS "Will found all libraries in system." NO YES)
if(USE_ALL_SYSTEM_LIBS)
set(USE_SYSTEM_JSONCPP YES)
set(USE_SYSTEM_RAPIDJSON YES)
set(USE_SYSTEM_CPR YES)
set(USE_SYSTEM_HTTPMOCKSERVER YES)
set(USE_SYSTEM_GTEST YES)
else()
get_variable(USE_SYSTEM_JSONCPP "Will found JsonCpp library in system." NO YES)
get_variable(USE_SYSTEM_RAPIDJSON "Will found RapidJson library in system." NO YES)
get_variable(USE_SYSTEM_CPR "Will found CPR library in system." NO YES)
get_variable(USE_SYSTEM_HTTPMOCKSERVER "Will found HTTPMockServer library in system." NO YES)
get_variable(USE_SYSTEM_GTEST "Will found GTest library in system." NO YES)
Expand All @@ -65,9 +65,9 @@ message(STATUS "CMAKE_MODULE_PATH: ${CMAKE_MODULE_PATH}")
add_subdirectory(external)

set(ELASTICLIENT_LIBRARY elasticlient CACHE INTERNAL "")
set(ELASTICLIENT_LIBRARIES ${ELASTICLIENT_LIBRARY} ${CPR_LIBRARIES} ${JSONCPP_LIBRARIES} CACHE INTERNAL "")
set(ELASTICLIENT_LIBRARIES ${ELASTICLIENT_LIBRARY} ${CPR_LIBRARIES} CACHE INTERNAL "")
set(ELASTICLIENT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include CACHE INTERNAL "")
set(ELASTICLIENT_INCLUDE_DIRS ${ELASTICLIENT_INCLUDE_DIR} ${CPR_INCLUDE_DIRS} ${JSONCPP_INCLUDE_DIRS} CACHE INTERNAL "")
set(ELASTICLIENT_INCLUDE_DIRS ${ELASTICLIENT_INCLUDE_DIR} ${CPR_INCLUDE_DIRS} ${RapidJSON_INCLUDE_DIRS} CACHE INTERNAL "")

add_subdirectory(src)

Expand Down
6 changes: 2 additions & 4 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ The library is based on [C++ Requests: Curl for People](https://github.com/whosh

## Dependencies
* [C++ Requests: Curl for People](https://github.com/whoshuu/cpr)
* [JsonCpp](https://github.com/open-source-parsers/jsoncpp)
* [RapidJSON](http://rapidjson.org/)
* [Google Test](https://github.com/google/googletest)
* Only for tests: [C++ HTTP mock server library](https://github.com/seznam/httpmockserver)
Expand Down Expand Up @@ -47,7 +46,7 @@ make test # Optional, will run elasticlient tests
Following CMake configuration variables may be passed right before `..` in `cmake ..` command.
* `-DUSE_ALL_SYSTEM_LIBS=YES` - use all dependencies from system (default=NO)
* `-DUSE_SYSTEM_CPR=YES` - use C++ Requests library from system (default=NO)
* `-DUSE_SYSTEM_JSONCPP=YES` - use JsonCpp library from system (default=NO)
* `-DUSE_SYSTEM_RAPIDJSON=YES` - use RapidJson library from system (default=NO)
* `-DUSE_SYSTEM_GTEST=YES` - use Google Test library from system (default=NO)
* `-DUSE_SYSTEM_HTTPMOCKSERVER=YES` - use C++ HTTP mock server library from system (default=NO)
* `-DBUILD_ELASTICLIENT_TESTS=YES` - build elasticlient library tests (default=YES)
Expand Down Expand Up @@ -216,5 +215,4 @@ elasticlient::Client client(
```

## License
Elasticlient is licensed under the MIT License (MIT). Only the [cmake/Modules/FindJsonCpp.cmake](cmake/Modules/FindJsonCpp.cmake) is originally licensed
under [Boost Software License](cmake/Modules/LICENSE_1_0.txt), for more information see header of the file.
Elasticlient is licensed under the MIT License (MIT).
Loading

0 comments on commit 411986d

Please sign in to comment.