Does Visual D support wildcards in build events?

Rainer Schuetze r.sagitario at gmx.de
Sun Feb 21 10:29:14 UTC 2021



On 20/02/2021 10:25, Jedi wrote:
> On Saturday, 20 February 2021 at 08:50:53 UTC, Rainer Schuetze wrote:
>> Hi,
>>
>> On 18/02/2021 09:04, Jedi wrote:
>>> I'm having to hard code names and this is causing problems when I
>>> move the projects since they refer to the wrong locations. Basically
>>> the same stuff that C++/C#/VB/etc supports. I mainly just need the
>>> output exe as a special token that changes with the project type.
>>>
>>
>> If you are using the visualdproj projects, this might help:
>> https://rainers.github.io/visuald/visuald/ProjectConfig.html
>>
>> When using the vcxproj, you have all the VC macros available.
>>
>> If this isn't what you mean or doesn't help, you will have to be more
>> specific.
> 
> So, they do work but they give releative paths. OUTDIR gives Win32/Debug.

The macros just contain what's set in the respective project options. I
think that's ok as a default as command line options usually work this way.

> 
> For reference, [You could add this to the docs/link]
> 
> echo DMDINSTALLDIR - $(DMDINSTALLDIR)
> echo WINDOWSSDKDIR - $(WINDOWSSDKDIR)
> echo DEVENVDIR - $(DEVENVDIR)
> echo VSINSTALLDIR - $(VSINSTALLDIR)
> echo VISUALDINSTALLDIR - $(VISUALDINSTALLDIR)
> echo PLATFORMNAME - $(PLATFORMNAME)
> echo CONFIGURATIONNAME- $(CONFIGURATIONNAME)
> echo OUTDIR - $(OUTDIR)
> echo INTDIR - $(INTDIR)
> echo INPUTPATH - $(INPUTPATH)
> echo INPUTDIR - $(INPUTDIR)
> echo INPUTFILENAME - $(INPUTFILENAME)
> echo INPUTEXT - $(INPUTEXT)
> echo INPUTNAME - $(INPUTNAME)
> echo PROJECTPATH - $(PROJECTPATH)
> echo PROJECTDIR - $(PROJECTDIR)
> echo PROJECTFILENAME - $(PROJECTFILENAME)
> echo PROJECTEXT - $(PROJECTEXT)
> echo PROJECTNAME - $(PROJECTNAME)
> echo SOLUTIONPATH - $(SOLUTIONPATH)
> echo SOLUTIONDIR - $(SOLUTIONDIR)
> echo SOLUTIONFILENAME - $(SOLUTIONFILENAME)
> echo SOLUTIONEXT - $(SOLUTIONEXT)
> echo SOLUTIONNAME - $(SOLUTIONNAME)
> echo TARGETPATH - $(TARGETPATH)
> echo TARGETDIR - $(TARGETDIR)
> echo TARGETFILENAME - $(TARGETFILENAME)
> echo TARGETEXT - $(TARGETEXT)
> echo TARGETNAME - $(TARGETNAME)

I was considering adding the list of macro variables as in VC that also
shows the expansions, but never got to it. Maybe dumping to the output
pane would be good enough.

> 
> I'm having to build the path to the exe, maybe you could add one directly?
> 
> "$(PROJECTDIR)\$(TARGETPATH)"
> 
> Seems to be the path to the exe.

%CD%\$(TARGETPATH) should also work.

> 
> Or just add ABSTARGET* or similar for the absolute target path. The
> reason it might be a good idea to add is 1. It's easy. 2. It's confusing
> to have to figure out what the right combination is(although with the
> echo's it helps but may not be as robust as it looks).
> 

Both versions above don't work when the path in the project is already
absolute, though. VC has e.g. $(OutDirFullPath). I'll consider adding
something similar.


More information about the Digitalmars-d-ide mailing list