     @emitClearMessages ['error', 'warning', 'build']
     # ↑ This will be useful in case there are tabs like 'tests' etc.
     @cabalBuild 'build',
+      target: target
       setCancelAction: setCancelAction
       onMsg: (messages) =>
         @emitMessages messages

    #editor    = atom.workspace.activePaneItem
    #editorCwd = path.dirname(editor.getPath())
    #cabalRoot = findCabalRoot editorCwd

    [cabalRoot, cabalFile] = @findCabalFile atom.project.getPaths()[0]
    buildDir = @getConfigOpt 'buildDir'

    if cabalFile?
      @parseCabalFile (path.join cabalRoot, cabalFile), (cabalParsed) =>
        console.log "cabalParsed", JSON.stringify(cabalParsed)
        cabalArgs =
          switch cmd
            when 'build', 'test'
              [cmd, '--only', '--builddir=' + buildDir]
            else
              [cmd, '--builddir=' + buildDir]
        cabalProcess = new CabalProcess 'cabal', cabalArgs, @spawnOpts(cabalRoot), callbacks
    else
      @emitMessages [
        message: "No cabal file found"

      when '7.10' then atom.config.get 'ide-haskell-cabal.' + opt + '710'
    return value.trim()

  cabalBuild: (cmd, opts) =>
    # TODO: It shouldn't be possible to call this function until cabalProcess
    # exits. Otherwise, problems will ensue.
    # TODO: Might want to check _either_ the project path _or_ starting from
