<?xml version="1.0" encoding="utf-8" standalone="no"?>
<installer-gui-script minSpecVersion="1">
    <title>${AF_TITLE}</title>
    <welcome    file="${WELCOME_FILE_OUT}" />
    <readme     file="${README_FILE_OUT}" mime-type="test/html" />
    <license    file="${CMAKE_MODULE_PATH}/../LICENSE" mime-type="test/plain" />
    <script>
      function CheckBackendSelected() {
      return choices.opencl_lib.selected ||
            choices.cuda_lib.selected ||
            choices.cpu_lib.selected;
      }
    </script>

    <pkg-ref id="com.arrayfire.arrayfire.cpu.lib"       version="${AF_VERSION}" onConclusion="none">ArrayFireCPU.pkg</pkg-ref>
    <pkg-ref id="com.arrayfire.arrayfire.cuda.lib"      version="${AF_VERSION}" onConclusion="none">ArrayFireCUDA.pkg</pkg-ref>
    <pkg-ref id="com.arrayfire.arrayfire.opencl.lib"    version="${AF_VERSION}" onConclusion="none">ArrayFireOPENCL.pkg</pkg-ref>
    <pkg-ref id="com.arrayfire.arrayfire.unified.lib"   version="${AF_VERSION}" onConclusion="none">ArrayFireUNIFIED.pkg</pkg-ref>
    <pkg-ref id="com.arrayfire.arrayfire.inc"           version="${AF_VERSION}" onConclusion="none">ArrayFireHeaders.pkg</pkg-ref>
    <pkg-ref id="com.arrayfire.arrayfire.extra"         version="${AF_VERSION}" onConclusion="none">ArrayFireExtra.pkg</pkg-ref>
    <options customize="always" require-scripts="false"/>
    <choices-outline>
        <line choice="libs">
            <line choice="cpu_lib"/>
            <line choice="cuda_lib"/>
            <line choice="opencl_lib"/>
            <line choice="com.arrayfire.arrayfire.unified.lib"/>
        </line>
        <line choice="com.arrayfire.arrayfire.inc"/>
        <line choice="com.arrayfire.arrayfire.extra"/>
    </choices-outline>
    <choice id="libs" title="ArrayFire Libraries" visible="true" />
    <choice title="CPU Libraries"
            description="ArrayFire targeting CPUs."
            id="cpu_lib" visible="true" enabled="true">
        <pkg-ref id="com.arrayfire.arrayfire.cpu.lib"/>
    </choice>
    <choice title="CUDA Libraries"
            description="ArrayFire which targets the CUDA platform. This platform allows you to to take advantage of the CUDA enabled GPUs to run ArrayFire code."
            id="cuda_lib" visible="true" enabled="true">
        <pkg-ref id="com.arrayfire.arrayfire.cuda.lib"/>
    </choice>
    <choice title="OpenCL Libraries"
            description="ArrayFire which targets the OpenCL platform. This platform allows you to use the ArrayFire library which targets OpenCL devices. NOTE: Currently ArrayFire does not support OpenCL for the Intel CPU on Apple."
            id="opencl_lib" visible="true" enabled="true">
        <pkg-ref id="com.arrayfire.arrayfire.opencl.lib"/>
    </choice>
    <choice title="Unified Library"
            description="This library will allow you to choose the platform(cpu, cuda, opencl) at runtime. NOTE: This option requires the other platforms to work properly"
            id="com.arrayfire.arrayfire.unified.lib"
            selected="CheckBackendSelected()"
            visible="true"
            enabled="CheckBackendSelected()">
        <pkg-ref id="com.arrayfire.arrayfire.unified.lib"/>
    </choice>
    <choice title="ArrayFire Headers" description="ArrayFire Headers" id="com.arrayfire.arrayfire.inc" visible="true" enabled="true">
        <pkg-ref id="com.arrayfire.arrayfire.inc"/>
    </choice>
    <choice title="Extras" description="Extra files include documentation, examples, and cmake scripts to find and use ArrayFire with cmake," id="com.arrayfire.arrayfire.extra" visible="true" enabled="true">
        <pkg-ref id="com.arrayfire.arrayfire.extra"/>
    </choice>
</installer-gui-script>
