diff --git a/bindings/cpp/CMakeLists.txt b/bindings/cpp/CMakeLists.txt index 13ca3e10ff02..52c17a97b4e4 100644 --- a/bindings/cpp/CMakeLists.txt +++ b/bindings/cpp/CMakeLists.txt @@ -74,7 +74,7 @@ else() endif() set(CPP_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include ${CARGO_TARGET_DIR}/cxxbridge/opendal-cpp/src) file(GLOB_RECURSE CPP_SOURCE_FILE src/*.cpp) -file(GLOB_RECURSE CPP_HEADER_FILE include/*.h) +file(GLOB_RECURSE CPP_HEADER_FILE include/*.hpp) if (CMAKE_BUILD_TYPE STREQUAL "Debug") add_custom_command( diff --git a/bindings/cpp/Doxyfile b/bindings/cpp/Doxyfile index 29c815c023d3..cab9c20a375c 100644 --- a/bindings/cpp/Doxyfile +++ b/bindings/cpp/Doxyfile @@ -15,12 +15,11 @@ # specific language governing permissions and limitations # under the License. -PROJECT_NAME = "OpenDAL Cpp Binding" +PROJECT_NAME = "OpenDAL-CPP" PROJECT_BRIEF = "The Cpp binding for Apache OpenDAL" OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@/docs_doxygen/ EXCLUDE_SYMBOLS = "" USE_MDFILE_AS_MAINPAGE = "README.md" - DOXYFILE_ENCODING = UTF-8 CREATE_SUBDIRS = NO CREATE_SUBDIRS_LEVEL = 8 diff --git a/bindings/cpp/README.md b/bindings/cpp/README.md index dcc675f813af..2325272c884d 100644 --- a/bindings/cpp/README.md +++ b/bindings/cpp/README.md @@ -2,6 +2,8 @@ ![](https://github.com/apache/incubator-opendal/assets/5351546/87bbf6e5-f19e-449a-b368-3e283016c887) +Documents: [![Documents](https://img.shields.io/badge/opendal-cpp-blue?logo=Apache&logoColor=red)](https://opendal.apache.org/docs/cpp/) + ## Example ```cpp @@ -16,6 +18,47 @@ int main() { } ``` +More examples can be found [here](../../examples/cpp). + +## Using + +### CMake + +You can use `FetchContent` to add OpenDAL to your project. + +```cmake +FetchContent_Declare( + opendal-cpp + GIT_REPOSITORY https://github.com/apache/incubator-opendal.git + GIT_TAG v0.40.0 + SOURCE_SUBDIR bindings/cpp +) +FetchContent_MakeAvailable(opendal-cpp) +``` + +Or you can download the source code and add it to your project. + +```shell +mkdir third_party +cd third_party +git clone https://github.com/apache/incubator-opendal.git +git checkout v0.40.0 +``` + +```cmake +add_subdirectory(third_party/incubator-opendal/bindings/cpp) +``` + +Now you can use OpenDAL in your project. + +```cmake +target_link_libraries(your_target opendal_cpp) +``` + +### Others + +Support for more package managers is coming soon! + ## Compiling ### Prerequisites @@ -56,19 +99,4 @@ make docs - `OPENDAL_ENABLE_ADDRESS_SANITIZER`: Enable address sanitizer. Default: `OFF` - `OPENDAL_ENABLE_DOCUMENTATION`: Enable documentation. Default: `OFF` - `OPENDAL_DOCS_ONLY`: Only build documentation. Default: `OFF` -- `OPENDAL_ENABLE_TESTING`: Enable testing. Default: `OFF` - -## Using - -### CMake - -Because the project repo includes rust core code, we can't use `git submodule` directly to add it. So we recommend using `FetchContent` to add the library. - -```cmake -FetchContent_Declare( - opendal-cpp - URL https://github.com/apache/incubator-opendal/releases/download//opendal-cpp-.tar.gz - URL_HASH SHA256= -) -FetchContent_MakeAvailable(opendal-cpp) -``` \ No newline at end of file +- `OPENDAL_ENABLE_TESTING`: Enable testing. Default: `OFF` \ No newline at end of file