cern-fts / davix

High-performance file management over WebDAV / HTTP
GNU Lesser General Public License v2.1
83 stars 34 forks source link

Use system rapidjson, fall back to bundled. #119

Closed badshah400 closed 2 months ago

badshah400 commented 4 months ago

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.

badshah400 commented 4 months ago

I have tested this both with and without system installed rapidjson.

mpatrascoiu commented 2 months ago

Thanks! Added to devel branch.

Cheers, Mihai