[CMake] Eclipse generator - scanner-discovered include pathsand pre-processor symbols

Alexander Neundorf a.neundorf-work at gmx.net
Thu Mar 24 16:54:44 EDT 2011


On Thursday 24 March 2011, Chatterjee, Shash wrote:
> Hi Alex,
>
> I have attached a tar file with a tiny example project that shows the
> behaviour.  Screenshot-1 shows the problem (this is the config included in
> the tar file), Screenshot-2 shows the state after I fixed it manually.

I had a look at the generated .cproject file, and indeed all the system 
include dirs and built macros are missing.
They should be detected when cmake runs initially.
I attached three files:
- .cproject, this is how this file looks for me for a basic hello-world style 
project

- CMakeFindEclipseCDT4.cmake : this is slightly changed version from the one 
shipped with cmake 2.8.4, it produces debug output. Please replace the 
CMakeFindEclipseCDT4.cmake in your cmake 2.8.4 installation with this file. 
Then create a fresh and empty build directory, and let cmake run there, with 
the same command line as you posted. Capture the output, both stdout and 
stderr in a log file and post it here.

- eclipse.log: this is how the output from cmake looks on my system (with the 
attached CMakeFindEclipseCDT4.cmake.

I saw that you are using ccache, maybe this behaves slightly different for 
some things ?

Alex
-------------- next part --------------
A non-text attachment was scrubbed...
Name: eclipse.log
Type: text/x-log
Size: 9784 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110324/62294265/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CMakeFindEclipseCDT4.cmake
Type: text/x-objcsrc
Size: 5938 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110324/62294265/attachment-0003.bin>
-------------- next part --------------
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?>

<cproject>
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="org.eclipse.cdt.core.default.config.1">
<storageModule buildSystemId="org.eclipse.cdt.core.defaultConfigDataProvider" id="org.eclipse.cdt.core.default.config.1" moduleId="org.eclipse.cdt.core.settings" name="Configuration">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser">
<attribute key="addr2line" value="addr2line"/>
<attribute key="c++filt" value="c++filt"/>
</extension>
</extensions>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.language.mapping">
<project-mappings/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule moduleId="org.eclipse.cdt.core.pathentry">
<pathentry kind="src" path="[Source directory]"/>
<pathentry kind="src" path="hello"/>
<pathentry excluding="[Source directory]/|hello/|**/CMakeFiles/" kind="out" path=""/>
<pathentry kind="mac" name="__STDC__" path="" value="1"/>
<pathentry kind="mac" name="__STDC_HOSTED__" path="" value="1"/>
<pathentry kind="mac" name="__GNUC__" path="" value="4"/>
<pathentry kind="mac" name="__GNUC_MINOR__" path="" value="2"/>
<pathentry kind="mac" name="__GNUC_PATCHLEVEL__" path="" value="3"/>
<pathentry kind="mac" name="__SIZE_TYPE__" path="" value="unsigned int"/>
<pathentry kind="mac" name="__PTRDIFF_TYPE__" path="" value="int"/>
<pathentry kind="mac" name="__WCHAR_TYPE__" path="" value="long int"/>
<pathentry kind="mac" name="__WINT_TYPE__" path="" value="unsigned int"/>
<pathentry kind="mac" name="__INTMAX_TYPE__" path="" value="long long int"/>
<pathentry kind="mac" name="__UINTMAX_TYPE__" path="" value="long long unsigned int"/>
<pathentry kind="mac" name="__GXX_ABI_VERSION" path="" value="1002"/>
<pathentry kind="mac" name="__SCHAR_MAX__" path="" value="127"/>
<pathentry kind="mac" name="__SHRT_MAX__" path="" value="32767"/>
<pathentry kind="mac" name="__INT_MAX__" path="" value="2147483647"/>
<pathentry kind="mac" name="__LONG_MAX__" path="" value="2147483647L"/>
<pathentry kind="mac" name="__LONG_LONG_MAX__" path="" value="9223372036854775807LL"/>
<pathentry kind="mac" name="__WCHAR_MAX__" path="" value="2147483647"/>
<pathentry kind="mac" name="__CHAR_BIT__" path="" value="8"/>
<pathentry kind="mac" name="__INTMAX_MAX__" path="" value="9223372036854775807LL"/>
<pathentry kind="mac" name="__FLT_EVAL_METHOD__" path="" value="2"/>
<pathentry kind="mac" name="__DEC_EVAL_METHOD__" path="" value="2"/>
<pathentry kind="mac" name="__FLT_RADIX__" path="" value="2"/>
<pathentry kind="mac" name="__FLT_MANT_DIG__" path="" value="24"/>
<pathentry kind="mac" name="__FLT_DIG__" path="" value="6"/>
<pathentry kind="mac" name="__FLT_MIN_EXP__" path="" value="(-125)"/>
<pathentry kind="mac" name="__FLT_MIN_10_EXP__" path="" value="(-37)"/>
<pathentry kind="mac" name="__FLT_MAX_EXP__" path="" value="128"/>
<pathentry kind="mac" name="__FLT_MAX_10_EXP__" path="" value="38"/>
<pathentry kind="mac" name="__FLT_MAX__" path="" value="3.40282347e+38F"/>
<pathentry kind="mac" name="__FLT_MIN__" path="" value="1.17549435e-38F"/>
<pathentry kind="mac" name="__FLT_EPSILON__" path="" value="1.19209290e-7F"/>
<pathentry kind="mac" name="__FLT_DENORM_MIN__" path="" value="1.40129846e-45F"/>
<pathentry kind="mac" name="__FLT_HAS_DENORM__" path="" value="1"/>
<pathentry kind="mac" name="__FLT_HAS_INFINITY__" path="" value="1"/>
<pathentry kind="mac" name="__FLT_HAS_QUIET_NAN__" path="" value="1"/>
<pathentry kind="mac" name="__DBL_MANT_DIG__" path="" value="53"/>
<pathentry kind="mac" name="__DBL_DIG__" path="" value="15"/>
<pathentry kind="mac" name="__DBL_MIN_EXP__" path="" value="(-1021)"/>
<pathentry kind="mac" name="__DBL_MIN_10_EXP__" path="" value="(-307)"/>
<pathentry kind="mac" name="__DBL_MAX_EXP__" path="" value="1024"/>
<pathentry kind="mac" name="__DBL_MAX_10_EXP__" path="" value="308"/>
<pathentry kind="mac" name="__DBL_MAX__" path="" value="1.7976931348623157e+308"/>
<pathentry kind="mac" name="__DBL_MIN__" path="" value="2.2250738585072014e-308"/>
<pathentry kind="mac" name="__DBL_EPSILON__" path="" value="2.2204460492503131e-16"/>
<pathentry kind="mac" name="__DBL_DENORM_MIN__" path="" value="4.9406564584124654e-324"/>
<pathentry kind="mac" name="__DBL_HAS_DENORM__" path="" value="1"/>
<pathentry kind="mac" name="__DBL_HAS_INFINITY__" path="" value="1"/>
<pathentry kind="mac" name="__DBL_HAS_QUIET_NAN__" path="" value="1"/>
<pathentry kind="mac" name="__LDBL_MANT_DIG__" path="" value="64"/>
<pathentry kind="mac" name="__LDBL_DIG__" path="" value="18"/>
<pathentry kind="mac" name="__LDBL_MIN_EXP__" path="" value="(-16381)"/>
<pathentry kind="mac" name="__LDBL_MIN_10_EXP__" path="" value="(-4931)"/>
<pathentry kind="mac" name="__LDBL_MAX_EXP__" path="" value="16384"/>
<pathentry kind="mac" name="__LDBL_MAX_10_EXP__" path="" value="4932"/>
<pathentry kind="mac" name="__DECIMAL_DIG__" path="" value="21"/>
<pathentry kind="mac" name="__LDBL_MAX__" path="" value="1.18973149535723176502e+4932L"/>
<pathentry kind="mac" name="__LDBL_MIN__" path="" value="3.36210314311209350626e-4932L"/>
<pathentry kind="mac" name="__LDBL_EPSILON__" path="" value="1.08420217248550443401e-19L"/>
<pathentry kind="mac" name="__LDBL_DENORM_MIN__" path="" value="3.64519953188247460253e-4951L"/>
<pathentry kind="mac" name="__LDBL_HAS_DENORM__" path="" value="1"/>
<pathentry kind="mac" name="__LDBL_HAS_INFINITY__" path="" value="1"/>
<pathentry kind="mac" name="__LDBL_HAS_QUIET_NAN__" path="" value="1"/>
<pathentry kind="mac" name="__DEC32_MANT_DIG__" path="" value="7"/>
<pathentry kind="mac" name="__DEC32_MIN_EXP__" path="" value="(-95)"/>
<pathentry kind="mac" name="__DEC32_MAX_EXP__" path="" value="96"/>
<pathentry kind="mac" name="__DEC32_MIN__" path="" value="1E-95DF"/>
<pathentry kind="mac" name="__DEC32_MAX__" path="" value="9.999999E96DF"/>
<pathentry kind="mac" name="__DEC32_EPSILON__" path="" value="1E-6DF"/>
<pathentry kind="mac" name="__DEC32_DEN__" path="" value="0.000001E-95DF"/>
<pathentry kind="mac" name="__DEC64_MANT_DIG__" path="" value="16"/>
<pathentry kind="mac" name="__DEC64_MIN_EXP__" path="" value="(-383)"/>
<pathentry kind="mac" name="__DEC64_MAX_EXP__" path="" value="384"/>
<pathentry kind="mac" name="__DEC64_MIN__" path="" value="1E-383DD"/>
<pathentry kind="mac" name="__DEC64_MAX__" path="" value="9.999999999999999E384DD"/>
<pathentry kind="mac" name="__DEC64_EPSILON__" path="" value="1E-15DD"/>
<pathentry kind="mac" name="__DEC64_DEN__" path="" value="0.000000000000001E-383DD"/>
<pathentry kind="mac" name="__DEC128_MANT_DIG__" path="" value="34"/>
<pathentry kind="mac" name="__DEC128_MIN_EXP__" path="" value="(-6143)"/>
<pathentry kind="mac" name="__DEC128_MAX_EXP__" path="" value="6144"/>
<pathentry kind="mac" name="__DEC128_MIN__" path="" value="1E-6143DL"/>
<pathentry kind="mac" name="__DEC128_MAX__" path="" value="9.999999999999999999999999999999999E6144DL"/>
<pathentry kind="mac" name="__DEC128_EPSILON__" path="" value="1E-33DL"/>
<pathentry kind="mac" name="__DEC128_DEN__" path="" value="0.000000000000000000000000000000001E-6143DL"/>
<pathentry kind="mac" name="__REGISTER_PREFIX__" path="" value=" "/>
<pathentry kind="mac" name="__USER_LABEL_PREFIX__" path="" value=" "/>
<pathentry kind="mac" name="__VERSION__" path="" value="&quot;4.2.3&quot;"/>
<pathentry kind="mac" name="__GNUC_GNU_INLINE__" path="" value="1"/>
<pathentry kind="mac" name="__NO_INLINE__" path="" value="1"/>
<pathentry kind="mac" name="__FINITE_MATH_ONLY__" path="" value=" "/>
<pathentry kind="mac" name="__i386" path="" value="1"/>
<pathentry kind="mac" name="__i386__" path="" value="1"/>
<pathentry kind="mac" name="i386" path="" value="1"/>
<pathentry kind="mac" name="__tune_i486__" path="" value="1"/>
<pathentry kind="mac" name="__i486" path="" value="1"/>
<pathentry kind="mac" name="__i486__" path="" value="1"/>
<pathentry kind="mac" name="__gnu_linux__" path="" value="1"/>
<pathentry kind="mac" name="__linux" path="" value="1"/>
<pathentry kind="mac" name="__linux__" path="" value="1"/>
<pathentry kind="mac" name="linux" path="" value="1"/>
<pathentry kind="mac" name="__unix" path="" value="1"/>
<pathentry kind="mac" name="__unix__" path="" value="1"/>
<pathentry kind="mac" name="unix" path="" value="1"/>
<pathentry kind="mac" name="__ELF__" path="" value="1"/>
<pathentry kind="mac" name="__cplusplus" path="" value="1"/>
<pathentry kind="mac" name="__GNUG__" path="" value="4"/>
<pathentry kind="mac" name="__GXX_WEAK__" path="" value="1"/>
<pathentry kind="mac" name="__DEPRECATED" path="" value="1"/>
<pathentry kind="mac" name="__EXCEPTIONS" path="" value="1"/>
<pathentry kind="mac" name="_GNU_SOURCE" path="" value="1"/>
<pathentry include="/usr/local/include" kind="inc" path="" system="true"/>
<pathentry include="/usr/lib/gcc/i486-slackware-linux/4.2.3/include" kind="inc" path="" system="true"/>
<pathentry include="/usr/lib/qt4/include" kind="inc" path="" system="true"/>
<pathentry include="/usr/lib/qt/include" kind="inc" path="" system="true"/>
<pathentry include="/usr/include/c++/4.2.3" kind="inc" path="" system="true"/>
<pathentry include="/usr/include/c++/4.2.3/i486-slackware-linux" kind="inc" path="" system="true"/>
<pathentry include="/usr/include/c++/4.2.3/backward" kind="inc" path="" system="true"/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
<buildTargets>
<target name="[exe] hallo" path="" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>/usr/bin/gmake</buildCommand>
<buildArguments></buildArguments>
<buildTarget>hallo</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
</target>
<target name="[exe] hallo/fast" path="" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>/usr/bin/gmake</buildCommand>
<buildArguments></buildArguments>
<buildTarget>hallo/fast</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
</target>
<target name=": install" path="" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>/usr/bin/gmake</buildCommand>
<buildArguments></buildArguments>
<buildTarget>install</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
</target>
<target name=": install/local" path="" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>/usr/bin/gmake</buildCommand>
<buildArguments></buildArguments>
<buildTarget>install/local</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
</target>
<target name=": install/strip" path="" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>/usr/bin/gmake</buildCommand>
<buildArguments></buildArguments>
<buildTarget>install/strip</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
</target>
<target name=": list_install_components" path="" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>/usr/bin/gmake</buildCommand>
<buildArguments></buildArguments>
<buildTarget>list_install_components</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
</target>
<target name=": rebuild_cache" path="" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>/usr/bin/gmake</buildCommand>
<buildArguments></buildArguments>
<buildTarget>rebuild_cache</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
</target>
<target name=": all" path="" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>/usr/bin/gmake</buildCommand>
<buildArguments></buildArguments>
<buildTarget>all</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
</target>
<target name=": clean" path="" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>/usr/bin/gmake</buildCommand>
<buildArguments></buildArguments>
<buildTarget>clean</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
</target>
<target name="[obj] main.c.o" path="" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>/usr/bin/gmake</buildCommand>
<buildArguments></buildArguments>
<buildTarget>main.c.o</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
</target>
<target name="[pre] main.c.i" path="" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>/usr/bin/gmake</buildCommand>
<buildArguments></buildArguments>
<buildTarget>main.c.i</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
</target>
<target name="[to asm] main.c.s" path="" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>/usr/bin/gmake</buildCommand>
<buildArguments></buildArguments>
<buildTarget>main.c.s</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
</target>
</buildTargets>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="/usr/bin/gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="/usr/bin/gmake" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
</storageModule>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="hello.null.1" name="hello"/>
</storageModule>
</cproject>


More information about the CMake mailing list