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.