[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.
Please sign in to leave a comment.
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.
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