Skip to content

Commit

Permalink
Merge pull request #9 from pooranjoyb/feat/pooranjoyb
Browse files Browse the repository at this point in the history
Conan2.0 integration for dependency management
  • Loading branch information
sristy17 authored Dec 28, 2024
2 parents 98558a9 + 46500a3 commit 9c0ef00
Show file tree
Hide file tree
Showing 6 changed files with 267 additions and 244 deletions.
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

0 comments on commit 9c0ef00

Please # to comment.