0

Evening,

I am trying to get a ci pipeline working for my cs class about windows driver. For this I am using the Enterprise WDK which is a command line build environment that does not require any installation prior to use. See: https://learn.microsoft.com/en-us/windows-hardware/drivers/develop/using-the-enterprise-wdk

When building the driver with msbuild from the EWDKthrough the solution file the build succeeds. On the other hand, when calling cmake it incorrectly detects EWDK as Building for: Visual Studio 17 2022 and therefore generates VCTargetsPath.vcxproj with <PlatformToolset>v143</PlatformToolset> although the EWDK is shipped with v142 and Visual Studio 2019.

When using the same CMakeList.txt with VS2019 Pro + WDK on my notebook cmake correctly detect everything correctly.

Is there any way to manually overwrite the Toolset or to point cmake in the right direction to choose the correct VS version?

Regards Artur

Artur K.
  • 599
  • 1
  • 6
  • 11
  • "Is there any way to manually overwrite the Toolset or to point cmake in the right direction to choose the correct VS version?" - When run `cmake`, pass proper [generator](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#visual-studio-generators) using `-G` option. – Tsyvarev Feb 03 '22 at 23:37
  • @Tsyvarev Thanks for the answer. Do you have any clue why cmake chooses VS2022 although no other version is installed? It's basically a fresh windows server Installation with cmake and the iso mounted and nothing else. – Artur K. Feb 04 '22 at 00:12
  • 1
    Probably, despite that VS2022 is not installed, some of its keys present in Windows registry. You may look into [that question](https://stackoverflow.com/questions/6430251/what-is-the-default-generator-for-cmake-in-windows) about default generator in CMake. – Tsyvarev Feb 04 '22 at 07:49

0 Answers0