From 28e68dfe1665f296b2be95eb6ffe6f6a79102fa8 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Tue, 8 May 2018 00:18:37 +0100 Subject: [PATCH] Make error message more informative when github tarball is downloaded, which doesn't include csocket. See #1521 --- CMakeLists.txt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d69d1f1e..fb3d67aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -242,8 +242,20 @@ endif() file(GLOB csocket_files LIST_DIRECTORIES FALSE "${PROJECT_SOURCE_DIR}/third_party/Csocket/Csocket.*") if(csocket_files STREQUAL "") - message(FATAL_ERROR " It looks like git submodules are not initialized.\n" - " Run: git submodule update --init --recursive") + execute_process(COMMAND git status + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + RESULT_VARIABLE git_status_var + OUTPUT_QUIET + ERROR_QUIET) + if(git_status_var) + message(FATAL_ERROR + " It looks like git submodules are not initialized.\n" + " Either this is not a git clone, or you don't have git installed") + else() + message(FATAL_ERROR + " It looks like git submodules are not initialized.\n" + " Run: git submodule update --init --recursive") + endif() endif() install(DIRECTORY webskins