Bug 332728

Summary: Importing a CMake project never finishes
Product: [Applications] kdevelop Reporter: Eric <sidneybechet>
Component: Build tools: CMakeAssignee: kdevelop-bugs-null
Status: RESOLVED FIXED    
Severity: major CC: sidneybechet
Priority: NOR Keywords: release_blocker
Version: 4.6.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Minimal c++ Cmake project that shows the issue.

Description Eric 2014-03-28 08:56:14 UTC
While importing a CMAKE project the progress bar never dissapear and the project is not imported at all. Quitting and reloading kdevelop resets everything, but does not clear the issue - if I try to import the same project, it keeps doing nothing at all.



Reproducible: Always

Steps to Reproduce:
1. click on project / import project
2. choose the CMAKELISTS.txt (e.g. from the attached archive i'll submit in the following comment). The cmakelists.txt should have an add_subdirectory(XXX) command pointing to an inexistent directory XXX (eventhough a test prevents actually reaching it. i.e. it is not an error)
3. set the build directory (empty one)

Actual Results:  
The progress bar (import) never advances, keeps busy forever.
The project does not appear in the project list ever, and is not added in the current session at all.

Expected Results:  
progress bar closes and project appears in the project list, and is added to the current session

Please see attachment in the 1st comment.
Comment 1 Eric 2014-03-28 08:58:12 UTC
Created attachment 85805 [details]
Minimal c++ Cmake project that shows the issue.

Please import the outermost (root) CMakeLists.txt in Kdevelop.
Comment 2 Kevin Funk 2014-03-30 20:45:52 UTC
This might be related to the other CMake bug we have with cyclic dependencies. Aleix, please check.

See bug 330697.
Comment 3 Aleix Pol 2014-04-01 11:04:45 UTC
Git commit 492af697f18924a798744a33c3fe0c0a81a9f3b8 by Aleix Pol, on behalf of Pavel Petrushkov.
Committed on 01/04/2014 at 11:04.
Pushed by apol into branch '4.6'.

Fix for importing a CMake project with missing directories

Importing project with nonexisting, but added in add_subdirectory() directories no longer causes KDevelop to load forever. Problem was in creating CMakeCommitChangesJob before checking if directory actually exists.

REVIEW: 117213

M  +5    -0    projectmanagers/cmake/cmakeimportjob.cpp

http://commits.kde.org/kdevelop/492af697f18924a798744a33c3fe0c0a81a9f3b8