MantisBT - CMake
View Issue Details
0015721CMakeCMakepublic2015-08-31 09:232016-06-10 14:31
Thomas Ruschival 
Alex Neundorf 
normalminoralways
closedmoved 
CMake 3.3 
 
0015721: Indexer configuration of Eclipse CDT4 Project does not recognize symbols set by modules
The issue is a minor one regarding the macros ( symbol definitions) for the eclipse CDT indexer.
The cmake-generated eclipse project only recognizes symbols that are explicitly added with add_defintions() in CMakeLists.txt. The eclipse project does not consider any target-specific COMPILE_DEFINITIONS for indexing the source.

Also a list of compile defintions defined by a module that can be used in target compile defintions cannot be used with add_definitions().

Currently I mitigate this behavior by
find_package(FOO REQUIRED) # FOO defines a list FOO_COMPILE_DEFINITIONS

# This does not work since each symbol has to start with -D
# ADD_DEFINITIONS(${FOO_COMPILE_DEFINITIONS})

foreach( DEF ${FOO_COMPILE_DEFINITIONS})
   ADD_DEFINITIONS("-D${DEF}")
endforeach(DEF)

IMHO this is somewhat ugly. I would prefer to have all definitions used for the targets added to the indexer settings of eclipse to allow for easy source navigation. Since the project is build by makefiles anyway adding all symbols doesn't affect the build.

Does this make sense or am I looking in the wrong direction?
No tags attached.
Issue History
2015-08-31 09:23Thomas RuschivalNew Issue
2015-08-31 16:16Alex NeundorfAssigned To => Alex Neundorf
2015-08-31 16:16Alex NeundorfStatusnew => assigned
2016-06-10 14:29Kitware RobotNote Added: 0042833
2016-06-10 14:29Kitware RobotStatusassigned => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0042833)
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.