{% set name = "gts" %}
{% set version = "0.7.6" %}

package:
  name: {{ name }}
  version: {{ version }}

source:
  - url: http://downloads.sourceforge.net/gts/gts-{{ version }}.tar.gz
    sha256: 059c3e13e3e3b796d775ec9f96abdce8f2b3b5144df8514eda0cc12e13e8b81e
    patches:
      - config.in.win32.patch
      - 0001-Disable-USE_PREDICATES_INIT.patch  # [build_platform != target_platform]
  - path: CMakeLists.txt

build:
  number: 2
  run_exports:
    - {{ pin_subpackage(name, max_pin='x.x') }}

requirements:
  build:
    - gnuconfig  # [unix]
    - {{ compiler('cxx') }}  # [not win]
    - {{ compiler('c') }}    # [not win]
    - vs2017_win-64          # [win]
    - cmake       # [win]
    - ninja       # [win]
    - make        # [not win]
    - pkg-config  # [not win]
  host:
    - glib


test:
  commands:
    - test -f ${PREFIX}/lib/libgts.so  # [linux]
    - test -f ${PREFIX}/lib/libgts.dylib  # [osx]
    - if not exist %LIBRARY_PREFIX%\\bin\\gts.dll exit 1  # [win]

about:
  home: http://gts.sourceforge.net/
  license: LGPL-2.0-or-later
  license_file: COPYING
  summary: |
    GNU Triangulated Surface Library

extra:
  recipe-maintainers:
    - seanyen
    - traversaro
