View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011723CMakeCMakepublic2011-01-19 11:582011-11-11 14:43
ReporterGaleazzi 
Assigned ToAlex Neundorf 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionno change required 
PlatformPCOSWindowsOS VersionXP
Product VersionCMake 2.8.3 
Target VersionFixed in Version 
Summary0011723: Eclipse: "Build project" and "Clean project" do not work
Descriptionsuppose I have a project with:
add_subdirectory("path/lib1" "${CMAKE_CURRENT_BINARY_DIR}/ib1")
when I change a source of lib1 and click on build over the eclipse project, eclipse doesn't build anything.
If I change a source of the main project it launches the build correctly.
I also tried to test the same thing with a simple MinGW Makefile (instead of Eclipse CDT 4 - MinGW Makefile) and it works properly in both two cases.
Steps To ReproduceJust create a project with the same structure above
TagsNo tags attached.
Attached Filesjpg file icon eclipse-build.jpg [^] (170,526 bytes) 2011-01-27 16:05


rar file icon CMakeEclipseBug.rar [^] (1,373 bytes) 2011-01-28 03:55

 Relationships
related to 0012223closedAlex Neundorf Support of linked resources in Eclipse/CDT (single files, not folders) 

  Notes
(0025114)
Alex Neundorf (developer)
2011-01-27 16:06

I can't reproduce a problem here with current cmake (2.8.4) under Linux.
As you can see in the screenshot I have a subdir foo/lib/, which I add in lib/ to the project.
Clicking e.g. the "[pre] foo.c.i" target on the right works, also all other targets work.

Did I misunderstand something ?
Or is this different on Windows ?

Alex
(0025118)
Galeazzi (reporter)
2011-01-28 04:04

The difference is that my lib isn't a subdirectory of the main project:
cmake_minimum_required(VERSION 2.8)
project(Hello)
    set(Lib_OutPut_Dir "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}")
    message(STATUS ${Lib_OutPut_Dir})
    add_subdirectory(../myLib "${Lib_OutPut_Dir}/BuildFiles")
    #link_directories(${CMAKE_CURRENT_BINARY_DIR})
    set(SOURCES ./main.c
                )
    set_source_files_properties(./main.c PROPERTIES LANGUAGE CXX)
    add_executable(Hello ${SOURCES})
    target_link_libraries(Hello HelloLib)
    
When you have built the project for the first time, just try to modify a file in lib and then build the Hello project again.
In windows it doesn't build anything.
In the next few days I'm gonna test it on Linux too.

Andrea
(0025161)
Alex Neundorf (developer)
2011-01-29 12:49

Works here too.
This is with Eclipse Helios.
Which version of Eclipse are you using ?

Alex
(0025175)
Galeazzi (reporter)
2011-01-31 04:51
edited on: 2011-01-31 05:02

I'm using Helios too.
I just tested it also under Fedora and I've got the same problem.
Let me point out the procedure again (about the attachment):
1 - Generate an Eclipse Project from HelloExec
2 - Import it into your workspace (Eclipse will automatically build the project)
3 - Modify sayHello.cpp with any editor (sayHello.cpp is not available in the Eclipse project) (i.e. printf("Hello Word2"); -> printf("Hello Word");) and save the file.
4 - Right-click on HelloExec and click on Build Project
In both Windows and Linux Eclipse doesn't rebuild the project despite of the fact that sayHello.cpp has been modified. In order to "force" Eclipse to build it again I've to modify a file, like main.c, explicitly listed in the main CMakeLists.txt.
Let me know if you also can reproduce it.

(0025188)
Alex Neundorf (developer)
2011-01-31 16:58

Ok, I can reproduce this.
So, building via the generated targets in the "Make target" panel works without problems.

Building via the right-click menu on the project does not work as it should.
When I select "Build project", basically nothing happens.
When I select "Clean project", it does a "gmake all".

Do you have the same behaviour ?

Alex
(0025197)
Galeazzi (reporter)
2011-02-01 03:57

Yes I do
(0025218)
Alex Neundorf (developer)
2011-02-01 16:18

I tested a bit more.
This is completely independent from whether some files are in some other directory or not. I.e. I tried it with a basic "hello world" project, and had the same effect.
Eclipse seems to use the value from the "org.eclipse.cdt.make.core.build.target.inc" specified in the .project file when it does a "Clean project". I.e. when I put there
<dictionary>
 <key>org.eclipse.cdt.make.core.build.target.inc</key>
 <value>clean</value>
</dictionary>

"Clean project" does make clean. Probably this is also used in some cases, so this doesn't look like a fix.


Now it gets weird.
I now ignored cmake, and used Eclipse to create a new "Hello world" C++ project. Same here !
"Clean project" does "make all", "Build project" also does "make all".
Does "Clean project" maybe try to remove all files it knows about (instead of calling "make clean") and then starts an incremental build ?
Maybe this "Build project" and "Clean project" is not supposed to be used for imported projects ?

Alex
(0025219)
Alex Neundorf (developer)
2011-02-01 16:35

Ok. "Clean project" does actually work. It cleans the project, probably by calling a hardcoded "make clean", followed by an incremental build.
IOW, if I do "Clean project", the built executables are not there anymore afterwards, although I don't see any output in Eclipse.
Strange thing is, if I change

<dictionary>
 <key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
 <value>clean</value>
</dictionary>

to some other (nonexistant) target than "clean", e.g. "foo", and execute "Clean project" then, the built executables still are removed.

OTOH, setting

<dictionary>
 <key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
 <value>false</value>
</dictionary>

to false as shown here, doesn't disable the incremental build after the clean.

Also, messing around with

<dictionary>
 <key>org.eclipse.cdt.make.core.fullBuildTarget</key>
 <value>all</value>
</dictionary>

doesn't change the behaviour on "Build project", the stuff is not built whatever I enter there.

Alex
(0025275)
Galeazzi (reporter)
2011-02-04 04:25

Probably I don't deeply understand all your considerations, anyway if you try to modify the main.c file of the attachment, save it, right click on the project and select build project, Eclipse builds the file (and the whole project) correctly.
Andrea
(0025837)
Galeazzi (reporter)
2011-03-21 07:30

Any news about this bug?
Andrea
(0025851)
Alex Neundorf (developer)
2011-03-21 16:21

No, I was confused and still am.

Alex
(0025861)
Galeazzi (reporter)
2011-03-22 04:52

Are you confused about the bug or how to fix it? Could I help you in any ways?
Andrea
(0027784)
Alex Neundorf (developer)
2011-11-11 14:43

I'm closing this one now.

It looks like this is a bug in Eclipse Helios.
I imported a fresh-created project in Helios.
"Build Project" worked.
"Clean Project" did also execute "make all".

Then I did the same in Eclipse Indigo.
"Build Project" still works (but doing it twice in a row doesn't do anything, it seems you have to save a file or something to make it start the build).
And, tada, "Clean Project" now does "make clean".

 Issue History
Date Modified Username Field Change
2011-01-19 11:58 Galeazzi New Issue
2011-01-19 12:04 Alex Neundorf Assigned To => Alex Neundorf
2011-01-19 12:04 Alex Neundorf Status new => assigned
2011-01-27 16:05 Alex Neundorf File Added: eclipse-build.jpg
2011-01-27 16:06 Alex Neundorf Note Added: 0025114
2011-01-28 03:55 Galeazzi File Added: CMakeEclipseBug.rar
2011-01-28 04:04 Galeazzi Note Added: 0025118
2011-01-29 12:49 Alex Neundorf Note Added: 0025161
2011-01-31 04:51 Galeazzi Note Added: 0025175
2011-01-31 05:02 Galeazzi Note Edited: 0025175
2011-01-31 16:58 Alex Neundorf Note Added: 0025188
2011-02-01 03:57 Galeazzi Note Added: 0025197
2011-02-01 16:18 Alex Neundorf Note Added: 0025218
2011-02-01 16:19 Alex Neundorf Summary eclipse build => Eclipse: "Build project" and "Clean project" do not work
2011-02-01 16:35 Alex Neundorf Note Added: 0025219
2011-02-04 04:25 Galeazzi Note Added: 0025275
2011-03-21 07:30 Galeazzi Note Added: 0025837
2011-03-21 16:21 Alex Neundorf Note Added: 0025851
2011-03-22 04:52 Galeazzi Note Added: 0025861
2011-09-30 15:20 Alex Neundorf Relationship added related to 0012223
2011-11-11 14:43 Alex Neundorf Note Added: 0027784
2011-11-11 14:43 Alex Neundorf Status assigned => closed
2011-11-11 14:43 Alex Neundorf Resolution open => no change required


Copyright © 2000 - 2018 MantisBT Team