Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre/Post Build Commands #6

Open
BinaryAura opened this issue May 4, 2021 · 5 comments
Open

Pre/Post Build Commands #6

BinaryAura opened this issue May 4, 2021 · 5 comments

Comments

@BinaryAura
Copy link
Contributor

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.

oxygen.zip

@BinaryAura
Copy link
Contributor Author

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.

@Enhex
Copy link
Owner

Enhex commented May 5, 2021

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.

@SunnyMonster123
Copy link

SunnyMonster123 commented Aug 21, 2021

So is this going to be fixed? It's really frustrating that I have to copy my dll over to the exe directory.

@Enhex
Copy link
Owner

Enhex commented Aug 21, 2021

fork the repo and apply the changes.

@SunnyMonster123
Copy link

SunnyMonster123 commented Aug 21, 2021

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 😟

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants