{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "run-tests",
            "type": "shell",
            "command": "ctest",
            "options": {
                "cwd": "${workspaceFolder}/build/tests",
                "env": {
                    "HOME": "/tmp"
                }
            },
            "args": [
                "-V",
                "-R"
            ],
            "group": {
                "kind": "test",
                "isDefault": true
            },
            "problemMatcher": [],
            "detail": "Run the tests using CTest."
        },
        {
            "label": "cmake-configure",
            "type": "shell",
            "command": "cmake",
            "args": [
                "-S", ".",
                "-B", "build",
                "-DCMAKE_BUILD_TYPE=Debug",
                "-DCMAKE_PREFIX_PATH=\"/usr/lib64/qt-jami;/usr/lib/libqt-jami\"",
            ],
            "group": "build",
            "problemMatcher": [],
            "detail": "Generate the build system files with CMake."
        },
        {
            "label": "cmake-configure-tests",
            "type": "shell",
            "command": "cmake",
            "args": [
                "-S", ".",
                "-B", "build",
                "-DBUILD_TESTING=${input:buildTestingInput}"
            ],
            "group": "build",
            "problemMatcher": [],
            "detail": "Generate the build system files with CMake."
        },
        {
            "label": "cmake-build",
            "type": "shell",
            "command": "cmake",
            "args": [
                "--build", "build",
                "-j$(nproc)",
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": [
                "$gcc"
            ],
            "detail": "Compile the project using the generated build system.",
            "dependsOn": [
                "cmake-configure"
            ]
        },
        {
            "label": "cmake-clean",
            "type": "shell",
            "command": "rm",
            "args": [
                "-rf",
                "build"
            ],
            "group": "build",
            "problemMatcher": [],
            "detail": "Clean the build directory."
        }
    ],
    "inputs": [
        {
            "id": "buildTestingInput",
            "type": "pickString",
            "description": "Do you want to enable testing?",
            "options": ["True", "False"],
        }
    ]
}