I have some code I reuse across multiple projects. It’s code I use for a flag system, event system, etc. It’s a good number of classes and it’s growing slowly.
Problem
When I edit or update the code in one project it needs to be migrated to all others using the code. This means the code has to update the MYPROJECT_API tags and MyProject.h headers all over. Changing these and copying the code back and forth is very messy.
Question
Is it possible to put all these classes into a separate Project and include it in all the solutions that are using it? So it can be easily reference it in via #include. Similar to a namespaced public project in C#.
I’ve heard about editing the build.cs etc. but how exactly would I do this? Does anyone have any experience on this?
Example
For Example: I would like to use the public classes in Wingless (A UE4 Project) in the current solution for MerForge (Also UE4 Project).
You can write your reusable code in plugins/modules or even just plain class/folder structure. Then you add proper include paths in your Build.cs files.
I would like to use the class/folder structure, since the code isn’t actually a plugin. Do you have any advice or examples on how to link it in the build.cs. I’m having trouble finding a clear example.
I am also looking for an answer to exactly what you ask for, did not really understand the answer below. How do you solve the MYPROJECT_API tags that has to be changed between different projects?