Closed chaiein closed 6 years ago
I used following lines but new error is encountered
LIST( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules )
SET( G2O_ROOT /home/chaien/VR/PLSLAM/g2o )
FIND_PACKAGE( G2O )
:-1: error: [cmake_check_build_system] Error 1 Make Warning at CMakeLists.txt:10 (find_package): By not providing "FindG2O.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "G2O", but CMake did not find one.
Could not find a package configuration file provided by "G2O" with any of the following names:
G2OConfig.cmake
g2o-config.cmake
Add the installation prefix of "G2O" to CMAKE_PREFIX_PATH or set "G2O_DIR" to a directory containing one of the above files. If "G2O" provides a separate development package or SDK, be sure it has been installed.
-- Configuring incomplete, errors occurred! See also "/home/chaiein/VR/PLSLAM/pl-slam-build/CMakeFiles/CMakeOutput.log". See also "/home/chaiein/VR/PLSLAM/pl-slam-build/CMakeFiles/CMakeError.log". Makefile:578: recipe for target 'cmake_check_build_system' failed CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: G2O_INCLUDE_DIR used as include directory in directory /home/chaiein/VR/PLSLAM/pl-slam used as include directory in directory /home/chaiein/VR/PLSLAM/pl-slam used as include directory in directory /home/chaiein/VR/PLSLAM/pl-slam used as include directory in directory /home/chaiein/VR/PLSLAM/pl-slam used as include directory in directory /home/chaiein/VR/PLSLAM/pl-slam used as include directory in directory /home/chaiein/VR/PLSLAM/pl-slam
make: *** [cmake_check_build_system] Error 1 13:28:02: The process "/usr/bin/make" exited with code 2. Error while building/deploying project PL-SLAM (kit: Desktop) When executing step "Make"
@chaiein how can you solve this problem. I added three line into camkelists, this error was still on. LIST( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules ) SET( G2O_ROOT /home/cc/test/g2o-master ) FIND_PACKAGE( G2O )
Your G2O_INCLUDE_DIR is not in the list. To solve this problem, you can do a system wide installation.
Run
sudo make install
from g2o build directory
Then you will see g2o is added to /usr/local/include/
@chaiein how can you solve this problem. I added three line into camkelists, this error was still on. LIST( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules ) SET( G2O_ROOT /home/cc/test/g2o-master ) FIND_PACKAGE( G2O )
Add a folder calls "cmake_module" in pl-slam, and touch a file "FindG2O.cmake" in the folder, the problem can be solved.
This is "FindG2O.cmake": https://github.com/gaoxiang12/slambook/blob/master/ch6/g2o_curve_fitting/cmake_modules/FindG2O.cmake
``CMake Error at CMakeLists.txt:7 (find_package): By not providing "FindG2O.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "G2O", but CMake did not find one.
Could not find a package configuration file provided by "G2O" with any of the following names:
Add the installation prefix of "G2O" to CMAKE_PREFIX_PATH or set "G2O_DIR" to a directory containing one of the above files. If "G2O" provides a separate development package or SDK, be sure it has been installed.
-- Configuring incomplete, errors occurred!