OpenSfM
OpenSfM copied to clipboard
Issue locating gflags header file on Fedora
Trying to build OpenSfM on my local Fedora (32) system.
python setup.py build
Results the following error:
...
-- Found installed version of gflags: /usr/lib64/cmake/gflags
-- Detected gflags version: 2.2.2
CMake Error at cmake/FindGflags.cmake:118 (message):
Failed to find gflags - Could not find file: //include/gflags/gflags.h
containing namespace information in gflags install located at: //include.
Call Stack (most recent call first):
cmake/FindGflags.cmake:215 (gflags_report_not_found)
cmake/FindGflags.cmake:398 (gflags_check_gflags_namespace_using_regex)
CMakeLists.txt:39 (find_package)
...
Like you can see gflags
was detected, however the header file cannot be found.
The header file is located on the system in the following location: /usr/include/gflags/gflags.h
This issue can be solved by adding the following line under regex detect section:
function(GFLAGS_CHECK_GFLAGS_NAMESPACE_USING_REGEX)
...
set(GFLAGS_INCLUDE_DIR /usr/include/)
But that of course will break other things and should properly fixed.
It's worth to mention that /usr/include
is added to GFLAGS_CHECK_INCLUDE_DIRS
but only when if (NOT GFLAGS_FOUND)
, however in my case, it was found.
Should be easy fix, but I didn't manage to figure this out yet.