Sharpmake
Sharpmake copied to clipboard
IncludePaths do not support $() Variables
When adding IncludePaths, its not possible to use Msbuild/Visual Studio predefined macros, like $(ProjectDir), $(SolutionDir) etc. like this: conf.IncludePaths.Add("$(ProjectDir)../A");
This makes it extremely hard to add cross project include paths, like referencing includes defined in a library project inside an application.
Is this intended, and what is the solution? It seems that Sharpmake always resolves all paths to some relative representation, which is undesirable (in my opinion) for include paths.
Indeed, sharpmake resolves all of those because the output might not be vcxproj (for instance FastBuild bff files), where those variables don't mean a thing.
You're supposed to use sharpmake variables instead.
Ex: conf.IncludePaths.Add(@"[conf.ProjectPath]\..\A")
Note that it is recommended to set RootPath to the global root (a folder that encompasses all of your codebase), in a CommonProject constructor that would derive from Sharpmake.Project.
See an example of that here: https://github.com/ubisoft/Sharpmake/blob/e3886d2f1e709446fb1f9653f9712f3b37cabcd1/samples/HelloXCode/HelloXCode.CommonProject.sharpmake.cs#L36
Look at the rest of HelloXCode it's the most evolved sample we have at the moment, I'll try and update the others one day :)