Compile current file only (cmake project)

Mateusz Loskot mateusz at loskot.net
Thu Nov 8 16:14:40 GMT 2012


On 8 November 2012 15:56, Andreas Pakulat <apaku at gmx.de> wrote:
> On Thu, Nov 8, 2012 at 3:04 PM, Mateusz Loskot <mateusz at loskot.net> wrote:
>> On 8 November 2012 13:43, Michael Hart <michael.george.hart at gmail.com> wrote:
>>> I can see the general advantages of this method building a selected set of
>>> files of a project. But, most people don't need such a general mechanism;
>>> most people only want to focus on a single file....
>>
>> If I may, as a user, I'd reason this way:
>> There are distinct commands to compile a single file or a build a
>> binary from command line,
>> so I bet most users would expect to have similar commands exposed by a
>> GUI based IDE.
>
> One of the reasons there's no easier way in the GUI is that this is
> hardly ever needed by our users as far as I know. Of course my brain
> may fail me and I don't know about more recent bugreports, but this
> has not come up more than once a year maybe in the past. It seems most
> people are just fine putting their whole project or a subfolder in the
> list or simply empty out the list and use whatever is selected.

Got it.

> I personally would never use a compile-file action since I never work
> on projects that are simple enough to make this useful. I always want
> to build at least a complete target, if not multiple targets. OTOH the
> projects I build are not that large that a simple make without changes
> takes long enough for me to be bothered.

Sometimes it's helpful to compile, as quick check the code is well formed, etc.

>>> It has take me almost a year, thanks to your recent comments in this thread, to now
>>> know how to compile a single file....
>>>
>>> shhhhhh!!! what a pain....
>>
>> It's been almst a year now, and I still haven't managed [0] to understand
>> correct and robust CMake workflow in kdevelop juggling
>> multiple build configurations and destinations for a single project,
>> when I need to hit (re)configure in kdevelop,
>> if/when I need to purge CMakeCache.txt,
>> what are limitations comparing with command line.
>> IOW, how to translate typical CMake workflow on Unix to kdevelop.
>>
>> Some readings [1] really confuse the matter:
>
> First of all, don't expect articles posted 4 years ago to still match
> reality, in particular not the workflow to create projects. There's no
> direct contact with the cache-file anymore.

Sure, I don't expect that. But, becasue there is no single holy bible for
kdevelop, I reach variety of sources. Some turn out misleading, certainly.

>> "After clicking “Ok” KDevelop will read and parse the CMakeCache.txt file and
>> show its contents. You can edit it here if you want to."
>>
>> Hmm, CMakeCache.txt?! Edit it?!
>
> I'm not sure I understand what you're hinting at, but if you don't
> know what CMakeCache.txt is then you've either not yet looked up a
> cmake tutorial or have selected the wrong buildsystem for your
> project. KDevelop does not intend to take away the joy of getting to
> know your buildsystem, its more or less a pre-requisite to have some
> basic understanding of the buildsystem you're using in your projects.

I sense I haven't made my point clear.
I do understand CMake well and I'm comfy with it.
I don't, however, understand where Kdevelop is a convenient
equivalent to cmake command and where it provides an added value,
extending CMake functionality.
I may be biased, as I'm coming from CMake-based Visual Studio workflows,
but that's natural to match previous experience with new tools, isn't it.
So, I've had not-so-easy time understanding project/build management
features in Kdevelop .

p.s. I'm neither hinting nor whining, I'm grateful for the fantastic
software you make.

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net




More information about the KDevelop mailing list