Skip to content

Commit d9dbc06

Browse files
authored
Merge pull request #6 from pooranjoyb/feat/pooranjoyb
Build Setup with CMakeLists
2 parents b0321b1 + 447130b commit d9dbc06

File tree

3 files changed

+68
-0
lines changed

3 files changed

+68
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build

CMakeLists.txt

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
cmake_minimum_required(VERSION 3.10)
2+
project(AppwriteSDK CXX)
3+
4+
set(CMAKE_CXX_STANDARD 11)
5+
6+
include_directories(include)
7+
8+
set(SRCS
9+
src/Appwrite.cpp
10+
src/services/Account.cpp
11+
src/services/Databases.cpp
12+
src/services/Storage.cpp
13+
src/services/Health.cpp
14+
src/Utils.cpp
15+
src/Validator.cpp
16+
)
17+
18+
add_library(AppwriteSDK STATIC ${SRCS})
19+
20+
target_link_libraries(AppwriteSDK curl)
21+
22+
set_target_properties(AppwriteSDK PROPERTIES
23+
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
24+
)
25+
26+
set(HEADERS
27+
include/Appwrite.hpp
28+
include/classes/Account.hpp
29+
include/classes/Databases.hpp
30+
include/classes/Storage.hpp
31+
include/classes/Health.hpp
32+
include/config/Config.hpp
33+
include/enums/HttpStatus.hpp
34+
include/exceptions/AppwriteException.hpp
35+
include/Utils.hpp
36+
include/Validator.hpp
37+
)
38+
39+
install(DIRECTORY include/ DESTINATION /usr/local/include/AppwriteSDK)
40+
install(FILES ${HEADERS} DESTINATION /usr/local/include/AppwriteSDK)

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,23 @@ This **C++ SDK** is built from scratch as a **prototype** for interacting with A
2020
![Appwrite](https://github.com/appwrite/appwrite/raw/main/public/images/github.png)
2121

2222

23+
## Installation
24+
25+
### Build From Source Code
26+
27+
Clone the repository and run the following commands
28+
```bash
29+
mkdir build
30+
cd build
31+
cmake ..
32+
make
33+
```
34+
35+
Install the SDK.
36+
```bash
37+
sudo make install
38+
```
39+
2340
## Getting Started
2441

2542
### Make Your First Request
@@ -74,6 +91,16 @@ The Appwrite C++ SDK raises `AppwriteException` object with `message`, `code` an
7491
}
7592
```
7693
94+
### Compilation & Execution
95+
96+
```bash
97+
# Compile
98+
g++ -o <output-file-name> <your-file-name>.cpp -I/usr/local/include/AppwriteSDK -L/usr/local/lib -lAppwriteSDK -lcurl
99+
100+
# Execute
101+
./output-file-name
102+
```
103+
77104
For a more detailed view of the implementations, please check out the example directory. [Example](/examples/)
78105

79106
### Learn more

0 commit comments

Comments
 (0)