View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0009978CMakeCMakepublic2009-11-30 10:232010-02-13 11:10
ReporterSNiLD 
Assigned ToAlex Neundorf 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake-2-8 
Target VersionFixed in Version 
Summary0009978: Eclipse CDT generator creates invalid build targets (see attached example project)
DescriptionEclipse CDT generator creates invalid build targets for subprojects that try to add an executable. If the subdirectory contains an additional subdirectory without any project calls then the bug will not appear.
Additional InformationTo reproduce:
Create following directory structure:

CMakeBug\CMakeBug
CMakeBug\Build

Extract the zip to CMakeBug\CMakeBug

Run following command in the CMakeBug\Build directory:

cmake -G"Eclipse CDT4 - NMake Makefiles" -DECLIPSE_CDT4_GENERATE_SOURCE_PROJECT=TRUE -DCMAKE_BUILD_TYPE:STRING="Debug" ../CMakeBug

Import the project to eclipse.

When you try to make the target "[exe] Module1" you will get a message "NMAKE : fatal error U1073: don't know how to make 'Module1'" but all other targets are buildable.
TagsNo tags attached.
Attached Fileszip file icon CMakeBug.zip [^] (2,913 bytes) 2009-11-30 10:23

 Relationships

  Notes
(0018631)
Alex Neundorf (developer)
2009-12-01 16:37

Yes, I can reproduce the problem.

But I don't understand what's wrong in the generated project file.
This is what is there:
<target name="[exe] Module1" path="Module1" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>/usr/bin/gmake</buildCommand>
<buildArguments/>
<buildTarget>Module1</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
</target>

The target has the correct name ("Module1") and the directory is correct (also "Module1").
From the command line I can build "Module1" both from the toplevel dir as well as from the Module1 subdir.

It starts working also in Eclipse if I rename the project() in Module1/CMakeLists.txt to something else than "Module1".
It seems the problem is that the subdir has the same name as the project ?
For every project there is a linked resource created, which points to the source dir.
So for the "Module1" project there is a linked resource created which points to the "srcdir/Module1". In that directory there is no Makefile, but it seems eclipse executes make then from that directory, which fails.


Can you verify that ?
This would mean that the Module1 starts working when you rename the project "Module1" to something else (verified here), and that the other targets stop working if you name the project the same as the directory in which they are.

Alex
(0018640)
SNiLD (reporter)
2009-12-02 04:54

Yes this is exactly how it works for me as well. I can make the target from command-line and I can make the target from Eclipse if I rename the project to other name than the executable.
(0019526)
Alex Neundorf (developer)
2010-02-13 11:10

I changed the generator so that now only one linked resource named [Source directory] is created, instead of one for each project.
This should avoid the name clashes and IMO this looks also much less confusing.

It would be nice if you could try cmake cvs HEAD to give it a try.

Alex

 Issue History
Date Modified Username Field Change
2009-11-30 10:23 SNiLD New Issue
2009-11-30 10:23 SNiLD File Added: CMakeBug.zip
2009-11-30 10:30 Bill Hoffman Status new => assigned
2009-11-30 10:30 Bill Hoffman Assigned To => Alex Neundorf
2009-12-01 16:37 Alex Neundorf Note Added: 0018631
2009-12-02 04:54 SNiLD Note Added: 0018640
2010-02-13 11:10 Alex Neundorf Note Added: 0019526
2010-02-13 11:10 Alex Neundorf Status assigned => closed
2010-02-13 11:10 Alex Neundorf Resolution open => fixed


Copyright © 2000 - 2018 MantisBT Team