From 966c39802ee65ac0732d23c92535fbaaddd8a58e Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 28 Jan 2024 14:04:29 +0100 Subject: [PATCH] CMake: Throw a more descriptive error when submodule files do not exist Instead of having a long list of files that cannot be found, create an error message that mentions that the git submodule should be checked out. --- build/cmake/functions.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake index d85541509e..50da094963 100644 --- a/build/cmake/functions.cmake +++ b/build/cmake/functions.cmake @@ -593,6 +593,12 @@ endfunction() function(wx_add_builtin_library name) wx_list_add_prefix(src_list "${wxSOURCE_DIR}/" ${ARGN}) + list(GET src_list 0 src_file) + if(NOT EXISTS "${src_file}") + message(FATAL_ERROR "${name} file does not exist: \"${src_file}\".\ + Make sure you checkout the git submodules.") + endif() + if(${name} MATCHES "wx.*") string(SUBSTRING ${name} 2 -1 name_short) else()