How can I enable "Build in Parallel" on VS for a cutom build tool?

Is there a way to set the “Build In Parallel” property to Yes during cmake configuration of a visual studio project?
The build steps are added with add_custom_command.

No, I don’t think there’s currently a way to control this. What is it in parallel to? Other projects or targets/commands within the project?

Hi, it’s in parallel to other targets/commands.
In my case, the tool generates several headers, which could all be done in parallel, but the tool is run sequentially one by one. With the “Build in Parallel” option enabled, multiple tool invocations will be run in parallel.

I don’t think there’s a way to do that right now. I think you could attach a custom target to each custom command (then instead of listing the header in the library/executable target, add a dependency to the custom target(s)) and that should free them up to run concurrently with each other. The generated sources won’t be in the library/executable list in the IDE anymore though.

Just a remark:
As far as I understand, the “build in parallel” property for regular target is not supported by cmake neither.
You can achieve it by adding /MP option to the compiler options but cmake does not handle it
directly anyway.

I can get the behavior I want by performing a substitution in the generated vcxproj file.
(Get-Content custom_tool_use.vcxproj) -replace '</ItemDefinitionGroup>', '<CustomBuild> <BuildInParallel>true</BuildInParallel> </CustomBuild> </ItemDefinitionGroup>' | Out-File custom_tool_use.vcxproj

Is it possible to have cmake execute this after vcxproj files have been generated?

Not today, but it sounds like something that CMake can generate with an appropriate setting. Please file a feature request.