Allow new glog in SFM CMake Project #3296
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The latest version of glog provides native CMake support, meaning that find_package(glog) can be used without hassle. The Ceres project supports this. However, if Ceres finds the new glog, it sets variables glog_FOUND and not Glog_FOUND, which the CMakeLists.txt of the SFM module checks for. The assumption that glog has not been found then leads to errors later on, as valid variables are replaced with NOT-FOUND in the following search scripts.
This PR adds support for the new glog by simply checking for both Glog_FOUND AND glog_FOUND. While there may be more sophisticated ways to solve this (e.g. I would recommend updating FindGlog.cmake to the newest version included in Ceres) this seemed to be the minimal effort solution which worked for me, at least as a temporary fix before newer CMake find scripts are added.