From e9efd8ecabc54144cec458d747245de0566ca12e Mon Sep 17 00:00:00 2001 From: nscipione Date: Thu, 29 Feb 2024 14:27:31 +0100 Subject: [PATCH] [cmake] Add check and failure if missing submodule Users may skip recursive clone of this repository. Missing this step causes hard to understand compile time errors. To avoid this situation, this patch adds a check to the submodule initialization. In case it is missing, the configuration is stopped and the solution is provided to the user. Signed-off-by: nscipione --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e0d418c57..7c14f5c7a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,6 +73,10 @@ if (NOT INSTALL_HEADER_ONLY) include(ConfigurePORTBLAS) include(SYCL) find_package(PythonInterp 3 REQUIRED) + if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/external/py_gen/README.md" ) + message(FATAL_ERROR "Repository not cloned recursively, missing submodule.\n" + "To continue please clone submodule using `git submodule update --init`") + endif() endif() if (MSVC)