Bug 194454 - Support in-source builds with cmake
Summary: Support in-source builds with cmake
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Build tools: CMake (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-28 18:52 UTC by maciek gajewski
Modified: 2010-12-15 05:25 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Failing project (637.01 KB, application/octet-stream)
2009-05-28 19:48 UTC, maciek gajewski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description maciek gajewski 2009-05-28 18:52:22 UTC
Version:           3.9.91 (using 4.2.3 (KDE 4.2.3), Kubuntu packages)
Compiler:          cc
OS:                Linux (x86_64) release 2.6.28-12-generic

Using cmake 2.6-patch 2

KDevelop insist on building project into 'build' subdirectory. As project was build before in different dir, and CMakeCache.txt exists, cmake isn't creating Makefile in 'build'

Therefore KDavelop is unable to build project:

PROJECTDIR/build/./> make
make: *** No targets specified and no makefile found.  Stop.
*** Failed ***

And any attempt to configure project using config dialog results in infinite stream of message boxes stating that '`build` dir is invalid' and similar.
Comment 1 Andreas Pakulat 2009-05-28 19:17:58 UTC
Are you saying that you cannot choose the original build directory? Can you provide a tarr'ed sample project that exhibits this problem?
Comment 2 maciek gajewski 2009-05-28 19:48:07 UTC
Created attachment 34081 [details]
Failing project

Testcase: failing project. Duplication procedure was following:
1. open kdevelop4
2. go to: open project, select CMakeLists.txt
3. CMake import dialog offers you 'build' subdir as a build directory by default, accept.
4. Try to build project - it fails
5. try to change CMake configuration using project options. IT is unusable and pops annoying dialogs.

To fix problem it is enough to delete CMakeCache.txt and run cmake manually from inside the 'build' dir.
Comment 3 Andreas Pakulat 2009-05-28 21:09:19 UTC
Thanks that tells us a lot more. I strongly suggest not to do in-source builds with cmake. While thats usually possible, its always better to have a separate builddirectory.

Currently KDevelop doesn't support in-source builds, so just clean your project from all cmake-generated files and let kdevelop build inside the build subdir, or choose a different directory outside your project for now.
Comment 4 Aleix Pol 2009-07-08 17:29:19 UTC
I don't think it is a good idea to support in-source builds.
Comment 5 Andreas Pakulat 2009-07-08 19:01:02 UTC
Aleix, you're wrong. While I and you don't like in-source-builds its a valid use-case for CMake projects. Hence our cmake plugin should support it.
Comment 6 David Nolden 2009-07-08 19:04:52 UTC
Especially it should not screw up in the sense of "nothing works until I manually delete CMakeCache".

And in-source building is not elegant, but sometimes a valid option, just consider "svn co project && cd project && cmake && make", sometimes fiddling around with build-directories is unneeded overhead.
Comment 7 maciek gajewski 2009-07-08 21:03:32 UTC
Supporting in-source builds is one thing. Leaving user with messagebox frenzy and cryptic errors is another thing.
Comment 8 Aleix Pol 2009-07-09 18:17:37 UTC
Now you can use an already created in source build directory but not to create a new one there. Is that ok?
Comment 9 Andreas Pakulat 2009-07-09 20:56:46 UTC
sorry, but I think we should also support creating an in-source build.
Comment 10 Aleix Pol 2009-10-04 19:54:56 UTC
We don't let the user to create build directories if the directory is not empty.

Should we let the user do that?
Or the only not-empty-directory we want to be able to create builddirs in is the source dir?
Comment 11 Aleix Pol 2010-12-15 05:25:25 UTC
It's possible to use in-source builddirs right now (just checked now, i changed that a while ago).