When compiling with KDevelop, my CMakeList.txt There’s an error in the file. It’s mine CMakeList.txt The code in the file is as follows:
the errors are as follows:
The solution is as follows:
you need to CMakeList.txt Modify the following code in the file:
1. First of all, you need to find the location of your g2o installation: find the g2o folder – right click the properties to see
Add
list (APPEND CMAKE_ MODULE_ PATH ${PROJECT_ SOURCE_ DIR}/cmake)
Amend to read
list(APPEND CMAKE_ MODULE_ Path/home/fan/desktop/g2o master/cmake_ modules)
Among them,
/Home/fan/desktop/g2o master/cmake_ Modules// where to install your own g2o files
2. Add an extra set
set(G2O_ ROOT /usr/local/include/g2o)
After completing the above steps, there will be no problem with the build and it can be executed smoothly.
The code is as follows
cmake_ minimum_ required(VERSION 2.8)
project(go)
set(CMAKE_ BUILD_ TYPE Release)
set(CMAKE_ CXX_ FLAGS “-std=c++14 -O3”)
list(APPEND CMAKE_ MODULE_ Path/home/fan/desktop/g2o master/cmake_ modules)
set(G2O_ ROOT /usr/local/include/g2o)find_ package(OpenCV REQUIRED)
include_ directories(${OpenCV_ INCLUDE_ DIRS})find_ package(G2O REQUIRED)
include_ directories(${G2O_ INCLUDE_ DIRS})include_ directories(“/usr/include/eigen3”)
add_ executable(go main.cpp )
target_ link_ libraries(go ${OpenCV_ LIBS} ${G2O_ CORE_ LIBRARY} ${G2O_ STUFF_ LIBRARY})
Read More:
- CMake Error at CMakeLists.txt:5 (PROJECT): The CMAKE_C_COMPILER: cl is not a full path
- The CXX compiler identification is unknown CMake Error at CMakeLists.txt:11 (project):
- CMake Error: Could not find CMAKE_ROOT !!!
- gazebo7 CMake Error:Could not find a package configuration file provided by “gazebo_plugins“
- Clion appears cmake error: could not find cmake_ Root! What is the problem and how to solve it?
- CMake Error: The source directory “opencv_install_catalog“ does not appear to contain CMakeLists.txt.
- CMake Error:Could not find CMAKE_ROOT!!!
- CMake Error: The source directory “*” does not appear to contain CMakeLists.txt.
- CMake Error: The source directory “/home/Demo1“ does not appear to contain CMakeLists.txt.
- The collapse pits of VTK projects that are not generated by cmake
- Project files may be invalid appears when cmake compiles opencv3.1, and the debug additional dependency of the compiled opencv3.1 is at the end
- Cmake error on qt5core
- [Solved] KEIL Error: source file ‘.XXX.o‘ – object file renamed from ‘XXX.o‘ to …
- Unexpected token o in JSON at p
- [VTK] cmake compiling VTK
- Execute cmake.. error: cannot find llvm lit
- Problems in compiling VTK with cmake: solutions to error configuration process, project files may be invalid
- “Error in configuration process project files may be invalid” appears during cmake compilation
- An I/O operation initiated by the Registry failed unrecoverably
- Cmake compile opencv report error qtcore_ DIR QtOpenglDIR QtGui_ Dir ffmpeg loading failed