Speedup dependency resolution and installation for the sdk
Large list appending with hundreds of duplicate entries is a significant performance bottleneck in CMake. This keeps the dependency list for each library in a separate variable and only combines them at the end, removing duplicates as it goes.
Backport: release