Help in compiling C++ code external to UE4 (it's a sort of library)

Thank you for the explanation, I will consider it.

But it’s not exactly what I would like to do. I don’t want to copy the library code into my UE4 project folder. Instead, I would like to tell UE build system where the library code is located (meaning, outside the project folder: any other place in the filesystem). This would be very useful, since edits applied to the library code are automatically applied for every project that uses that code base. Do you have any idea on how to do that?