Wither cmake on gitlab windows shared runner?

I’m trying to build a Windows version of graphviz using the gitlab windows shared runner.

I’m not finding “cmake” (or “msbuild”) in the default PATH.

Could someone tell me where it is? And also, in general how, to find other tools on the runner?

I dont have a Windows machine that I can play on locally, so I’m making incremental extensions to the “script:” section in .gitlab-ci.yml. A very painful process with a 30min turn-around wait for a result.

Here is the Windows fragment of my .gitlab-ci.yml so far:

windows-build: tags: - shared-windows - windows - windows-1809 stage: build script: - echo "running scripts in the build job" - Set-Variable -Name "GV_VERSION" -Value (cat VERSION) - Set-Variable -Name "COLLECTION" -Value (cat COLLECTION) - echo ${GV_VERSION} - echo ${COLLECTION} - tar xzf graphviz-${GV_VERSION}.tar.gz - cd graphviz-${GV_VERSION} - cmake -G "Visual Studio 14 2015 Win64" - cmake --build .

and this is the error I’m getting;

`$ cmake -G "Visual Studio 14 2015 Win64"` ` cmake : The term 'cmake' is not recognized as the name of a cmdlet, function, script file, or operable program. Check ` ` the spelling of the name, or if a path was included, verify that the path is correct and try again.` ` At line:1 char:1` ` + cmake -G "Visual Studio 14 2015 Win64"` ` + ~~~~~` ` + CategoryInfo : ObjectNotFound: (cmake:String) [], CommandNotFoundException` ` + FullyQualifiedErrorId : CommandNotFoundException` ` ` ` ERROR: Job failed: exit status 1`

Thanks in advance for any advice.

I can offer a partial answer.

  • To run commands (such as msbuild.exe), don’t forget to prefix with & in your .yml file.
  • To run msbuild.exe, try:
  msbuild: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe'

  stage: build
    - '& "$msbuild" my.vcxproj
1 Like