MantisBT - CMake
View Issue Details
0013358CMakeCMakepublic2012-06-28 05:412012-10-24 17:24
muhkuh 
Alex Neundorf 
normalminoralways
closedfixed 
win32Windows7
CMake 2.8.8 
CMake 2.8.10CMake 2.8.10 
0013358: Error importing generated Eclipse project with LIBRARY_OUTPUT_PATH set to ${CMAKE_CURRENT_BINARY_DIR}
Setting LIBRARY_OUTPUT_PATH to the current binary directory in a CMakeLists.txt and using it with the "Eclipse CDT4 - MinGW Makefiles" generator creates an Eclipse project that causes an error when being imported into an eclipse workspace.

1. Create CMakeLists.txt containing these two lines:
SET (LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
PROJECT ( Test )

2. Use the "Eclipse CDT4 - MinGW Makefiles" generator of cmake to create an Eclipse project. It doesn't matter if an in source or out of source build is done. For example CMakeLists.txt can reside in C:\TestProject\src and the Eclipse project is created at C:\TestProject\build.

3. Import this project into an eclipse workspace.
An error message appears:
"Error processing changed links in project description file."
"Cannot create a link to C:\TestProject\build because it overlaps the locations of the project that contains the linked resource."
After removing the line that sets LIBRARY_OUTPUT_PATH the generated project can be imported without errors.

Fortunately eclipse imports the generated project despite of the error message. It's just quite annoying.
No tags attached.
Issue History
2012-06-28 05:41muhkuhNew Issue
2012-07-27 16:33Alex NeundorfAssigned To => Alex Neundorf
2012-07-27 16:33Alex NeundorfStatusnew => assigned
2012-07-28 07:57Alex NeundorfNote Added: 0030144
2012-07-28 12:44Alex NeundorfNote Added: 0030145
2012-08-02 15:59Alex NeundorfNote Edited: 0030145bug_revision_view_page.php?bugnote_id=30145#r759
2012-08-03 16:20Alex NeundorfNote Added: 0030168
2012-08-03 16:20Alex NeundorfStatusassigned => closed
2012-08-03 16:20Alex NeundorfResolutionopen => fixed
2012-10-24 17:24David ColeFixed in Version => CMake 2.8.10
2012-10-24 17:24David ColeTarget Version => CMake 2.8.10

Notes
(0030144)
Alex Neundorf   
2012-07-28 07:57   
Interesting.
There is the function cmExtraEclipseCDT4Generator::AppendOutLinkedResource(), which handles those output directories.
If EXECUTABLE_OUTPUT_PATH is a subdir of CMAKE_BINARY_DIR, it does nothing.
In all other case, it seems Eclipse (at least Juno) complains that this is a bad location for a linked resource.
Maybe I should simply delete this code ?
I just tried with Eclipse Europa (3.3), and this old version also complains.
Has this ever worked ?
This is quite old code from 2007 or so.
(0030145)
Alex Neundorf   
2012-07-28 12:44   
(edited on: 2012-08-02 15:59)
The note above was a bit too broad.
Can you give the branch EclipseFixBadLinkedResources on cmake stage a try ?

(0030168)
Alex Neundorf   
2012-08-03 16:20   
I merged the branch into next, maybe it still makes it into 2.8.9, otherwise it will be 2.8.10.