[cmake-developers] [CMake 0015721]: Indexer configuration of Eclipse CDT4 Project does not recognize symbols set by modules

Mantis Bug Tracker mantis at public.kitware.com
Mon Aug 31 09:23:54 EDT 2015


The following issue has been SUBMITTED. 
====================================================================== 
https://public.kitware.com/Bug/view.php?id=15721 
====================================================================== 
Reported By:                Thomas Ruschival
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15721
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2015-08-31 09:23 EDT
Last Modified:              2015-08-31 09:23 EDT
====================================================================== 
Summary:                    Indexer configuration of Eclipse CDT4 Project does
not recognize symbols set by modules
Description: 
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?
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2015-08-31 09:23 Thomas RuschivalNew Issue                                    
======================================================================



More information about the cmake-developers mailing list