chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
cmake_minimum_required(VERSION 3.16...3.27)
|
||||
|
||||
# If you use the example outside of the Rerun SDK you need to specify
|
||||
# where the rerun_c build is to be found by setting the `RERUN_CPP_URL` variable.
|
||||
# This can be done by passing `-DRERUN_CPP_URL=<path to rerun_sdk_cpp zip>` to cmake.
|
||||
if(DEFINED RERUN_REPOSITORY)
|
||||
add_executable(example_spawn_viewer main.cpp)
|
||||
rerun_strict_warning_settings(example_spawn_viewer)
|
||||
else()
|
||||
project(example_spawn_viewer LANGUAGES CXX)
|
||||
|
||||
add_executable(example_spawn_viewer main.cpp)
|
||||
|
||||
# Set the path to the rerun_c build.
|
||||
set(RERUN_CPP_URL "https://github.com/rerun-io/rerun/releases/latest/download/rerun_cpp_sdk.zip" CACHE STRING "URL to the rerun_cpp zip.")
|
||||
|
||||
# Download the rerun_sdk
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(rerun_sdk URL ${RERUN_CPP_URL})
|
||||
FetchContent_MakeAvailable(rerun_sdk)
|
||||
endif()
|
||||
|
||||
# Link against rerun_sdk.
|
||||
target_link_libraries(example_spawn_viewer PRIVATE rerun_sdk)
|
||||
@@ -0,0 +1,13 @@
|
||||
<!--[metadata]
|
||||
title = "Spawn Viewer"
|
||||
tags = ["Spawn"]
|
||||
-->
|
||||
|
||||
|
||||
Shows how to spawn a new Rerun Viewer process ready to listen for gRPC connections using an executable available in PATH.
|
||||
|
||||
```bash
|
||||
cmake .
|
||||
cmake --build . --target spawn_viewer
|
||||
./examples/cpp/spawn_viewer/spawn_viewer
|
||||
```
|
||||
@@ -0,0 +1,5 @@
|
||||
#include <rerun.hpp>
|
||||
|
||||
int main() {
|
||||
rerun::spawn().exit_on_failure();
|
||||
}
|
||||
Reference in New Issue
Block a user