Skip to content

Commit ba10343

Browse files
committed
Add cpp/IceStorm CMakeLists.txt files
1 parent 9f32f7e commit ba10343

File tree

9 files changed

+149
-16
lines changed

9 files changed

+149
-16
lines changed

cpp/Ice/secure/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ In a separate window, start the client:
3535
**Windows:**
3636

3737
```shell
38-
./build/Release/client
38+
build\Release\client

cpp/IceStorm/clock/CMakeLists.txt

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(icestorm_clock CXX)
4+
5+
include(../../cmake/common.cmake)
6+
7+
add_executable(subscriber Subscriber.cpp Clock.ice)
8+
slice2cpp_generate(subscriber)
9+
target_link_libraries(subscriber Ice::Ice Ice::IceStorm)
10+
11+
add_executable(publisher Publisher.cpp Clock.ice)
12+
slice2cpp_generate(publisher)
13+
target_link_libraries(publisher Ice::Ice Ice::IceStorm)
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(icestorm_counter CXX)
4+
5+
include(../../cmake/common.cmake)
6+
7+
add_executable(client Client.cpp CounterObserverI.cpp CounterObserverI.h Counter.ice)
8+
slice2cpp_generate(client)
9+
target_link_libraries(client Ice::Ice Ice::IceStorm)
10+
11+
add_executable(server Server.cpp CounterI.cpp CounterI.h Counter.ice)
12+
slice2cpp_generate(server)
13+
target_link_libraries(server Ice::Ice Ice::IceStorm)

cpp/IceStorm/counter/README.md

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,51 @@
1+
# Counter
2+
13
This demo shows how to implement the observer pattern using [IceStorm][1].
24

3-
To run the demo, start the IceStorm service:
5+
To build the demo run:
46

7+
```shell
8+
cmake -B build -S .
9+
cmake --build build --config Release
510
```
11+
12+
To run the demo, start the IceStorm service:
13+
14+
```shell
615
icebox --Ice.Config=config.icebox
716
```
817

918
This configuration assumes there is a subdirectory named db in the
1019
current working directory.
1120

12-
In a separate window:
21+
In a separate window, start the server:
1322

14-
```
15-
server
23+
**Linux/macOS:**
24+
25+
```shell
26+
./build/server
1627
```
1728

18-
In another window:
29+
**Windows:**
1930

31+
```shell
32+
build\Release\server
2033
```
21-
client
34+
35+
In a separate window, start the client:
36+
37+
**Linux/macOS:**
38+
39+
```shell
40+
./build/client
2241
```
2342

43+
**Windows:**
44+
45+
```shell
46+
build\Release\client
47+
48+
2449
Press 'i' and 'd' to increment and decrement the counter. You can also
2550
start more clients in other windows and observe that each is
2651
initialized and subsequently updated with the current counter value.
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(icestorm_replicated CXX)
4+
5+
include(../../cmake/common.cmake)
6+
7+
add_executable(subscriber Subscriber.cpp Clock.ice)
8+
slice2cpp_generate(subscriber)
9+
target_link_libraries(subscriber Ice::Ice Ice::IceStorm)
10+
11+
add_executable(publisher Publisher.cpp Clock.ice)
12+
slice2cpp_generate(publisher)
13+
target_link_libraries(publisher Ice::Ice Ice::IceStorm)

cpp/IceStorm/replicated/README.md

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,53 @@
1+
# Replicated
2+
13
This demo demonstrates how to configure and deploy [Highly Available
24
IceStorm][1] using IceGrid.
35

4-
To run the demo, start the IceGrid service:
6+
To build the demo run:
57

8+
```shell
9+
cmake -B build -S .
10+
cmake --build build --config Release
611
```
12+
13+
To run the demo, start the IceGrid service:
14+
15+
```shell
716
icegridnode --Ice.Config=config.grid
817
```
918

1019
In a separate window:
1120

12-
```
21+
```shell
1322
icegridadmin --Ice.Config=config.grid -e "application add application.xml"
14-
subscriber
1523
```
1624

17-
In another window:
25+
Next run the subscriber:
26+
27+
**Linux/macOS:**
28+
29+
```shell
30+
./build/subscriber
31+
```
32+
33+
**Windows:**
34+
35+
```shell
36+
build\Release\subscriber
37+
```
38+
39+
In a separate window, start the publisher:
40+
41+
**Linux/macOS:**
1842

43+
```shell
44+
./build/publisher
1945
```
20-
publisher
46+
47+
**Windows:**
48+
49+
```shell
50+
build\Release\publisher
2151
```
2252

2353
While the publisher continues to run, "tick" messages should be
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(icestorm_replicated2 CXX)
4+
5+
include(../../cmake/common.cmake)
6+
7+
add_executable(subscriber Subscriber.cpp Clock.ice)
8+
slice2cpp_generate(subscriber)
9+
target_link_libraries(subscriber Ice::Ice Ice::IceStorm)
10+
11+
add_executable(publisher Publisher.cpp Clock.ice)
12+
slice2cpp_generate(publisher)
13+
target_link_libraries(publisher Ice::Ice Ice::IceStorm)

cpp/IceStorm/replicated2/README.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,51 @@
1+
# Replicated 2
2+
13
This demo demonstrates how to configure and deploy [replicated IceStorm
24
instances][1] without using IceGrid.
35

6+
To build the demo run:
7+
8+
```shell
9+
cmake -B build -S .
10+
cmake --build build --config Release
11+
```
12+
13+
414
To run the demo, start the three IceStorm replicas. In three separate
515
windows:
616

7-
```
17+
```shell
818
icebox --Ice.Config=config.ib1
919
icebox --Ice.Config=config.ib2
1020
icebox --Ice.Config=config.ib3
1121
```
1222

1323
And then in a separate window:
1424

25+
**Linux/macOS:**
26+
27+
```shell
28+
./build/subscriber
1529
```
16-
subscriber
30+
31+
**Windows:**
32+
33+
```shell
34+
build\Release\subscriber
1735
```
1836

1937
In another window:
2038

39+
**Linux/macOS:**
40+
41+
```shell
42+
./build/publisher
2143
```
22-
publisher
44+
45+
**Windows:**
46+
47+
```shell
48+
build\Release\publisher
2349
```
2450

2551
While the publisher continues to run, "tick" messages should be

cpp/cmake/common.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ find_package(Threads REQUIRED)
77

88
set(Ice_DIR ${CMAKE_CURRENT_LIST_DIR} CACHE PATH "Path to Ice CMake configuration file")
99

10-
find_package(Ice REQUIRED CONFIG COMPONENTS Glacier2)
10+
find_package(Ice REQUIRED CONFIG COMPONENTS Glacier2 IceStorm)

0 commit comments

Comments
 (0)