[cmake-developers] VS custom commands with VS variable containing space in executable path?

Brad King brad.king at kitware.com
Fri Aug 26 13:30:16 EDT 2016


On 08/26/2016 12:43 PM, Robert Goulet wrote:
>       COMMAND "$(WindowsSdkDir)/bin/x64/makecert.exe"
> 
> So how do we setup a custom command that uses a Visual Studio variable
> that requires to be quoted to preserve spaces?

I don't think it is supported.  You could try adding a wrapper
around the call so that it appears as an argument instead of in
the command.

  COMMAND ${CMAKE_COMMAND} -E env "$(WindowsSdkDir)/bin/x64/makecert.exe" ...

OTOH you're trying to pierce CMake's abstract model of a command
(which is why it's not supported).  Instead you could find_program
the tools you need and reference them by absolute path.

-Brad



More information about the cmake-developers mailing list