This forum has been archived. All content is frozen. Please use KDE Discuss instead.

The best way to work with many standalone cpp files?

Tags: None
(comma "," separated)
piotergmoter
Registered Member
Posts
9
Karma
0
Let's say I have new book, The C++ programming lang and want to try the short code examples from it. Each is a separate executable, with its own main function. How to make kdevelop to work with those independent files easily?
When I setup a kdevelop project, its building process assumes there is only one final executable file. Yes, I'm a new kdevelop user, sorry for this probably naive question.
Regards
P.
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS
How do you build your project? With cmake, you can just add new executables, like:
Code: Select all
add_executable(foo foo.cpp)
add_executable(bar bar.cpp)

in your CMakeLists.txt.


I'm working on the KDevelop IDE.
piotergmoter
Registered Member
Posts
9
Karma
0
cmake, I'v added my exec and they are building nicely. Thanx. Is it possible to run the active file in the editor from the GUI? Or I should switch to the konsole and run it from there?
P.
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS
The C++ runner can't do that, I'm afraid -- it's a bit of a convoluted concept which executable belongs to the file open in the editor. You have to select it by hand for each new executable you create.


I'm working on the KDevelop IDE.
piotergmoter
Registered Member
Posts
9
Karma
0
So, as I understand the easiest way to deal (run) with many small executables in one project is to switch to konsole and run them by hand from command line. Right?
P.
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS
Effectively that's probably the simplest way, yes. You could probably do something clever with dbus to have it launch the right file automatically, but it's almost certainly not worth it.


I'm working on the KDevelop IDE.


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]