I have seen some projects, that structure the location of all units by 'topics' they belong to, for example by the following folder structure:
src/ controllers/ models/ stores/The individual folders could be added to the search path in the project options (or automatically by adding the units in the folder to the project).
But I've seen also some projects (mORMot for example), that reference the units by the filepath, for example:
uses
SomeController in 'src/controllers/somecontroller.pas',
SomeModel in 'src/models/somemodel.pas';
I like the second approach because it does not hide the folder structure and I immediately know where the units are located.
Lazarus can also resolve the path from the mainproject to the units when CTRL-clicking on the unit name. But when I'm in an unit beneath the
/src folder and I'm referencing another unit in this folder structure, Lazarus can't open the unit when I click on a unit name, as the path is relative to the project (and the search path of the compiler). The compiler finds the units without problems - I'm just talking about the CTRL-click action on a unit name.
Any hints how I can tell Lazarus to search for the unit in the correct folder? What are other disadvantages of specifying the unit path by the
in keyword? Seems that only a minority in the Pascal land uses this approach... ;-)
Thanks!