Applying textures to walls of different dimentions

I am new to this community and in the process of learning Blender.
I want to use it to create maps for my rpg sessions.
I have a problem that I hope some of you can solve.
I have tried to apply textures to my map but the texture is good in some parts but other parts are streched. Fist I started by creating a vector image in GIMP that I extruded (1 image) but that dind’t work because when applying textures I got the stretsh problem:


I thought that the problem was that it was 1 image. So I started over by working with several walls each with there own texture. But that doesnt seem to work.

Does someone have an idead.

Select all wall faces, go to front orthographic (I think) and use UV/Box unwrap.

Thx for the reply
But I can’t seem to find it.
I tried to calculate the % difference (in one axis and extrapolate that to the scale) and found a formula that seem to work.
But that is to much work, I think there has to be another way.

In your material you are using the UV-coordinates. So i hope you know at least the basics about UV unwrapping (if not, find some tutorials for this). Therefore I don’t get what your problem is. Just mark all seams and hit U->Unwrap.

I found the problem after you got me thinking about unwrap.
The problem was that I changed the geometry of my cubes to create walls.
But I never reset the scale to 1
This is how I did it:

Object mode
Object > Apply > Scale

Edit mode
UV > Cube Projection

UV Editor
Scaled the faces of all my walls the same way
Shader mapping node of aal my wall: reset the mapping scale back to 1

Thx for the idea