Pre/Post Build Commands
I'm now trying to automate version bumping through prebuildcommands and gitversion. While it does generate the cmake files. cmake module ignores prebuildcommands. I assume it also ignores the postbuildcommands.
I think add_dependencies() and add_custom_target() cmake functions will help here.
I have an example in here.
After a lot of review of the core gmake module adding
local steps = prj['prebuild' .. "commands"]
local msg = prj['prebuild' .. "message"]
steps = os.translateCommandsAndPaths(steps, prj.project.basedir, prj.project.location)
msg = msg or string.format("Running %s commands", "prebuild")
_p('add_custom_target(')
_p('\t"%sprebuild"', prj.name:lower())
_p('\tCOMMAND echo %s', msg)
_p('\t%s', table.implode(steps, "COMMAND ", "\n", "\n\tCOMMAND "))
_p('\tWORKING_DIRECTORY %s', prj.project.basedir)
_p(')')
_p('add_dependencies("%s" "%sprebuild")', prj.name, prj.name:lower())
after the cfg in project.eachconfig(prj) do
seems to be a temporary solution. I think to do anything much more complicated I think a refactor is called for, if for no other reason than to break up the monolith of a function that project's generate() function is. I'll be using my own fork/branch for this though.
Yeah you probably should fork. I'm not using this code so I won't be improving it, so might as well fork to skip the PR bureaucracy.
So is this going to be fixed? It's really frustrating that I have to copy my dll over to the exe directory.
fork the repo and apply the changes.
fork the repo and apply the changes.
Ahh... The thing is, I don't know Lua that well and I definitely don't know how CMake works 😟