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:
-
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”
-
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).
-
Select “Open/Import Project…” from the Project menu.
-
In the open/import file browser that appears, navigate to “~/Documents/Unreal Projects/TestProject” and select “TestProject.kdev4” and click “Finish”
-
Select “Configure Launches” from the “Run” menu.
-
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.
-
A new item should be added to the list under ‘TestProject’ called “New Compiled Binary Launcher”. Click on it.
-
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/” -
Press “OK”
-
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).
-
Right click on “TestProject” in the project list and select “Open Configuration”
-
In “Custom Defines And Includes” click on the “Include/Imports” tab and then click the “Batch edit” button.
-
Paste the contents of “~/Unreal Projects/TestProject/.kdev4/Includes.txt” into the text area and click “OK”
-
Click “Apply”
-
In “Custom Defines And Includes” click on the “Defines” tab and the click the “Batch edit” button.
-
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?)
-
Click “Apply”
-
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