Quirks in message(SEND_ERROR)

I have a Cmake function that looks like this (simplified for illustration):

function(check_file_exists file url)
    find_file(found ${file})
    if(NOT found)
        message(SEND_ERROR "File not found: ${file}\nDownload it from: ${url}")
    endif()
endfunction()

It works but has a couple of annoying behaviours:
(1) Why does Cmake write two linefeeds for every \n in the message?
(2) Is there any way to suppress the stack trace that gets printed after the message? It’s not a Cmake error so the stack trace is just useless noise.

I think you also want NO_CACHE there (otherwise each subsequent call will reuse the found cache variable and not actually search for anything).

No, there’s no way to suppress the stack trace (because CMake doesn’t know that this is an “informational” error and knowing “where it came from” is very helpful in general.