```cmake

FIND_PROGRAM(CABAL_EXECUTABLE cabal)

IF (CABAL_EXECUTABLE)
    EXECUTE_PROCESS(
        COMMAND cabal list
        OUTPUT_QUIET
        ERROR_VARIABLE out
    )

    IF(out MATCHES "(.)*'hackage.haskell.org' does not exist(.)*")
        MESSAGE(STATUS "Updating cabal package list...")
        EXECUTE_PROCESS(
            COMMAND cabal update
        )
    ENDIF(out MATCHES "(.)*'hackage.haskell.org' does not exist(.)*")

    SET(CABAL_FOUND TRUE)
ELSE (DEFINED CABAL_EXECUTABLE)
	SET(CABAL_FOUND FALSE)
ENDIF (DEFINED CABAL_EXECUTABLE)

```

Make cabal settings a lot faster
user
```cmake

FIND_PROGRAM(CABAL_EXECUTABLE cabal)

IF (CABAL_EXECUTABLE)
    EXECUTE_PROCESS(
        COMMAND cabal list nothing
        OUTPUT_QUIET
        ERROR_VARIABLE out
    )

    IF(out MATCHES "(.)*'hackage.haskell.org' does not exist(.)*")
        MESSAGE(STATUS "Updating cabal package list...")
        EXECUTE_PROCESS(
            COMMAND cabal update
        )
    ENDIF(out MATCHES "(.)*'hackage.haskell.org' does not exist(.)*")

    SET(CABAL_FOUND TRUE)
ELSE (DEFINED CABAL_EXECUTABLE)
	SET(CABAL_FOUND FALSE)
ENDIF (DEFINED CABAL_EXECUTABLE)

```
assistant