In my jamroot I have
use-project /myproject : $(TOP)/path/to/jamfile/dir/of/my/project ;
use-project is documented here.
Let's say myproject defines a library mylib
I can then do in a jamfile:
lib myotherlib : $(SRC)
/myproject//mylib<link>shared
;
instead of:
lib myotherlib : $(SRC)
relative/path/to/jamfile/dir/of/my/project//mylib<link>shared
;
But how can I programmatically get the path that the id /myproject points to, i.e. $(TOP)/path/to/jamfile/dir/of/my/project ?
This could be useful for various reasons:
- not have to define ids for subprojects of "myproject" (i.e. jamfiles in subdirectories of $(TOP)/path/to/jamfile/dir/of/my/project)
- share some resources files
Here is one function that allows that:
You can use it like this:
(which is just an example, the id would be better here, obviously).
Note: I found no clean way to avoid an intermediary variable, only the ugly: