• Alex Stewart's avatar
    Fix missing gflags imported target definition in CeresConfig.cmake · 523e397b
    Alex Stewart authored
    - If gflags was built & exported with CMake but glog was not, but both
      were found then as we now make gflags a public dependency of Ceres if
      both it and glog are found, the *name* of the exported gflags CMake
      target (gflags-shared or similar) will appear in CERES_LIBRARIES.
    - However, as imported targets are not re-exported, this results in a
      linker error when compiling client code, as the name of the exported
      gflags target is not known to CMake, it assumes it is a library name,
      which it is not.
    - Confusingly, if glog was built with CMake, this problem would not
      occur, as in that case glog’s CMake target would bring in gflags’.
    - Now we explicitly call find_package(Gflags) in CeresConfig.cmake if
      Ceres was built with gflags as a public dependency (via glog).
    
    Change-Id: I5cc9483a1fae50f4e9e3a8fbba491b645fd45db6
    523e397b