{% set version = "3.19.4" %}

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

source:
  - url: https://gitlab.kitware.com/cmake/cmake/-/archive/v{{ version }}/cmake-v{{ version }}.tar.bz2
    sha256: 1f7b005c0f71dcc771fe8c0f193dc25745ff715d3a6d598160c5c5df363e1b2b
    folder: cmake
    patches:
      - patches/git/0001-Add-more-debug-logging-to-cmFindCommon.patch
  #   - patches/3.16.2/0001-find_-Add-debug-logging-infrastructure.patch
  #   - patches/3.16.2/0002-find_-Use-debug-logging-infrastructure.patch
  #   - patches/3.16.2/0003-Add-more-debug-logging-to-cmFindCommon.patch
  # Not until Python 3.8 on Windows: https://github.com/WorksApplications/SudachiPy/issues/107#issuecomment-564510365
  # - path: 'W:/src/cmake'
  #   path_via_symlink: True
  # git_url: 'C:/opt/Shared.local/src/cmake'
  # git_url: 'https://gitlab.kitware.com/cmake/cmake'
  # patches:
  #   - patches/git/0001-Add-more-debug-logging-to-cmFindCommon.patch
  - url: https://cmake.org/files/v{{ version[:4] }}/cmake-{{ version }}-win32-x86.zip  # [win32]
    sha256: 4d940a0e45bea2b07525add804184f3434684efa2ad72c22b3960933006929e4  # [win32]
  - url: https://cmake.org/files/v{{ version[:4] }}/cmake-{{ version }}-win64-x64.zip  # [win64]
    sha256: 24b03daf75ce59b542da38c829fe6944d3bf7cf99afaa8225cf29f7876823899  # [win64]
    folder: cmake-bin  # [win]

build:
  number: 0
  skip: True  # [win and vc<14]
  detect_binary_files_with_prefix: False
  ignore_run_exports:
    - vc

requirements:
  build:
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
    - make            # [unix]
#    - patch           # [not win]
#    - m2-patch        # [win]
#    - m2-gcc-libs     # [win]
#    - jom             # [win]
#    # - cmake           # [build_platform != target_platform]
#    # - git
#
  host:
#    - libcurl         # [unix]
#    - expat           # [unix]
#    - ncurses         # [unix]
#    - rhash           # [unix]
#    - bzip2
#    - xz
#    - zlib
#    - zstd
#    - libuv
    - openssl
    - ncurses

  run:
    - openssl
    - ncurses

test:
  files:
    - SSLTest.cmake
  commands:
    - cmake --version
    - cmake -V -P SSLTest.cmake
    - ctest --version
    - cpack --version
    - ccmake --version  # [unix]

about:
  home: http://www.cmake.org/
  license: BSD-3-Clause
  license_family: BSD
  license_file:
    - cmake/Copyright.txt
    - cmake/Utilities/cmbzip2/LICENSE         # [win]
    - cmake/Utilities/cmcurl/COPYING          # [win]
    - cmake/Utilities/cmexpat/COPYING         # [win]
    - cmake/Utilities/cmliblzma/COPYING       # [win]
    - cmake/Utilities/cmzlib/Copyright.txt    # [win]
    - cmake/Utilities/cmlibuv/LICENSE         # [win]
    - cmake/Utilities/cmlibrhash/COPYING      # [win]
    - cmake/Utilities/cmlibarchive/COPYING
    - cmake/Utilities/cmjsoncpp/LICENSE
  summary: CMake is an extensible, open-source system that manages the build process

extra:
  recipe-maintainers:
    - blowekamp
    - groutr
    - jakirkham
    - jschueller
    - ocefpaf
    - msarahan
    - scopatz
    - tadeu
    - marcelotrevisani
    - mingwandroid
