Skip to content

Commit dc2b2d6

Browse files
authored
Add IceBT CMakeLists.txt (#282)
1 parent 34fb7c5 commit dc2b2d6

File tree

5 files changed

+35
-23
lines changed

5 files changed

+35
-23
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ jobs:
8383
working-directory: ice-demos/cpp
8484
run: |
8585
set -o pipefail
86+
87+
# No IceBT on macOS
88+
if [[ "$(uname)" == "Darwin" ]]; then
89+
rm -rf IceBT
90+
fi
91+
8692
find . -name CMakeLists.txt -type f | while IFS= read -r file; do
8793
dir=$(dirname "$file");
8894
cmake -B "$dir/build" -S "$dir" -DIce_DEBUG=ON
@@ -94,6 +100,9 @@ jobs:
94100
timeout-minutes: 20
95101
working-directory: ice-demos/cpp
96102
run: |
103+
# No IceBT on Windows
104+
Remove-Item -Recurse -Force "IceBT"
105+
97106
Get-ChildItem -Recurse -Filter CMakeLists.txt | ForEach-Object {
98107
$dir = $_.DirectoryName
99108
cmake -B "$dir/build" -S "$dir" -DIce_DEBUG=ON

cpp/IceBT/talk/CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
cmake_minimum_required(VERSION 3.16)
2+
3+
project(icegrid_allocate CXX)
4+
5+
include(../../cmake/common.cmake)
6+
7+
if(NOT TARGET Ice::IceBT)
8+
message(FATAL_ERROR "IceBT is not available")
9+
return()
10+
endif()
11+
12+
add_executable(app App.cpp Talk.ice)
13+
slice2cpp_generate(app)
14+
target_link_libraries(app Ice::Ice Ice::IceBT)

cpp/IceBT/talk/README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1+
# IceBT Talk
2+
13
This demo shows how to use [IceBT][1], the Bluetooth transport plug-in.
24
The command-line program allows you to hold a peer-to-peer talk session
35
with another device on Linux or Android.
46

5-
To run the demo, just start the program:
7+
To build the demo, run:
68

9+
```shell
10+
cmake -B build -S .
11+
cmake --build build --config Release
712
```
13+
14+
To run the demo, just start the program:
15+
16+
```shell
817
talk
918
```
1019

cpp/cmake/IceConfig.cmake

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,6 @@ if (NOT EXISTS ${Ice_HOME})
1111
message(FATAL_ERROR "The specified Ice_HOME directory does not exist: ${Ice_HOME}")
1212
endif()
1313

14-
# List of all available Ice components
15-
set(Ice_AVAILABLE_COMPONENTS DataStorm Glacier2 Ice IceBox IceGrid IceStorm)
16-
17-
# IceBT is only available on Linux
18-
# TODO: Check for required dependency
19-
if(UNIX AND NOT APPLE)
20-
list(APPEND Ice_AVAILABLE_COMPONENTS IceBT)
21-
endif()
22-
23-
# Ensure Ice is always in the components list
24-
if(NOT "Ice" IN_LIST Ice_FIND_COMPONENTS)
25-
list(APPEND Ice_FIND_COMPONENTS Ice)
26-
endif()
27-
28-
# Ensure requested components are valid
29-
foreach(component ${Ice_FIND_COMPONENTS})
30-
if(NOT component IN_LIST Ice_AVAILABLE_COMPONENTS)
31-
message(FATAL_ERROR "Ice component '${component}' not found. Available: ${Ice_AVAILABLE_COMPONENTS}")
32-
endif()
33-
endforeach()
34-
3514
if(NOT DEFINED Ice_ARCHITECTURE)
3615
if (CMAKE_LIBRARY_ARCHITECTURE)
3716
set(Ice_ARCHITECTURE ${CMAKE_LIBRARY_ARCHITECTURE} CACHE STRING "Library architecture")

cpp/cmake/common.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ 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 DataStorm Glacier2 IceGrid IceBox IceStorm)
10+
# IceBT is an optional component as it is not available in all distributions.
11+
find_package(Ice REQUIRED CONFIG COMPONENTS Ice DataStorm Glacier2 IceGrid IceBox IceStorm OPTIONAL_COMPONENTS IceBT)

0 commit comments

Comments
 (0)