2)
I just tested (Lazarus 2.3 - Win10), this works as host application:
$(ProjSrcPath)\..\foo\project1.exe
Search the IDE for "GlobalMacroList" and you should get all the macros that are added.
I need say this first: Well you are right. I didn't find it before, thank you.
This seems to solve my problem in OP, at least in Windows as "$(ProjSrcPath)\..\..\foo\project1.exe" translates to "c:\project1\..\..\foo\project1.exe".
Then this "semi relative" path ("c:\project1\..\..\foo\project1.exe") can be used with FileExists, and the error is not raised anymore.
So, I'm not sure we **really** need relative paths anymore.
How could we make this more visible in the IDE, Help and Wiki?
Anyway, this code in Main.pp:
// Check project build
ProgramFilename := MainBuildBoss.GetProjectTargetFilename(Project1);
...
if ((DebugClass = nil) or DebugClass.RequiresLocalExecutable)
and not FileExistsUTF8(ProgramFilename)
then begin
debugln(['Info: (lazarus) [TMainIDE.DoInitProjectRun] File TargetFile found: "',ProgramFilename,'"']);
IDEMessageDialog(lisFileNotFound,
Format(lisNoProgramFileSFound, [ProgramFilename]),
mtError,[mbCancel]);
Exit;
end;
Seems wrong to me. I mean not really wrong, but maybe in wrong place.
In my point of view (well, POV of someone not familiar with the IDE code), the responsibility of verify if the debugger can run the project build, should be of the debugger class.
So this code should be in "DebugBoss.InitDebugger" or in something like "DebugBoss.CheckPrerequisites".