Bug 320653

Summary: CMake manager asserts if the same project is opened two times
Product: [Applications] kdevelop Reporter: András Manţia <amantia>
Component: Build tools: CMakeAssignee: kdevelop-bugs-null
Status: CONFIRMED ---    
Severity: normal CC: aleixpol
Priority: NOR    
Version First Reported In: git master   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description András Manţia 2013-06-03 10:19:54 UTC
The bug could be related to bug 198953, although my backtrace is different.
Setup:
- one cmake project that could be built for desktop and Android
- two separate build directories (one for desktop, one for Android)
- KDevelop crashes with an assert:

ASSERT: "folders.isEmpty() || folders.size()==1" in file /development/sources/kde-trunk/kdevelop/projectmanagers/cmake/cmakemanager.cpp, line 1259

I've added a few debug lines befor to see the content of "dirty" and "folders" (folder names are changed):
dirty:  "/development/repository/app/src/alerts/frontend/" 
folders: (0x7fbe69733dd0, 0x7fbe691a4c10) 
KUrl("file://development/repository/app/src/alerts/frontend/") 
KUrl("file://development/repository/app/src/alerts/frontend/") 

The CMakeLists.txt in "alerts" looks like this:
add_subdirectory(backend)
if (NOT ANDROID)
    add_subdirectory(frontend)
endif()
Comment 1 Aleix Pol 2013-06-03 11:02:16 UTC
Hm, I see... well the idea was that you should be able to easily switch from one build directory to the other, instead of having the project open twice. Actually this can be a problem in different cases (they are both using the same config directory!).

Should we find a good way to let you configure the build directory of a build run?

I'm not closing because we should error in this case, not assert and crash.
Comment 2 Justin Zobel 2021-03-09 22:47:53 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.