It’s not really that my install logic relies on the restore, but that using the --target INSTALL
is a short way of building+installing.
From my understanding, cmake --install
does not trigger the build step, which is expected, so I do not expect that command to trigger a nuget restore. On the other hand cmake --build XXX --target INSTALL
does trigger the build step, I assume because INSTALL depends on ALL_BUILD or something like that, so I would expect it to do the nuget restore step.
My current workaround is to set INSTALL_REQUIRES_VS_PACKAGE_RESTORE
, which seems to work.