When trying to build with python setup.py build I ran into numerous errors due to not found headers. However the dependencies were already present and installed using brew, e.g. brew install gflags opencv ...
python 3.7.7
cmake version 3.17.2
macos 10.15.4.
Example error:
[ 29%] Building C object third_party/vlfeat/CMakeFiles/vl.dir/vl/kmeans.c.o
/OpenSfM/opensfm/src/third_party/gtest/gmock_main.cc:33:10: fatal error: 'gflags/gflags.h' file not found
#include "gflags/gflags.h"
^~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/gtest.dir/third_party/gtest/gmock_main.cc.o] Error 1
I had to add include_directories(${GLOG_INCLUDE_DIRS} ${GFLAGS_INCLUDE_DIRS}) after the find_packages command to fix the build for my setup.
I'm not familiar with cmake and the particulars of its build system but the include_directories command was found via this stackoverflow answer. Using it and other "whack-a-mole" modifications to the CMakeLists.txt allowed a successful build
When trying to build with
python setup.py build
I ran into numerous errors due tonot found headers
. However the dependencies were already present and installed using brew, e.g.brew install gflags opencv ..
.Example error:
I had to add
include_directories(${GLOG_INCLUDE_DIRS} ${GFLAGS_INCLUDE_DIRS})
after thefind_packages
command to fix the build for my setup.The complete set of changes which I made.
I'm not familiar with cmake and the particulars of its build system but the
include_directories
command was found via this stackoverflow answer. Using it and other "whack-a-mole" modifications to the CMakeLists.txt allowed a successful build