parameters:
  - name: Artifacts
    type: object
    default: []
  - name: ArtifactsSource
    type: object
    default: []
  - name: ServiceDirectory
    type: string
    default: not-specified
  - name: CMakeTestOptions
    type: object
    default: []
  - name: CMakeSourceTestOptions
    type: object
    default: []
  - name: TimeoutInMinutes
    type: number
    default: 120

jobs:
- template: /eng/common/pipelines/templates/jobs/generate-job-matrix.yml
  parameters:
    MatrixConfigs:
      - Name: base
        Path: eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json
        Selection: all
        GenerateVMJobs: true
    JobTemplatePath: /eng/pipelines/templates/jobs/cmake-generate.tests.yml
    OsVmImage: $(LINUXVMIMAGE)
    Pool: $(LINUXPOOL)
    GenerateJobName: generate_matrix_cmake
    AdditionalParameters:
      Artifacts: ${{ parameters.Artifacts }}
      ServiceDirectory: ${{ parameters.ServiceDirectory }}
      CMakeTestOptions: ${{ parameters.CMakeTestOptions }}

- template: /eng/common/pipelines/templates/jobs/generate-job-matrix.yml
  parameters:
    MatrixConfigs:
      - Name: base
        Path: eng/pipelines/templates/stages/platform-matrix-cmakesourcegenerate.json
        Selection: all
        GenerateVMJobs: true
    JobTemplatePath: /eng/pipelines/templates/jobs/cmake-generate.tests.yml
    OsVmImage: $(LINUXVMIMAGE)
    Pool: $(LINUXPOOL)
    GenerateJobName: generate_matrix_cmake_source
    AdditionalParameters:
      Artifacts: ${{ parameters.ArtifactsSource }}
      ServiceDirectory: ${{ parameters.ServiceDirectory }}
      CMakeTestOptions: ${{ parameters.CMakeSourceTestOptions }}
      JobName: CMakeSourceGenerate
