Invalid CMake Syntax

Bug #1921113 reported by Daniel Mohan Sahu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ceres-solver (Ubuntu)
New
Undecided
Unassigned

Bug Description

When attempting a cmake build with the default apt installed `libceres-dev` I encountered the following error:

```
CMake Error at /usr/lib/cmake/ceres/CeresConfig.cmake:89 (else):
  Flow control statements are not properly nested.
Call Stack (most recent call first):
  CMakeLists.txt:26 (find_package)
```

Digging into `/usr/lib/cmake/ceres/CeresConfig.cmake:89`, it looks like line 87 should be `elseif`, not `else`. Manually editing the file and rebuilding fixes my build.

```
85 if (Ceres_FIND_QUIETLY)
86 message(STATUS "Failed to find Ceres - " ${REASON_MSG} ${ARGN})
87 else (Ceres_FIND_REQUIRED)
88 message(FATAL_ERROR "Failed to find Ceres - " ${REASON_MSG} ${ARGN})
89 else()
```

I'm not sure how this got mangled as the source code version seems to be right (see link). We've also been using this package / installation method for quite a while without any issues, so I believe this is a new problem (as of 03/23).
https://github.com/ceres-solver/ceres-solver/blob/master/cmake/CeresConfig.cmake.in

Other information:
# lsb_release -rd
Description: Ubuntu 16.04.7 LTS
Release: 16.04

# apt-cache policy libceres-dev
libceres-dev:
  Installed: 1.12.0+dfsg0-5
  Candidate: 1.12.0+dfsg0-5
  Version table:
 *** 1.12.0+dfsg0-5 100
        100 /var/lib/dpkg/status

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.