I have custom wrapper over CMake, which perform configuring, compilation, and creating distrib for various platforms (win32, SunOS and so on) and different compilers. I need to put into distrib all needed runtime libraries (libgcc_s.so, libstdc++.so for *nix like OS. msvcr90.dll, msvcp100.dll for win32). For example, gcc has mechanism, which allows to get full names of these libraries:
# get location of libgcc_s of default compiler
bash-3.2$ g++ -print-file-name=libgcc_s.so
/usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/../../../libgcc_s.so
# get location of libstdc++ of custom compiler
bash-3.2$ g++-4.5.3 -print-file-name=libstdc++.so
/u/gccbuild/installed/gcc-4.5.3/lib/gcc/sparc-sun-solaris2.10/4.5.3/../../../libstdc++.so
So i need similar mechanism for msvc (2008, 2010), is this possible? (It can be environment variable for given compiler, or registry value, or smth else). Or maybe there is some CMake mechanism for obtaining such information.
You could use the InstallRequiredSystemLibraries cmake-module. for CMake which will add the msvc dlls (and manifests) to your cmake-install target.
As an alternative, you could write your own little cmake code which checks the registry for installed visual studio versions and finds the vcredist. You could then add the vcredist package to your own distribution and "slipstream" its installation in your own installer.
E.g. something like the following will search for vcredist_2010 and add it to the NSIS installer: