Install OpenMVGThe openMVG library contains and rebuilds almost all of the dependencies required during a source install, so simply clone it using:
Then build it in a separate directory with:
git clone --recursive https://github.com/openMVG/openMVG.git cd openMVG git submodule init git submodule update cd ..
Note the custom install directory – this can be changed fairly easily, since the application will use the supplied cmake files in the install to locate the headers & libraries.
mkdir openMVG_Build cd openMVG_Build/ cmake \ -DCMAKE_BUILD_TYPE=DEBUG \ -DOpenMVG_BUILD_TESTS=ON \ -DopenMVG_BUILD_EXAMPLES=ON \ -DCMAKE_INSTALL_PREFIX:STRING="/usr/local/openMVG_install" \ -G "CodeBlocks - Unix Makefiles" . ../openMVG/src/ make clean make -j4 sudo make install
Adding the Library to an ApplicationThis is all driven through cmake, with the target CmakeLists.txt containing the following fragment to locate the openMVG libraries and headers.
It's actually slightly painful to use anything other than cmake here; the library include and link paths are rather verbose.
set(OpenMVG_DIR "/usr/local/openMVG_install/share/openMVG/cmake") set(CMAKE_BUILD_TYPE "Debug") ADD_DEFINITIONS( -std=c++11 )
Note that C++ 11 is required for the smart pointers used by the openSfM library.