cdcseacave / openMVS

open Multi-View Stereo reconstruction library
http://cdcseacave.github.io
GNU Affero General Public License v3.0
3.39k stars 912 forks source link

2.3.0 is broken: error: <glog/logging.h> was not included correctly. See the documention for how to consume the library. #1139

Open yurivict opened 6 months ago

yurivict commented 6 months ago

Describe the bug Build breaks:

In file included from /usr/ports/graphics/openmvs/work/openMVS-2.3.0/libs/MVS/SceneRefine.cpp:1219:
In file included from /usr/local/include/ceres/ceres.h:38:
In file included from /usr/local/include/ceres/autodiff_cost_function.h:130:
In file included from /usr/local/include/ceres/internal/autodiff.h:147:
In file included from /usr/local/include/ceres/internal/array_selector.h:38:
In file included from /usr/local/include/ceres/internal/fixed_array.h:42:
/usr/local/include/glog/logging.h:60:4: error: <glog/logging.h> was not included correctly. See the documention for how to consume the library.
   60 | #  error <glog/logging.h> was not included correctly. See the documention for how to consume the library.
      |    ^
In file included from /usr/ports/graphics/openmvs/work/openMVS-2.3.0/libs/MVS/SceneRefine.cpp:1219:
In file included from /usr/local/include/ceres/ceres.h:38:
In file included from /usr/local/include/ceres/autodiff_cost_function.h:130:
In file included from /usr/local/include/ceres/internal/autodiff.h:147:
In file included from /usr/local/include/ceres/internal/array_selector.h:38:
In file included from /usr/local/include/ceres/internal/fixed_array.h:42:
In file included from /usr/local/include/glog/logging.h:63:
/usr/local/include/glog/flags.h:45:4: error: <glog/flags.h> was not included correctly. See the documention for how to consume the library.
   45 | #  error <glog/flags.h> was not included correctly. See the documention for how to consume the library.
      |    ^
/usr/local/include/glog/flags.h:105:1: error: unknown type name 'GLOG_EXPORT'
  105 | DECLARE_int32(logemaillevel);
      | ^

Desktop (please complete the following information):

glog-0.7.0

StefanBruens commented 3 days ago

Some CMake variables (notably, _USE_CERES) are scoped incorrectly, and then SceneRefine may include the ceres headers without pulling the INTERFACE_COMPILE_DEFINES from Ceres.