cmake config broken

Bug #1678043 reported by Christian Lins on 2017-03-31
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
ceres-solver (Ubuntu)
Undecided
Unassigned

Bug Description

It is not possible to use libceres with cmake.

Using this minimal example:

CMakeLists.txt:
FIND_PACKAGE(Ceres REQUIRED)

Produces this error:
$ cmake -DCMAKE_BUILD_TYPE=Debug -G "Unix Makefiles"
CMake Error at /usr/lib/cmake/ceres/CeresConfig.cmake:88 (message):
  Failed to find Ceres - Ceres install root: /usr/lib, determined from
  relative path from CeresConfig.cmake install location:
  /usr/lib/cmake/ceres, does not contain Ceres headers. Either the install
  directory was deleted, or the install tree was only partially relocated
  outside of CMake after Ceres was built.
Call Stack (most recent call first):
  /usr/lib/cmake/ceres/CeresConfig.cmake:136 (ceres_report_not_found)
  CMakeLists.txt:1 (FIND_PACKAGE)

CMake Error at CMakeLists.txt:1 (FIND_PACKAGE):
  Found package configuration file:

    /usr/lib/cmake/ceres/CeresConfig.cmake

  but it set Ceres_FOUND to FALSE so package "Ceres" is considered to be NOT
  FOUND.

CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present. A line of code such as

    cmake_minimum_required(VERSION 3.5)

  should be added at the top of the file. The version specified may be lower
  if you wish to support older CMake versions for this project. For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!
See also "/home/clins/repos/cerestest/CMakeFiles/CMakeOutput.log".

Please state the package version.

Christian Lins (cli) wrote :

3.5.2-2ubuntu1

That can't be right.
The version is one of

 1.11.0~dfsg0-2
 1.11.0~dfsg0-5
 1.12.0+dfsg0-1

It should be fixed in 1.11.0~dfsg0-5 and newer,
for 1.11.0~dfsg0-2 this has already been reported here:
https://bugs.launchpad.net/ubuntu/+source/ceres-solver/+bug/1596296

Christian Lins (cli) wrote :

Ah, sorry. I posted the cmake version...

1.11.0~dfsg0-5 is my installed (and broken) version of libceres1 and libceres-dev.

Changed in ceres-solver (Ubuntu):
status: New → Confirmed

Well, I have no idea why cmake does not find Ceres in /usr/include/ceres/.

It works fine on Debian, so Ubuntu must be doing something different regarding cmake.

There might be a workaround by specifying CERES_INCLUDE_DIRS manually.

Ayon Sen (asenob) wrote :

Hi,

I ran into this bug as well, and I think the install file is not set up correctly to install the files that allow CMake to find the library.

I built a version of the package locally on my Ubuntu 16.04 machine that fixes the issue by replacing libceres-dev.install with the following:

usr/include
usr/lib/lib*.so
usr/lib/cmake

I believe that's all I had to do, but I will double-check.

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

Other bug subscribers