[MSBuild] Vcpkg does not work with teamcity

When I build my project using teamcity it does not see vcpkg directories. If I execute the build command from the build log manually on the same build agent - it works perfectly.

Build Tools 2022
Vcpkg is integrated and installed globally.

 

0
2 comments
Hi! Which command fails, and what is the output? Feel free to retrieve the full build log (go to the Build Log page > Download log > select Full build log or Zip) at upload it via https://uploads.jetbrains.com/ (be sure to post the upload ID).
Additionally, if the manually run command succeeds, running it in TeamCity through the Command Line runner should also work. You might want to use that as a workaround.
0

The issue was resolved by adding this to vcproj:
<Import Project="C:\Program Files (x86)\vcpkg\scripts\buildsystems\msbuild\vcpkg.props" />
<Import Project="C:\Program Files (x86)\vcpkg\scripts\buildsystems\msbuild\vcpkg.targets" />

See this: https://learn.microsoft.com/en-us/vcpkg/users/buildsystems/msbuild-integration.

Note: add this to the bottom of your vcproj file, it must see all info above. Otherwise it will build wrong triplet (always MD for example)

Seems like it does not work by default due to virtualized environment in teamcity or something like this




0

Please sign in to leave a comment.