diff --git a/CMakeLists.txt b/CMakeLists.txt index 78324dd..0872eaf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,9 +9,16 @@ endif() set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/") +option(BUILD_SHARED_LIBS "Build shared libraries" ON) + # MOOS-IvP's helm libraries (IVP_BUILD_HELM_LIBS_ONLY) find_package(IVP CONFIG REQUIRED) +find_package(GOBY 3.0 COMPONENTS zeromq) +if(NOT GOBY_FOUND) + message(STATUS "Goby3 not found: not building the Goby app") +endif() + include(CTest) add_subdirectory(src) diff --git a/README.md b/README.md index 9421a49..27f4f40 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ One way to think of this project is as a generator for the equivalent of the MOO *This section was written by Claude.* -`init.sh` checks out the submodules and installs the Ubuntu packages needed to build them and IvPico. `build.sh` then builds, all in `build/`: +`init.sh` checks out the submodules and installs the Ubuntu packages needed to build them and IvPico. These include Goby3 from [packages.gobysoft.org](http://packages.gobysoft.org), for the Goby app; without Goby3, `build.sh` skips the Goby app. `build.sh` then builds, all in `build/`: - openocean-messages, into `build/external/openocean-messages`; - MOOS-IvP's helm libraries (`IVP_BUILD_HELM_LIBS_ONLY`, as shared libraries, without MOOS or its apps), into `build/external/moos-ivp`, installed into `build/external/install` for `find_package(IVP)`; diff --git a/external/moos-ivp b/external/moos-ivp index be40e2c..7ccebd2 160000 --- a/external/moos-ivp +++ b/external/moos-ivp @@ -1 +1 @@ -Subproject commit be40e2c7cef168be29f57a756df6a16a1c7882f1 +Subproject commit 7ccebd29912d6a884c34efb744856310f21d97ff diff --git a/init.sh b/init.sh index 1821fc7..08ce4aa 100755 --- a/init.sh +++ b/init.sh @@ -25,9 +25,25 @@ if [ "$(id -u)" -ne 0 ]; then SUDO=sudo fi +apt_install() { + $SUDO env DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends "$@" +} + # moos-ivp's helm libraries (IVP_BUILD_HELM_LIBS_ONLY) need only CMake and a compiler -packages=(cmake ninja-build g++ git ca-certificates protobuf-compiler libprotobuf-dev) +packages=(cmake ninja-build g++ git ca-certificates protobuf-compiler libprotobuf-dev curl gpg) +$SUDO apt-get update +apt_install "${packages[@]}" + +# Goby3, for src/bin/goby, from packages.gobysoft.org +keyring=/usr/share/keyrings/gobysoft-archive-keyring.gpg +if [ ! -f "${keyring}" ]; then + curl -fsSL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x19478082E2F8D3FE" | + gpg --dearmor | $SUDO tee "${keyring}" > /dev/null +fi +. /etc/os-release +echo "deb [signed-by=${keyring}] http://packages.gobysoft.org/${ID}/release/ ${VERSION_CODENAME}/" | + $SUDO tee /etc/apt/sources.list.d/gobysoft_release.list > /dev/null $SUDO apt-get update -$SUDO env DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends "${packages[@]}" +apt_install libgoby3-dev goby3-apps external/openocean-messages/init.sh --cxx diff --git a/src/bin/CMakeLists.txt b/src/bin/CMakeLists.txt index 31b40da..f162b61 100644 --- a/src/bin/CMakeLists.txt +++ b/src/bin/CMakeLists.txt @@ -1,4 +1,6 @@ -add_subdirectory(goby) +if(GOBY_FOUND) + add_subdirectory(goby) +endif() add_subdirectory(ros)