From 5df3871ea06311cf3eaba998c3408f9213a6a6d9 Mon Sep 17 00:00:00 2001 From: Mike Langmayr Date: Thu, 22 Oct 2026 17:10:47 -0700 Subject: [PATCH] Find ImageStreamIO in /usr/local/lib/cmake without ImageStreamIO_DIR --- README.md | 6 +++--- docs/configuration/index.md | 2 +- utils/CMakeLists.txt | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5634f90..031eafd 100644 --- a/README.md +++ b/README.md @@ -50,10 +50,10 @@ If you encounter any problems or have questions about this project, please open `-DINTERFACE_TYPE=` is separate from `-DCONTROLLER=` and selects only which emulator is built. It defaults to `Archon`; `-DINTERFACE_TYPE=AstroCam` skips the emulator, since none is implemented for ARC. - To enable the shared-memory output (`SHM_ENABLED` in a `.cfg` file, see [Frame Outputs](#frame-outputs) below), add `-DENABLE_SHM_OUTPUT=ON -DImageStreamIO_DIR=/lib/cmake`: + To enable the shared-memory output (`SHM_ENABLED` in a `.cfg` file, see [Frame Outputs](#frame-outputs) below), add `-DENABLE_SHM_OUTPUT=ON`: ```bash - $ cmake -DENABLE_SHM_OUTPUT=ON -DImageStreamIO_DIR=/usr/local/lib/cmake .. + $ cmake -DENABLE_SHM_OUTPUT=ON .. ``` This requires [ImageStreamIO](https://github.com/milk-org/ImageStreamIO) to already be built and installed, since it isn't packaged for common distros: @@ -66,7 +66,7 @@ If you encounter any problems or have questions about this project, please open $ sudo make install ``` - ImageStreamIO's own `Config.cmake` files install directly under `/lib/cmake/` rather than the CMake-conventional `/lib/cmake/ImageStreamIO/`, so `-DImageStreamIO_DIR=...` must always be given explicitly, even for a standard system-wide install. + ImageStreamIO's own `Config.cmake` files install directly under `/lib/cmake/` rather than the CMake-conventional `/lib/cmake/ImageStreamIO/`. The build looks in `/usr/local/lib/cmake` for them; for any other prefix pass `-DImageStreamIO_DIR=/lib/cmake`. To build the Python module (see [Python Module](#python-module) below), add `-DBUILD_PYTHON_MODULE=ON`. It is off by default, so builds that don't want it never need pybind11. To install it into an environment rather than build it here, see [Installing with pip](#installing-with-pip) instead, which fetches pybind11 itself: diff --git a/docs/configuration/index.md b/docs/configuration/index.md index d0e2e5b..1815950 100644 --- a/docs/configuration/index.md +++ b/docs/configuration/index.md @@ -48,7 +48,7 @@ These are CMake options, fixed when the software is compiled, not `.cfg` keys. |---|---|---| | `CONTROLLER` | none, required | `archon` or `astrocam`. CMake errors out if unset. | | `INTERFACE_TYPE` | `Archon` | Selects which emulator is built, independently of `CONTROLLER`. `AstroCam` builds none, since none exists for ARC. | -| `ENABLE_SHM_OUTPUT` | `OFF` | Build the ImageStreamIO shared-memory output. Also needs `-DImageStreamIO_DIR=/lib/cmake`. | +| `ENABLE_SHM_OUTPUT` | `OFF` | Build the ImageStreamIO shared-memory output. Found in `/usr/local/lib/cmake`; pass `-DImageStreamIO_DIR=/lib/cmake` for another prefix. | | `BUILD_PYTHON_MODULE` | `OFF` | Build the `camera_interface` Python module. Needs pybind11 at compile time only. | | `CMAKE_INSTALL_PREFIX` | `/usr/local` | Where `make install` puts binaries and the module | diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index fe1ba83..9965994 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -24,7 +24,9 @@ add_library(network STATIC target_link_libraries(network nlohmann_json::nlohmann_json) if(ENABLE_SHM_OUTPUT) - find_package(ImageStreamIO CONFIG REQUIRED) + # Upstream installs its config straight into lib/cmake, which CMake does not + # search on its own + find_package(ImageStreamIO CONFIG REQUIRED PATHS /usr/local/lib/cmake) add_library(shared_memory_writer STATIC ${PROJECT_UTILS_DIR}/shared_memory_writer.cpp