image: adaskit/libsgm:0.1

variables:
  GIT_SUBMODULE_STRATEGY: recursive

stages:
  - build
  - test

.build_template: &build_definition
  stage: build
  tags:
    - docker
  script:
    - cmake . -DENABLE_SAMPLES=${build_samples} -DLIBSGM_SHARED=${build_shared} -DENABLE_TESTS=${build_tests}
    - make

build:samples_on:shared:
  variables:
    build_samples: "ON"
    build_shared: "ON"
    build_tests: "OFF"
  <<: *build_definition

build:samples_on:static:
  variables:
    build_samples: "ON"
    build_shared: "OFF"
    build_tests: "OFF"
  <<: *build_definition

build:samples_off:shared:
  variables:
    build_samples: "OFF"
    build_shared: "ON"
    build_tests: "OFF"
  <<: *build_definition

build:samples_off:static:
  variables:
    build_samples: "OFF"
    build_shared: "OFF"
    build_tests: "OFF"
  <<: *build_definition

build:test:
  variables:
    build_samples: "OFF"
    build_shared: "OFF"
    build_tests: "ON"
  artifacts:
    paths:
      - ./test/sgm-test
    expire_in: 1d
  <<: *build_definition

test:
  stage: test
  tags:
    - nvidia-docker
  script:
    - ./test/sgm-test
  dependencies:
    - build:test

image: adaskit/libsgm:0.1

variables:
  GIT_SUBMODULE_STRATEGY: recursive

stages:
  - build
  - test

.build_template: &build_definition
  stage: build
  tags:
    - docker
  script:
    - cmake . -DWITH_OPENCV="ON" -DENABLE_SAMPLES=${build_samples} -DLIBSGM_SHARED=${build_shared} -DENABLE_TESTS=${build_tests}
    - make

build:samples_on:shared:
  variables:
    build_samples: "ON"
    build_shared: "ON"
    build_tests: "OFF"
  <<: *build_definition

build:samples_on:static:
  variables:
    build_samples: "ON"
    build_shared: "OFF"
    build_tests: "OFF"
  <<: *build_definition

build:samples_off:shared:
  variables:
    build_samples: "OFF"
    build_shared: "ON"
    build_tests: "OFF"
  <<: *build_definition

build:samples_off:static:
  variables:
    build_samples: "OFF"
    build_shared: "OFF"
    build_tests: "OFF"
  <<: *build_definition

build:test:
  variables:
    build_samples: "OFF"
    build_shared: "OFF"
    build_tests: "ON"
  artifacts:
    paths:
      - ./test/sgm-test
    expire_in: 1d
  <<: *build_definition

test:
  stage: test
  tags:
    - nvidia-docker
  script:
    - ./test/sgm-test
  dependencies:
    - build:test

Update GitLab CI for WITH_OPENCV option
Update GitLab CI for WITH_OPENCV option
