Skip to content

Commit ea74f30

Browse files
authored
Add cpp/Glacier2 CMake files (#267)
1 parent 09ea628 commit ea74f30

File tree

4 files changed

+82
-6
lines changed

4 files changed

+82
-6
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
cmake_minimum_required(VERSION 3.16)
2+
3+
project(glacier2_callback CXX)
4+
5+
include(../../cmake/common.cmake)
6+
7+
add_executable(client Client.cpp Callback.ice)
8+
slice2cpp_generate(client)
9+
target_link_libraries(client Ice::Ice Ice::Glacier2)
10+
11+
add_executable(server Server.cpp CallbackI.cpp CallbackI.h Callback.ice)
12+
slice2cpp_generate(server)
13+
target_link_libraries(server Ice::Ice)

cpp/Glacier2/callback/README.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,47 @@
1+
# Glacier2 Callback
2+
13
This example demonstrates the use of several Glacier2 features, including
24
[callbacks][1] and [request contexts][2].
35

6+
To build the demo run:
7+
8+
```shell
9+
cmake -B build
10+
cmake --build build --config Release
11+
```
12+
413
To run the demo, first start the server:
514

15+
**Linux/macOS:**
16+
17+
```shell
18+
./build/server
619
```
7-
server
20+
21+
**Windows:**
22+
23+
```shell
24+
build\Release\server
825
```
926

1027
In a separate window, start the Glacier2 router:
1128

12-
```
29+
```shell
1330
glacier2router --Ice.Config=config.glacier2
1431
```
1532

1633
In a separate window, start the client:
1734

35+
**Linux/macOS:**
36+
37+
```shell
38+
./build/client
1839
```
19-
client
40+
41+
**Windows:**
42+
43+
```shell
44+
build\Release\client
2045
```
2146

2247
If you plan to run this demo using clients on different hosts than the
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
cmake_minimum_required(VERSION 3.16)
2+
3+
project(glacier2_simpleChat CXX)
4+
5+
include(../../cmake/common.cmake)
6+
7+
add_executable(client Client.cpp Chat.ice)
8+
slice2cpp_generate(client)
9+
target_link_libraries(client Ice::Ice Ice::Glacier2)
10+
11+
add_executable(server Server.cpp ChatSessionI.cpp ChatSessionI.h Chat.ice)
12+
slice2cpp_generate(server)
13+
target_link_libraries(server Ice::Ice Ice::Glacier2)

cpp/Glacier2/simpleChat/README.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,47 @@
1+
# Glacier2 Simple Chat
2+
13
This example presents a very simple chat server to demonstrate the use of a
24
[Glacier2 session][1].
35

6+
To build the demo run:
7+
8+
```shell
9+
cmake -B build
10+
cmake --build build --config Release
11+
```
12+
413
To run the demo, first start the chat server:
514

15+
**Linux/macOS:**
16+
17+
```shell
18+
./build/server
619
```
7-
server
20+
21+
**Windows:**
22+
23+
```shell
24+
build\Release\server
825
```
926

1027
In a separate window, start the Glacier2 router:
1128

12-
```
29+
```shell
1330
glacier2router --Ice.Config=config.glacier2
1431
```
1532

1633
In a separate window, start the client:
1734

35+
**Linux/macOS:**
36+
37+
```shell
38+
./build/client
1839
```
19-
client
40+
41+
**Windows:**
42+
43+
```shell
44+
build\Release\client
2045
```
2146

2247
If you plan to run this demo using clients running on different hosts

0 commit comments

Comments
 (0)