My problem is similar to this: http://www.eclipse.org/forums/index.php/m/649323/
I created a cmake project and used
cmake .. -G "Eclipse CDT4 - Unix Makefiles"
to create an Eclipse CDT4 project.
But the standard included paths are not listed in the CDT IDE, and all STL or System build-in headers include directives labeled “cannot be resolved,” so “Open Declaration” or other major operation cannot be done.
However, I could compile it without any problems.
My colleague also has a cmake project, but it is very complicated. The CDT project, created from his cmake project, includes a system. But his cmake is too complicated, and he told me that he did nothing special to include the system paths.
Can anyone help me out? Thank.
My Main CMakeLists.txt:
CMake_Minimum_Required(VERSION 2.8)
Set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
CMake_Policy(SET CMP0015 NEW)
Project(MyProjectName CXX)
Set(CMAKE_CXX_COMPILER /usr/bin/g++)
If (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
Message(FATAL_ERROR "In-source building is not allowed! Please create a 'build' folder and then do 'cd build; cmake ..'")
EndIf()
Set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
Set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
Add_Subdirectory(src)
Peter
One way is to manually add them to the CDT IDE:
/usr/include/c++/4.5
/usr/include/c++/4.5/backward
/usr/include/c++/4.5/i686-linux-gnu
/usr/include/i386-linux-gnu
/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/include
/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/include-fixed
/usr/local/include
But this is not a solution.
source
share