Merge pull request #10313 from P-I-Engineer/patch-1
[inav.git] / cmake / ci.cmake
blob4546a8b6303a67cd578681ef6a62232a19e02bed
1 if(DEFINED CI_JOB_INDEX AND DEFINED CI_JOB_COUNT)
2     math(EXPR job_name "${CI_JOB_INDEX}+1")
3     message("-- configuring CI job ${job_name}/${CI_JOB_COUNT}")
4     get_property(targets GLOBAL PROPERTY RELEASE_TARGETS)
5     list(LENGTH targets count)
6     math(EXPR per_job "(${count}+${CI_JOB_COUNT}-1)/${CI_JOB_COUNT}")
7     message("-- ${per_job} targets per job")
8     math(EXPR start "${CI_JOB_INDEX}*${per_job}")
9     list(SUBLIST targets ${start} ${per_job} ci_targets)
10     message("-- will build targets: ${ci_targets}")
11     add_custom_target(ci
12         ${CMAKE_COMMAND} -E true
13         DEPENDS ${ci_targets}
15 endif()