Currently the rapidjson headers are hard-coded into davix_gcloud_utils.cpp in a way that makes it difficult to use external/system provided rapidjson headers rather than the bundled ones.
This commit uses find_package to look for an external instance of rapidjson, falling back to the bundled version in src/libs/rapidjson if that search fails. In either case, it sets up the variable RAPIDJSON_INCLUDE_DIRS pointing to the location of the headers and adds this to the list of DAVIX_INTERNAL_INCLUDES to allow the location to be included during compilation (via -I${RAPIDJSON_INCLUDE_DIRS}). Finally, it modifies the #include in davix_gcloud_utils.cpp to support a generic location.
Currently the
rapidjson
headers are hard-coded intodavix_gcloud_utils.cpp
in a way that makes it difficult to use external/system provided rapidjson headers rather than the bundled ones.This commit uses
find_package
to look for an external instance of rapidjson, falling back to the bundled version insrc/libs/rapidjson
if that search fails. In either case, it sets up the variableRAPIDJSON_INCLUDE_DIRS
pointing to the location of the headers and adds this to the list ofDAVIX_INTERNAL_INCLUDES
to allow the location to be included during compilation (via-I${RAPIDJSON_INCLUDE_DIRS}
). Finally, it modifies the#include
indavix_gcloud_utils.cpp
to support a generic location.