Skip to content

Commit 955cb0c

Browse files
authored
Add CMakeLists.txt for cpp/Ice demos (#257)
1 parent 886eaba commit 955cb0c

38 files changed

+619
-109
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,15 @@ jobs:
8484
with:
8585
path: ice-demos
8686

87+
- name: Generate C++ Build Systems on ${{ matrix.os }}
88+
timeout-minutes: 5
89+
working-directory: ice-demos/cpp
90+
run: find . -name CMakeLists.txt -execdir cmake -B build -S . ";"
91+
8792
- name: Build C++ Demos on ${{ matrix.os }}
88-
uses: ./ice/.github/actions/build
8993
timeout-minutes: 20
90-
with:
91-
working_directory: ice-demos/cpp
92-
msbuild_project: msbuild/ice.proj
93-
94-
- name: Build C++ Demos on ${{ matrix.os }} with CMake
95-
timeout-minutes: 5
9694
working-directory: ice-demos/cpp
97-
run:
98-
find . -name CMakeLists.txt -execdir cmake -B build -S . \; -execdir cmake --build build --config Release \;
95+
run: find . -name CMakeLists.txt -type d -execdir cmake --build build ";"
9996

10097
- name: Build C# Demos on ${{ matrix.os }}
10198
timeout-minutes: 20

.gitignore

Lines changed: 3 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,11 @@
1-
# Ignore executables
2-
client
3-
server
4-
locator
5-
publisher
6-
subscriber
7-
reader
8-
writer
9-
talk
10-
chatserver
11-
chatgl2client
12-
chatpollclient
13-
14-
!**/Chat/client/
15-
!**/Chat/server/
16-
17-
!**/msbuild/client
18-
!**/msbuild/server
19-
!**/msbuild/locator
20-
!**/msbuild/publisher
21-
!**/msbuild/subscriber
22-
!**/msbuild/reader
23-
!**/msbuild/writer
24-
25-
!**/Sources/client
26-
!**/Sources/server
27-
!**/Sources/locator
28-
!**/Sources/publisher
29-
!**/Sources/subscriber
1+
# Cmake generated files
2+
build
303

314
.gradle
325
*.jar
336

34-
# Ignore objects and archives.
35-
*.[oa]
36-
*.obj
37-
*.dll
38-
*.ilk
39-
*.so
40-
*.so.*
41-
*.sl
42-
*.dylib
43-
*.pyc
44-
*.class
45-
*.exe
46-
*.mdb
47-
*.pdb
48-
*.tds
49-
*.bak
50-
*.ncb
51-
# .sdf is the Visual Studio 2010 equivalent to .ncb
52-
*.sdf
53-
*.opt
54-
*.opendb
55-
*.res
56-
*.exp
57-
.gdb_history
7+
# macOS Finder
588
.DS_Store
59-
core
60-
/*/dist
61-
generated
62-
build
63-
generated.test
64-
cgenerated
65-
sgenerated
669

6710
# Eclipse
6811
.externalToolBuilders

.vscode/settings.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,24 @@
66
"C_Cpp.default.cppStandard": "c++17",
77
"gradle.nestedProjects": true,
88
"cmake.sourceDirectory":[
9+
"${workspaceFolder}/cpp/Ice/bidir",
10+
"${workspaceFolder}/cpp/Ice/callback",
11+
"${workspaceFolder}/cpp/Ice/context",
912
"${workspaceFolder}/cpp/Ice/greeter",
1013
"${workspaceFolder}/cpp/Ice/greeterAsync",
14+
"${workspaceFolder}/cpp/Ice/interceptor",
15+
"${workspaceFolder}/cpp/Ice/interleaved",
16+
"${workspaceFolder}/cpp/Ice/invoke",
17+
"${workspaceFolder}/cpp/Ice/latency",
18+
"${workspaceFolder}/cpp/Ice/locator",
19+
"${workspaceFolder}/cpp/Ice/mtalk",
20+
"${workspaceFolder}/cpp/Ice/multicast",
21+
"${workspaceFolder}/cpp/Ice/nested",
22+
"${workspaceFolder}/cpp/Ice/optional",
23+
"${workspaceFolder}/cpp/Ice/properties",
1124
"${workspaceFolder}/cpp/Ice/secure",
25+
"${workspaceFolder}/cpp/Ice/session",
26+
"${workspaceFolder}/cpp/Ice/throughput",
1227
],
1328
"cmake.configureSettings": {
1429
"Ice_HOME": "${workspaceFolder}/../ice",

cpp/Ice/bidir/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(bidir 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)
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/Ice/bidir/README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,43 @@
1+
# Bidirectional Connections
2+
13
This demo shows how to use [bidirectional connections][1] for callbacks.
24
This is typically used if the server cannot open a connection to the
35
client to send callbacks, for example, because firewalls block
46
incoming connections to the client.
57

8+
To build the demo run:
9+
10+
```shell
11+
cmake -B build
12+
cmake --build build --config Release
13+
```
14+
615
To run the demo, first start the server:
716

17+
**Linux/macOS:**
18+
19+
```shell
20+
./build/server
821
```
9-
server
22+
23+
**Windows:**
24+
25+
```shell
26+
build\Release\server
1027
```
1128

1229
In a separate window, start the client:
1330

31+
**Linux/macOS:**
32+
33+
```shell
34+
./build/client
1435
```
15-
client
36+
37+
**Windows:**
38+
39+
```shell
40+
build\Release\client
1641
```
1742

1843
[1]: https://doc.zeroc.com/ice/3.7/client-server-features/connection-management/bidirectional-connections

cpp/Ice/callback/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(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)
10+
11+
add_executable(server Server.cpp CallbackSenderI.cpp CallbackSenderI.h Callback.ice)
12+
slice2cpp_generate(server)
13+
target_link_libraries(server Ice::Ice)

cpp/Ice/callback/README.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,44 @@
1+
# Callback
2+
13
A simple callback demo that illustrates how a client can pass a proxy
24
to a server, invoke an operation in the server, and the [server call
35
back][1] into an object provided by the client as part of that invocation.
46

57
To run the demo, first start the server:
68

9+
To build the demo run:
10+
11+
```shell
12+
cmake -B build
13+
cmake --build build --config Release
14+
```
15+
16+
To run the demo, first start the server:
17+
18+
**Linux/macOS:**
19+
20+
```shell
21+
./build/server
722
```
8-
server
23+
24+
**Windows:**
25+
26+
```shell
27+
build\Release\server
928
```
1029

1130
In a separate window, start the client:
1231

32+
**Linux/macOS:**
33+
34+
```shell
35+
./build/client
1336
```
14-
client
37+
38+
**Windows:**
39+
40+
```shell
41+
build\Release\client
1542
```
1643

1744
[1]: https://doc.zeroc.com/ice/3.7/client-server-features/the-ice-threading-model/nested-invocations

cpp/Ice/context/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(context CXX)
4+
5+
include(../../cmake/common.cmake)
6+
7+
add_executable(client Client.cpp Context.ice)
8+
slice2cpp_generate(client)
9+
target_link_libraries(client Ice::Ice)
10+
11+
add_executable(server Server.cpp ContextI.cpp ContextI.h Context.ice)
12+
slice2cpp_generate(server)
13+
target_link_libraries(server Ice::Ice)

cpp/Ice/context/README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,40 @@
1+
# Context
2+
13
This demo illustrates how to use [request contexts][1].
24

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

14+
**Linux/macOS:**
15+
16+
```shell
17+
./build/server
518
```
6-
server
19+
20+
**Windows:**
21+
22+
```shell
23+
build\Release\server
724
```
825

926
In a separate window, start the client:
1027

28+
**Linux/macOS:**
29+
30+
```shell
31+
./build/client
1132
```
12-
client
33+
34+
**Windows:**
35+
36+
```shell
37+
build\Release\client
1338
```
1439

1540
[1]: https://doc.zeroc.com/ice/3.7/client-side-features/request-contexts

cpp/Ice/interceptor/AuthenticatorI.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) ZeroC, Inc.
22

3-
#include <AuthenticatorI.h>
3+
#include "AuthenticatorI.h"
4+
45
#include <Ice/Ice.h>
56
#include <iostream>
67

0 commit comments

Comments
 (0)