From db084ba714caa524cbeb959748bf0a1b923b9cc4 Mon Sep 17 00:00:00 2001
From: Justin Carpentier <justin.carpentier@inria.fr>
Date: Thu, 5 Dec 2019 15:22:22 +0100
Subject: [PATCH] cmake: add check of cmake submodule loading

---
 CMakeLists.txt | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7bdb9b49..92bc01b5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
 #
 # Software License Agreement (BSD License)
 #
-#  Copyright (c) 2014 CNRS-LAAS
+#  Copyright (c) 2014-2019 CNRS-LAAS, INRIA
 #  Author: Florent Lamiraux, Joseph Mirabel
 #  All rights reserved.
 #
@@ -45,6 +45,11 @@ SET(PROJECT_USE_CMAKE_EXPORT TRUE)
 CMAKE_POLICY(SET CMP0022 NEW)
 SET(PROJECT_USE_KEYWORD_LINK_LIBRARIES TRUE)
 
+# Check if the submodule cmake have been initialized
+IF(NOT EXISTS "${CMAKE_SOURCE_DIR}/cmake/base.cmake")
+  MESSAGE(FATAL_ERROR "\nPlease run the following command first:\ngit submodule update --init\n")
+ENDIF()
+
 include(cmake/eigen.cmake)
 include(cmake/boost.cmake)
 include(cmake/python.cmake)
-- 
GitLab