MarkSchofield / WindowsToolchain

A repository containing a CMake toolchain for using MSVC
MIT License
106 stars 19 forks source link

Include the VS toolset and Win32 SDK binary paths in the CMAKE_PROGRAM_PATH #119

Closed MarkSchofield closed 3 weeks ago

MarkSchofield commented 3 weeks ago

114 called out that toolset-related tooling can't be found in CMake using a common CMake idiom - find_program relying on CMAKE_PROGRAM_PATH. In the case of #114, it was nmake, but in investigating #115, it would also be useful in finding MASM - allowing the default CMake logic to find MASM without explicitly setting/managing, say, CMAKE_ASM_MASM_COMPILER. This PR adds two paths to CMAKE_PROGRAM_PATH:

  1. The path to the host- and target- resolved path to the MSVC toolset tools. This would allow CMake to find, say, nmake.exe, ml64.exe and armasm64.exe.
  2. The path to the Windows SDK binaries. This would allow CMake to find, say, mt.exe and signtool.exe.

There's an option to opt-out: setting TOOLCHAIN_UPDATE_PROGRAM_PATH to OFF will not update CMAKE_PROGRAM_PATH.