Relative paths for external TOXes

I have a project which loads external TOX B which has another TOX A.
TOX A has a CPlusPlus TOP which loads DLL. How can I make reference to .dll relative to the TOX A file?

Ideally, I would like to have TOX A “bundled” with .dll file. So that no matter where (on which machine) this TOX is loaded, it’ll work (even if you have to copy .dll separately, and place it in special folder)?

project.folder

returns the project folder for a given toe file.

You could use something like:

project.folder + '/any/additional/path/to/a/file.dll'

Sorry to bring up a old thread.

Wondering if there have been any updates on this, or maybe I’m missing something.

Its the same issue as above, is it possible to have relative file paths to a tox?

Scenario:
Tox A is several folders deeper than where the main project is stored. Using the project.folder command it seems like I still need to manually list what folders are between the .toe file and the saved tox file.
In this scenario Tox A is setup as a separate git repository. Ideally someone could download this Tox, put it in their project as a git submodule, and have everything linked regardless of where the tox is located in their project.

Thanks :slight_smile:

Relative paths also work for TOX files - so as long as your folder / submodules live in your project folder you can use that relative path system. You are still then on the hook for the rest of the folders between if it’s somehow nested in the project folder.

These days I usually create a folder called “td-modules” and keep my toxes in there. That makes some of this a little easier to wrangle. I don’t think that totally meets your needs here… there’s also several path management methods in the tdu class that might be worth looking into:

PathInfo() might be helpful here along with:
collapsePath()

Interestingly, you might also look at the project class

The paths member might be another avenue for getting the path info you’d like into your project / tox.

I usually do it like this:

tdu.expandPath(parent().par.externaltox.val+'/..')+"/my/relative/path"

Clunky, but it works

1 Like

It’s less clunky then the road I was going down, this is great. Thanks to both of you for your help with this!