CMake question

So I’m trying to do something and I’m sure there is a more effective way since I’m not very familiar with Git or CMake. I can compile my own binaries from sources, etc, but that’s about the extent of my knowledge.

I have about 10 different sources (git repos) that I use to compile binaries. Ultimately what I’m trying to do is pull all of these repos and update them, have CMake make new project files with the updated repos, and then build them and output into a directory structure like this:

X:\Builds\repo 1<git commit number>

X:\Builds\repo 2<git commit number>


Most of this I can do manually, with the exception of building to a new directory with the name being the git commit. I have the git pulls covered, I use a batch file to update all of the repos. But automating the process past this is beyond my knowledge.

Can anyone help shed some light on what I’m trying to accomplish?

Take a look at what appveyor does in it’s script

I would recommend using some bash shell, like git bash instead of using windows commandline - windows cli is simply hard to use for anything.

Im sure you can google a way to use git bash to get the current version hash from your repo and using that as the output folder should be relatively straight forward.
Also you dont need to directly build to a new folder. You can build and then move/rename the build folder or it’s contents.

Cmake takes some arguments too, which may let you select the build output folder.
cmake generates an install project that you can try to build to move the files after buinding them to the cmake configured installation folder.

CMake has a command which allows you to invoke the underlying make programm (nmake, make, ninja…) through

cmake --build YOUR_CMAKE_DIRECTOY --config Release --target YOUR_TARGET