www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - local dub dependencies - relative paths, copyFiles, etc

reply DanielG <simpletangent gmail.com> writes:
First issue:

I have a dub project (executable) that's dependent on another 
local dub project (library). It's cross-platform but I'm having 
this problem in Windows at the moment...

My D library links against a win32 DLL/LIB, and I'm specifying 
that in the dub.sdl for the library, relative to the library root 
/ dub.sdl location. Sensible, no?

However, when building the executable - in another location, 
referring to the library via a relative local path, I'm forced to 
modify the location of the win32 .LIB specification to be 
relative to my executable dub file, *not* the library.

So it seems like dub forgets to calculate the path relative to 
the library, where the path is specified in the first place.

Is this expected behavior? Is there some kind of special relative 
root I need to use in the library's dub.sdl?

Second issue (perhaps related?)

I'm specifying a copyFiles in the library project to gather up 
all the requisite .DLLs, which I would hope would be copied to my 
executable's target path ... but that doesn't appear to be 
working. The "copying files..." step shows up in the dub output, 
but no matter how I specify it (relative to library or executable 
or just gibberish), it appears nothing is happening during that 
May 03 2019
parent DanielG <simpletangent gmail.com> writes:
Update: using the $PACKAGE_DIR environment variable for relative 
paths solved both issues.
May 04 2019