How to set MSVC_REDIST_DIR?

Hi,

I want to automatically copy dlls into my install folder with include(InstallRequiredSystemLibraries).
However, with VS2019, toolset v142, I am getting:

CMake Warning at C:/Program Files/CMake/share/cmake-3.25/Modules/InstallRequiredSystemLibraries.cmake:625 (message):
  system runtime library file does not exist:
  'MSVC_REDIST_DIR-NOTFOUND/x64/Microsoft.VC142.CRT/msvcp140.dll'
Call Stack (most recent call first):
  cmake/knime_package_support.cmake:63 (include)
  CMakeLists.txt:465 (include)

I was trying to debug your module: https://gitlab.kitware.com/search?group_id=415&project_id=541&repository_ref=master&scope=blobs&search=MSVC_REDIST_DIR

but the MSVC_REDIST_DIR is indeed never set for VS 15+ in your code.
How is this supposed to work then?

Thanks,
J

I found out, how it is supposed to work:
https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/InstallRequiredSystemLibraries.cmake#L317

But my VC/Redist folder does not have such a .CRT file. Can you guarantee that this is always there?

I have some msms in
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\v142\MergeModules\Microsoft_VC142_CRT_x64.msm
And the redistributable installers:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\v142\vc_redist.x64.exe

I updated VS via the installer and I now have a C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.9xxxxxx folder that contains more files, including the DLLs.
Weird…