Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thinks preferable that the IceBT demo build fails if IceBT is missing. So we just filter it from CI.

Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ jobs:
working-directory: ice-demos/cpp
run: |
set -o pipefail

# No IceBT on macOS
if [[ "$(uname)" == "Darwin" ]]; then
rm -rf IceBT
fi

find . -name CMakeLists.txt -type f | while IFS= read -r file; do
dir=$(dirname "$file");
cmake -B "$dir/build" -S "$dir" -DIce_DEBUG=ON
Expand All @@ -94,6 +100,9 @@ jobs:
timeout-minutes: 20
working-directory: ice-demos/cpp
run: |
# No IceBT on Windows
Remove-Item -Recurse -Force "IceBT"

Get-ChildItem -Recurse -Filter CMakeLists.txt | ForEach-Object {
$dir = $_.DirectoryName
cmake -B "$dir/build" -S "$dir" -DIce_DEBUG=ON
Expand Down
14 changes: 14 additions & 0 deletions cpp/IceBT/talk/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cmake_minimum_required(VERSION 3.16)

project(icegrid_allocate CXX)

include(../../cmake/common.cmake)

if(NOT TARGET Ice::BT)
message(FATAL_ERROR "IceBT is not available")
return()
endif()

add_executable(app App.cpp Talk.ice)
slice2cpp_generate(app)
target_link_libraries(app Ice::Ice Ice::BT)
11 changes: 10 additions & 1 deletion cpp/IceBT/talk/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
# IceBT Talk

This demo shows how to use [IceBT][1], the Bluetooth transport plug-in.
The command-line program allows you to hold a peer-to-peer talk session
with another device on Linux or Android.

To run the demo, just start the program:
To build the demo, run:

```shell
cmake -B build -S .
cmake --build build --config Release
```

To run the demo, just start the program:

```shell
talk
```

Expand Down
21 changes: 0 additions & 21 deletions cpp/cmake/IceConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,6 @@ if (NOT EXISTS ${Ice_HOME})
message(FATAL_ERROR "The specified Ice_HOME directory does not exist: ${Ice_HOME}")
endif()

# List of all available Ice components
set(Ice_AVAILABLE_COMPONENTS DataStorm Glacier2 Ice IceBox IceGrid IceStorm)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The _AVAILABLE_COMPONENTS was unnecessary


# IceBT is only available on Linux
# TODO: Check for required dependency
if(UNIX AND NOT APPLE)
list(APPEND Ice_AVAILABLE_COMPONENTS IceBT)
endif()

# Ensure Ice is always in the components list
if(NOT "Ice" IN_LIST Ice_FIND_COMPONENTS)
list(APPEND Ice_FIND_COMPONENTS Ice)
endif()

# Ensure requested components are valid
foreach(component ${Ice_FIND_COMPONENTS})
if(NOT component IN_LIST Ice_AVAILABLE_COMPONENTS)
message(FATAL_ERROR "Ice component '${component}' not found. Available: ${Ice_AVAILABLE_COMPONENTS}")
endif()
endforeach()

if(NOT DEFINED Ice_ARCHITECTURE)
if (CMAKE_LIBRARY_ARCHITECTURE)
set(Ice_ARCHITECTURE ${CMAKE_LIBRARY_ARCHITECTURE} CACHE STRING "Library architecture")
Expand Down
3 changes: 2 additions & 1 deletion cpp/cmake/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ find_package(Threads REQUIRED)

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

find_package(Ice REQUIRED CONFIG COMPONENTS DataStorm Glacier2 IceGrid IceBox IceStorm)
# IceBT is an optional component as it is not available in all distributions.
find_package(Ice REQUIRED CONFIG COMPONENTS Ice DataStorm Glacier2 IceGrid IceBox IceStorm OPTIONAL_COMPONENTS IceBT)
Loading