← All tasks
cppRainerKuemmerle/g2o #885Not a task: not reproduced

Allow g2o to obey a local CMake install

envgap__RainerKuemmerle__g2o-885

01 / FAILURE SIGNATURE

As reported upstream

file cannot create directory: /usr/local/include/g2o.  Maybe need
Not a benchmark task.
  • In a clean container the reported failure did not reproduce, or the known fix did not make the project run.

02 / ENVIRONMENT RECIPE

Base commit
100af05931ae3497f39ab42cbeba240f50cc7b66
Manifest
CMakeLists.txt
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

RainerKuemmerle/g2o #885 · read the original issue
# Background

I would like to install g2o on my system to a local directory without root priviledges.
Well behaved CMake libraries follow this pattern.

# Steps to reproduce

OS: Ubuntu 22
CMake version: 3.31.3 (newer than default)
g20 version: latest master, hash 100af05931ae3497f39ab42cbeba240f50cc7b66

```bash
cmake -B build
cmake --build build
cmake --install build --prefix install
```

# Expected behavior

g2o will install into the local `install` directory

# Actual behavior

```
ryan@B650-970:~/Dev/odm_ws/src/g2o$ cmake --install build --prefix install
-- Install configuration: "Release"
CMake Error at build/cmake_install.cmake:54 (file):
  file cannot create directory: /usr/local/include/g2o.  Maybe need
  administrative privileges.
```

The CMAKE_INSTALL_PREFIX is not obeyed, and g2o tries to install in /usr/local/include.

# Recommendations

Use [GnuInstallDirs](https://cmake.org/cmake/help/v3.31/module/GNUInstallDirs.html) when setting install directories. Avoid hard-coding absolute paths. 

Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]