Bug 364223 - When refreshing a modified project file, new targets do not appear
Summary: When refreshing a modified project file, new targets do not appear
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build (show other bugs)
Version: 8.1.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: cdt-build-inbox@eclipse.org CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-19 12:09 EST by Alex Neundorf CLA
Modified: 2020-09-04 15:27 EDT (History)
2 users (show)

See Also:


Attachments
The testcase described in the bug report. (354 bytes, application/gzip)
2011-11-19 12:12 EST, Alex Neundorf CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Neundorf CLA 2011-11-19 12:09:32 EST
Build Identifier: 20110916-0149

I'm using Eclipse with project files generated by CMake.
I import the generated project files and everything works fine.
When I edit my CMakeLists.txt and add new targets, e.g. some executable, cmake writes a new .cproject file which contains the new target.
But this new target does not appear in Eclipse, even after executing "Refresh" on the project.
I have to delete the project from the workspace and import it again, then all the targets are there properly.


Reproducible: Always

Steps to Reproduce:
1. unpack the attached project, this creates a directory targets_not_refreshed/, which contains a tiny cmake-based project
2. run cmake, at least version 2.8.0 on it with the Eclipse CDT project generator. Easiest way to do this is to run cmake-gui, then you get a combo box where you can select which project generator you want. Configure and generate, then quite cmake-gui .
3. start eclipse, and import the created project. In the "Make target" tab there will be a list of targets, including "all", "rebuild_cache" and "[exe] hello".
4. edit the CMakeLists.txt and uncomment the line "add_executable(blub main.c)", save it
5. execute the target "rebuild_cache". This reruns cmake, and cmake creates an updated .cproject file.
6. the created .cproject file contains a new target "[exe] blub", but this doesn't appear in the "Make targets" tab. Also refreshing the project doesn't help. Not even terminating restarting eclipse. I have to delete the project and import it again, then the added target appears. The same problem does also exist when removing targets.
Comment 1 Alex Neundorf CLA 2011-11-19 12:12:15 EST
Created attachment 207267 [details]
The testcase described in the bug report.
Comment 2 Alex Neundorf CLA 2011-12-14 13:34:12 EST
It would be nice if somebody could have a look at this.

Thanks
Alex
Comment 3 Marc-André Laperle CLA 2012-01-17 01:06:51 EST
The targets update for me after closing and reopening the project. This is not ideal but it's better than deleting and importing the project.
Comment 4 Alex Neundorf CLA 2012-01-17 12:59:34 EST
Which version of Eclipse and CDT are you using ?
Under which operating system ?

I am using Linux, and tried Helios and Indigo.
Comment 5 Marc-André Laperle CLA 2012-01-26 20:43:29 EST
(In reply to comment #4)
> Which version of Eclipse and CDT are you using ?
> Under which operating system ?
> 
> I am using Linux, and tried Helios and Indigo.

I don't quite remember now :P I think it was Windows 7 with a recent build of Indigo SR2 (8.0.2). Can you try that?

There is a zipped p2 repo of the nightly build here:
https://hudson.eclipse.org/hudson/job/cdt-master-maint/

You can use that to upgrade an existing CDT 8.0.x or install in an existing Eclipse installation.
Comment 6 Alex Neundorf CLA 2012-02-09 16:50:17 EST
I tested, I can comfirm this. Closing an opening the project again updates the targets in the "Make" tab. Eclipse Indigo on Linux.
This is indeed better than having to delete an reimport it.

Still it would be even better if a "Refresh" of the project would do the job (or if Eclipse would even notice automatically that it should do that).

Alex