From bec58b86a42c72538f1805ff086d856173bffb3c Mon Sep 17 00:00:00 2001 From: Ilya Shipitsin Date: Tue, 7 Aug 2018 20:38:06 +0500 Subject: [PATCH] ignore temp cmake files check whether cloned recursively during cmake build --- .gitignore | 4 ++-- CMakeLists.txt | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 0d50e757..537478c0 100644 --- a/.gitignore +++ b/.gitignore @@ -7,5 +7,5 @@ cmake-build-debug/ src/bin/BuiltHamcoreFiles/ tmp/ .gitconfig - - +CMakeCache.txt +CMakeFiles/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 9eac7fd5..540aba12 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,4 +4,9 @@ project(SoftEtherVPN LANGUAGES C) set(default_build_type "Release") +# Check that submodules are present only if source was downloaded with git +if(EXISTS "${SoftEtherVPN_SOURCE_DIR}/.git" AND NOT EXISTS "${SoftEtherVPN_SOURCE_DIR}/src/Mayaqua/cpu_features/CMakeLists.txt") + message (FATAL_ERROR "Submodules are not initialized. Run\n\tgit submodule update --init --recursive") +endif() + add_subdirectory(src)