-
-
Notifications
You must be signed in to change notification settings - Fork 637
Open
Labels
Description
For various reasons, I can't have Premake files in the root directory of the project, but have to put it into a subdirectory, let's call it build/premake
. This means that even my simplest project definitions look like this:
project "foo"
kind "StaticLib"
symbols "On"
local srcdir = "../../foo/"
vpaths {
["Source Files"] = srcdir .. "**.cpp",
["Header Files"] = srcdir .. "**.h",
}
includedirs { srcdir .. "include" }
files {
srcdir .. "include/foo/bar.h",
-- a dozen more of them...
srcdir .. "src/foo/foo.cpp",
-- and a dozen more of those...
}
Having to write srcdir ..
everywhere is aggravating.
My existing build system allows to do this instead
srcdir ../../foo; // This line makes all the paths relative to this directory.
library foo {
includedirs = include;
headers {
include/foo/foo.h
...
}
sources {
src/foo/foo.cpp
...
}
}
and I find this much more convenient.
So I wonder if a similar option could be added to Premake? I'd be willing to implement it, but I'd appreciate any hints about how to do it because I am not sure how to get an option set at the current project level in translate()
function which is where, I think, prepending of srcdir
should be implemented.