From c83eea60df55b4a71f8718040ee09655b66a1db2 Mon Sep 17 00:00:00 2001 From: Roman Tsisyk <roman@tsisyk.com> Date: Sun, 7 Feb 2016 20:02:50 +0300 Subject: [PATCH] CMake: automatically update submodules --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cd31a18d50..990588dbbf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -140,7 +140,7 @@ endif() # avoids git to search .git repository in parent # directories. # -if (EXISTS "${CMAKE_SOURCE_DIR}/.git") +if (EXISTS "${CMAKE_SOURCE_DIR}/.git" AND GIT) execute_process (COMMAND ${GIT} describe --long HEAD OUTPUT_VARIABLE TARANTOOL_GIT_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE @@ -148,8 +148,11 @@ if (EXISTS "${CMAKE_SOURCE_DIR}/.git") if (NOT ("${TARANTOOL_GIT_VERSION}" STREQUAL "${TARANTOOL_VERSION}")) set(TARANTOOL_VERSION "${TARANTOOL_GIT_VERSION}") - file(WRITE ${VERSION_FILE} "${TARANTOOL_VERSION}\n") message(STATUS "Generating VERSION file") + file(WRITE ${VERSION_FILE} "${TARANTOOL_VERSION}\n") + + message(STATUS "Updating submodules") + execute_process(COMMAND ${GIT} submodule update --init --recursive) endif() endif() -- GitLab