Skip to content

Updates #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
build
build
CMakeUserPresets.json
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ project(AppwriteSDK CXX)

set(CMAKE_CXX_STANDARD 11)

include_directories(include)
include_directories(${CMAKE_BINARY_DIR}/conan/include)
link_directories(${CMAKE_BINARY_DIR}/conan/lib)

find_package(CURL REQUIRED)

set(SRCS
src/Appwrite.cpp
Expand All @@ -17,7 +20,9 @@ set(SRCS

add_library(AppwriteSDK STATIC ${SRCS})

target_link_libraries(AppwriteSDK curl)
include_directories(include)

target_link_libraries(AppwriteSDK CURL::libcurl)

set_target_properties(AppwriteSDK PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
Expand All @@ -38,3 +43,4 @@ set(HEADERS

install(DIRECTORY include/ DESTINATION /usr/local/include/AppwriteSDK)
install(FILES ${HEADERS} DESTINATION /usr/local/include/AppwriteSDK)
install(TARGETS AppwriteSDK ARCHIVE DESTINATION /usr/local/lib)
237 changes: 0 additions & 237 deletions Makefile

This file was deleted.

18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,20 @@ This **C++ SDK** is built from scratch as a **prototype** for interacting with A

## Installation

### Prerequisites

Before you begin, ensure that you have Conan installed on your system. You can install Conan using `pip`:

```bash
pip install conan
```

### Build From Source Code

Clone the repository and run the following commands
```bash
mkdir build
cd build
mkdir build && cd build
conan install .. --build=missing
cmake ..
make
```
Expand Down Expand Up @@ -93,11 +101,13 @@ The Appwrite C++ SDK raises `AppwriteException` object with `message`, `code` an

### Compilation & Execution

- ### Compile
```bash
# Compile
g++ -o <output-file-name> <your-file-name>.cpp -I/usr/local/include/AppwriteSDK -L/usr/local/lib -lAppwriteSDK -lcurl
```

# Execute
- ### Execute
```bash
./output-file-name
```

Expand Down
9 changes: 9 additions & 0 deletions conanfile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[requires]
libcurl/8.10.1

[generators]
CMakeDeps
CMakeToolchain

[layout]
cmake_layout
Loading