Related: flexible-collision-library/fcl#656
If the user does not specify CMAKE_BUILD_TYPE, the build root thinks the configuration is (empty string). However, due to include(CompilerSettings) in octomap/CMakeLists.txt, the actual library thinks it is Release. This results in the install step trying to install the configuration (empty string), but no corresponding exports exist, resulting in a broken installation.
This can be verified by the absense of octomap-targets-*.cmake files in an installation. For example:
FROM ubuntu:noble AS base
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -qq update && \
apt-get -qq --yes install \
libeigen3-dev \
libccd-dev \
git \
g++ \
cmake \
ninja-build
FROM base AS octomap
RUN git clone https://github.com/OctoMap/octomap /octomap
RUN mkdir /octomap/build && \
cmake \
-DCMAKE_POLICY_VERSION_MINIMUM=3.10 \
-G Ninja \
-S /octomap \
-B /octomap/build
RUN cd /octomap/build && ninja install
Removing include(CompilerSettings) seems to fix the problem; as expected, a octomap-targets-noconfig.cmake gets generated and installed. Alternatively, moving include(CompilerSettings) to the root CMakeLists.txt likely solves the issue as long as octomap is built stand-alone. If the latter approach is preferred, consider guarding the inclusion with if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) or something equivalent.
Related: flexible-collision-library/fcl#656
If the user does not specify
CMAKE_BUILD_TYPE, the build root thinks the configuration is (empty string). However, due toinclude(CompilerSettings)inoctomap/CMakeLists.txt, the actual library thinks it isRelease. This results in the install step trying to install the configuration (empty string), but no corresponding exports exist, resulting in a broken installation.This can be verified by the absense of
octomap-targets-*.cmakefiles in an installation. For example:Removing
include(CompilerSettings)seems to fix the problem; as expected, aoctomap-targets-noconfig.cmakegets generated and installed. Alternatively, movinginclude(CompilerSettings)to the rootCMakeLists.txtlikely solves the issue as long as octomap is built stand-alone. If the latter approach is preferred, consider guarding the inclusion withif(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)or something equivalent.