I want to take advantage of Ninja\'s \"job pools\" in my custom commands; something finally directly supported in cmake 3.15.0. Many/most people won\'t have this version, so I
According to @Tsyvarev, my approach is reasonable. In my code, which "works", I implemented something similar to this:
set(USE_JOB_POOL 0)
if("${CMAKE_GENERATOR}" STREQUAL "Ninja" AND
"${CMAKE_VERSION}" STRGREATER_EQUAL "3.15.0")
set(USE_JOB_POOL JOB_POOL my_job_pool)
endif()
...
add_custom_command(
OUTPUT foo
COMMAND ${CMAKE_COMMAND} -E touch foo
$<${JOB_POOL}:${JOB_POOL}>
VERBATIM
)