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

Adding new files to a project

Tags: None
(comma "," separated)
parsley72
Registered Member
Posts
4
Karma
0

Adding new files to a project

Mon Apr 16, 2012 10:03 pm
I'm trying to create a project to make it easier to view an existing C++ Qt project. The problem is that there's no makefile I can import, so I'm trying to create a blank project then add in the source files. But I can't find a menu option anywhere that allows me to add files to a project. Am I missing something really obvious?

Thanks for any help.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Adding new files to a project

Mon Apr 16, 2012 10:32 pm
Have you tried importing your QMake *.pro file or CMakeLists.txt?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
parsley72
Registered Member
Posts
4
Karma
0

Re: Adding new files to a project

Mon Apr 16, 2012 11:13 pm
No, because there isn't one (as I already said)!
User avatar
Milian Wolff
KDE Developer
Posts
61
Karma
1
OS

Re: Adding new files to a project

Tue Apr 17, 2012 8:11 am
you just open any folder. If you want to add files, just add them using your usual tools (cp, drag'n'drop in a file browser, the project manager context menu, the filebrowser, ...)

but most of the time you shouldn't have to do this. After all, if you have the files somewhere already, just open that folder as the project?! Why would you want to copy files from A to B just to work on B in kdevelop?

bye


current KDE projects: Quanta, KDevelop, Kate
parsley72
Registered Member
Posts
4
Karma
0

Re: Adding new files to a project

Sun Apr 22, 2012 11:56 pm
Milian Wolff wrote:you just open any folder. If you want to add files, just add them using your usual tools (cp, drag'n'drop in a file browser, the project manager context menu, the filebrowser, ...)

but most of the time you shouldn't have to do this. After all, if you have the files somewhere already, just open that folder as the project?! Why would you want to copy files from A to B just to work on B in kdevelop?
bye

Ah right, I misunderstood how this worked. In some IDEs (e.g. Visual Studio) the location of the files is irrelevant and you just add them to the project explorer.

Now all the files are showing up in the project how do I go about creating a makefile for it? There seems to be a lot of confusion about whether to:
1. Create a single CMakeLists.txt file that lists every source file (in multiple directories).
2. Create a CMakeLists.txt in every directory (listing all the source files) that are referenced from a single master file.
3. Use GRUB to step through all the directories automatically.

Thanks.
User avatar
Milian Wolff
KDE Developer
Posts
61
Karma
1
OS

Re: Adding new files to a project

Mon Apr 23, 2012 11:46 am
Dunno what kind of GRUB you are talking about? But anyways, you have to create the makefile yourself, it's not KDevelop that does that for you. You can (and should!) use a Makefile generator like CMake though, and KDevelop has good support for CMake which makes working with it nicer.

But still: We won't write those files for you. It's your job (just like writing the code) to figure out how to setup your CMakeLists.txt and general build toolchain. Read the CMake documentation and tutorials and peek into existing code bases (like KDevelop itself) for how to use CMake.


current KDE projects: Quanta, KDevelop, Kate


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell