Skip to content

Commit 9c0ef00

Browse files
authored
Merge pull request #9 from pooranjoyb/feat/pooranjoyb
Conan2.0 integration for dependency management
2 parents 98558a9 + 46500a3 commit 9c0ef00

File tree

6 files changed

+267
-244
lines changed

6 files changed

+267
-244
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
build
1+
build
2+
CMakeUserPresets.json

CMakeLists.txt

+8-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ project(AppwriteSDK CXX)
33

44
set(CMAKE_CXX_STANDARD 11)
55

6-
include_directories(include)
6+
include_directories(${CMAKE_BINARY_DIR}/conan/include)
7+
link_directories(${CMAKE_BINARY_DIR}/conan/lib)
8+
9+
find_package(CURL REQUIRED)
710

811
set(SRCS
912
src/Appwrite.cpp
@@ -17,7 +20,9 @@ set(SRCS
1720

1821
add_library(AppwriteSDK STATIC ${SRCS})
1922

20-
target_link_libraries(AppwriteSDK curl)
23+
include_directories(include)
24+
25+
target_link_libraries(AppwriteSDK CURL::libcurl)
2126

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

3944
install(DIRECTORY include/ DESTINATION /usr/local/include/AppwriteSDK)
4045
install(FILES ${HEADERS} DESTINATION /usr/local/include/AppwriteSDK)
46+
install(TARGETS AppwriteSDK ARCHIVE DESTINATION /usr/local/lib)

Makefile

-237
This file was deleted.

README.md

+14-4
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,20 @@ This **C++ SDK** is built from scratch as a **prototype** for interacting with A
2222

2323
## Installation
2424

25+
### Prerequisites
26+
27+
Before you begin, ensure that you have Conan installed on your system. You can install Conan using `pip`:
28+
29+
```bash
30+
pip install conan
31+
```
32+
2533
### Build From Source Code
2634

2735
Clone the repository and run the following commands
2836
```bash
29-
mkdir build
30-
cd build
37+
mkdir build && cd build
38+
conan install .. --build=missing
3139
cmake ..
3240
make
3341
```
@@ -93,11 +101,13 @@ The Appwrite C++ SDK raises `AppwriteException` object with `message`, `code` an
93101
94102
### Compilation & Execution
95103
104+
- ### Compile
96105
```bash
97-
# Compile
98106
g++ -o <output-file-name> <your-file-name>.cpp -I/usr/local/include/AppwriteSDK -L/usr/local/lib -lAppwriteSDK -lcurl
107+
```
99108

100-
# Execute
109+
- ### Execute
110+
```bash
101111
./output-file-name
102112
```
103113

conanfile.txt

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[requires]
2+
libcurl/8.10.1
3+
4+
[generators]
5+
CMakeDeps
6+
CMakeToolchain
7+
8+
[layout]
9+
cmake_layout

0 commit comments

Comments
 (0)