Setting Up KDevelop for UE4 Projects in Linux

I’m new to using KDevelop and it took me a while to scavenge the information needed to get it working reasonably well so I just wanted to document what I do when setting up a UE4 project with KDevelop in Linux for anyone else that may be struggling with it and maybe to get some pointers from others who might know more about this than I do.

I’m going to assume that the unreal source code is in “~/UnrealEngine” (this is the top folder you get when you clone the repo).
So here goes:

  1. Create a new c++ project from the UE4 Editor. For this example I’ll assume the project was named “TestProject” and that the project path is “~/Documents/Unreal Projects/TestProject”

  2. Open up KDevelop (Kdevelop does not open automatically for me after creating the project… if anyone knows how to fix this, I’d love to know).

  3. Select “Open/Import Project…” from the Project menu.

  4. In the open/import file browser that appears, navigate to “~/Documents/Unreal Projects/TestProject” and select “TestProject.kdev4” and click “Finish”

  5. Select “Configure Launches” from the “Run” menu.

  6. Click on “TestProject” in the list at the left side and then click the “Add New…” button and select “Compiled Binary” from the drop down menu that appears.

  7. A new item should be added to the list under ‘TestProject’ called “New Compiled Binary Launcher”. Click on it.

  8. In the form on the right side, fill in the following values:
    Executable: “~/UnrealEngine/Engine/Binaries/Linux/UE4Editor”
    Arguments: “~/Documents/Unreal Projects/TestProject/TestProject.uproject”
    Working Directory: “~/UnrealEngine/Engine/Binaries/Linux/”

  9. Press “OK”

  10. click on the "Run"menu and then “Current Launch Configuration” and the select “TestProject : New Compiled Binary Launcher” (I don’t know how to make this selection stick after closing kdevelop… save all doesn’t seem to do it… if anyone knows, please let me know).

  11. Right click on “TestProject” in the project list and select “Open Configuration”

  12. In “Custom Defines And Includes” click on the “Include/Imports” tab and then click the “Batch edit” button.

  13. Paste the contents of “~/Unreal Projects/TestProject/.kdev4/Includes.txt” into the text area and click “OK”

  14. Click “Apply”

  15. In “Custom Defines And Includes” click on the “Defines” tab and the click the “Batch edit” button.

  16. Paste the contents of “~/Unreal Projects/TestProject/.kdev4/Defines.txt” into the text area and click “OK”

(I can’t get the includes and defines to stick after closing kdevelop… is this step even necessary?)

  1. Click “Apply”

  2. Click “OK”

At this point I’ll usually do a buidl by right clicking on the project in the project list and selecting ‘Build’. Then I go back to the configuration (right click on the project name and select “Open Configuration”), select “Custom BuildSystem” along the left side and then select 'TestProjectEditor" from the “Build Configuration” dropdown and press OK. After that selection, rightclicking on the project and selecting build will compile all of the code I write (I think it’s the same command that runs when you compile from the editor).

Also, clicking on the “Execute” button will open the correct project in the editor.
18. Click on “Custom BuildSystem”

So that’s what I’m doing right now and it is working for now. I’d like to learn how to do it properly so if anyone can see things I’m doing wrong or could do better, please let me know… or if you have any questions about getting your project set up ask away and maybe I or someone else can help.

Cheers!
Andrew

2 Likes

I have problems with this, no .kdev4 files or any files other than some c++ files if I add a class from inside the editor.

Yep, works fine :slight_smile:

@Rob-bb : I believe you need to display hidden directories in your <PROJECT> directory.
What you should do, for example in a Nautilus / file browser, hit CTRL-H (show hidden files/directories); This will make the .kdev4 (directory) show up.

Hope this helps!

Cheers

I can’t find “New compiled binary launcher”, and I can’t find “Custom defines and includes”. I’m using KDevelop 4.6.

I think there are some other issues here, I can only get this to work if I create the project in the ~/Documents/Unreal Projects/ directory, if I try something else for example ~/Projects/UE4-Projects/ it will fail to generate the necessary c++ files, but it will happily create a blueprints project anywhere. So my work around is create in ~/Documents/Unreal Projects/ and then move the directory to where I want it. After creation the editor does not seem to care about the location.

LOL! What are you doing?

You can very easily import any CMake project into KDevelop!
Just from Menu <Project> select <Open / Import Project…>
navigate to your Project folder and select the CMakeLists.txt

That’s it!

:smiley:

… never mind

Oops… sorry, I see
That’s what importing the .kdev4 will do anyway… :smiley:
it is set to invoke the KDevCustomBuildSystem.
Still you have to configure the launches etc.
So, just ignore my silly post. :confused:

I still can’t get kde to work following your instructions. I keep getting the error that the program exited with 0.

Don’t know if you ever got this resolved, but I think this is implemented in Kdev 4.7