MantisBT - CMake
View Issue Details
0015102CMakeCMakepublic2014-08-23 04:522016-06-10 14:31
David Pajak 
Alex Neundorf 
normalmajoralways
closedmoved 
x86-64Ubuntu14.04
CMake 3.0.1 
 
0015102: Eclipse CDT generator produces incorrect CDT indexer configuration when calling with any custom compiler switches
Hi Guys,

I found a problem with Eclipse CDT project generator. Specifically, the CMake is unable to create a completely filled include/symbol list for the CDT indexer when using GCC flags that modify the built-in preprocessor symbol list. Examples are "-std=c++11" (enable C++11 support) or "-msse4.1" (enable SSE4.1 SIMD instruction set). I wrote a self-containing example that exposes the issue.

For some reason, CMake does not add compile options that I specify through target_compile_options() to the argument list for the GCC symbol query call. It does however include the definitions added via add_definitions(). I think this should be fixed.

One way to walk around it is to pass the compiler flags to GCC via CMAKE_CXX_COMPILER_ARG1 which is used during symbol query. But this is A) hacky B) seem to affect all other files in the project C) only allows to specify *a single* compiler switch. The C) is particularly weird...
1. Download the archive attached to the bug report
2. Set up an Eclipse project in the directory where CMakeLists.txt is, e.g., "cmake -G"Eclipse CDT4 - Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_ECLIPSE_VERSION=4.3"
3. Import the project to Eclipse
4. Look at the indexer failing in two main points:
A) Unrecognized std::function<> -- this template is in C++11 -- it is not visible because CMake does not pass -std=c++11 to the compiler when dumping the preprocessor variables for the indexer.
B) Unrecognized SIMD intrinsics despite #include <smmintrin.h> -- same as above -- "-msse4.1" switch has not been passed to the compiler during query. The indexer is missing (normally automatically generated) __SSE4__, __SSE4_1__, __SSSE3__, __SSE3__ keywords, and cannot correctly include header with intrinsics.

Both problems are also exposed when inspecting what symbols were actually imported when creating the project. See "C/C++ Include Paths and Symbols" in Project properties...
I use Eclipse Luna (4.4), but I don't think it really matter for this bug.

No tags attached.
bz2 test.tar.bz2 (759) 2014-08-23 04:52
https://public.kitware.com/Bug/file/5231/test.tar.bz2
Issue History
2014-08-23 04:52David PajakNew Issue
2014-08-23 04:52David PajakFile Added: test.tar.bz2
2014-08-23 11:27Alex NeundorfAssigned To => Alex Neundorf
2014-08-23 11:27Alex NeundorfStatusnew => assigned
2016-06-10 14:29Kitware RobotNote Added: 0042611
2016-06-10 14:29Kitware RobotStatusassigned => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0042611)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.