Skip to content

Commit

Permalink
roll back CMake changes for gflags
Browse files Browse the repository at this point in the history
  • Loading branch information
mleotta committed Jun 3, 2015
1 parent 8072698 commit 0dd6693
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Exercises/ceres/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ SET(CMAKE_BUILD_TYPE Release CACHE STRING
PROJECT(ceres_tutorial_exercises)

FIND_PACKAGE(Ceres REQUIRED)
FIND_PACKAGE(gflags REQUIRED)

INCLUDE_DIRECTORIES(${CERES_INCLUDE_DIRS})

ADD_EXECUTABLE(curve_fitting curve_fitting.cc read_matrix.cc)
TARGET_LINK_LIBRARIES(curve_fitting ${CERES_LIBRARIES} ${GFLAG_LIBRARIES})
TARGET_LINK_LIBRARIES(curve_fitting ${CERES_LIBRARIES} gflags)

This comment has been minimized.

Copy link
@pmoulon

pmoulon Jun 3, 2015

Collaborator

@mleotta I was thinking that ${CERES_LIBRARIES} already contains the gflags library if it is a dependency.

This comment has been minimized.

Copy link
@mleotta

mleotta Jun 3, 2015

Author Owner

@pmoulon It does not seem to contain gflags in the VM. Explicit linking to gflags is needed. FIND_PACKAGE doesn't work because the Ubuntu gflags package does not install a CMake configuration file, and CMake doesn't come with a FindGFlags module.

This comment has been minimized.

Copy link
@pmoulon

pmoulon Jun 3, 2015

Collaborator

👍


ADD_EXECUTABLE(bundle_adjuster ba_file.cc bundle_adjuster.cc)
TARGET_LINK_LIBRARIES(bundle_adjuster ${CERES_LIBRARIES} ${GFLAG_LIBRARIES})
TARGET_LINK_LIBRARIES(bundle_adjuster ${CERES_LIBRARIES} gflags)

1 comment on commit 0dd6693

@alexsmac
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi - gflags isn't in ${CERES_LIBRARIES} as Ceres itself never directly depends on gflags (it usually depends on glog which might in turn depend on gflags), only some of the examples that ship with Ceres depend on gflags.

There is a FindGflags that ships with Ceres (in /cmake) that works with gflags installs without exported CMake configurations if it's helpful.

Please sign in to comment.