Maintenance: Issue submodule update once

Avoid calling submodule update on specific subfolders. 
Fixes by cmake-format
This commit is contained in:
Magne Sjaastad 2023-01-13 16:01:57 +01:00
parent 796160960d
commit 7642c06935

View File

@ -273,13 +273,6 @@ endif(RESINSIGHT_ERT_EXTERNAL_LIB_ROOT OR RESINSIGHT_ERT_EXTERNAL_INCLUDE_ROOT)
# restore buildcache when libecl has been configured # restore buildcache when libecl has been configured
set(CMAKE_CXX_COMPILER_LAUNCHER ${TEMP_CMAKE_CXX_COMPILER_LAUNCHER}) set(CMAKE_CXX_COMPILER_LAUNCHER ${TEMP_CMAKE_CXX_COMPILER_LAUNCHER})
# ##############################################################################
# ##############################################################################
# Go through required git submodules #
# ##############################################################################
list(APPEND THIRD_PARTY_SUBMODULES fast_float qwt qtadvanceddocking)
# ############################################################################## # ##############################################################################
# Init GIT submodules if they haven't already # # Init GIT submodules if they haven't already #
# ############################################################################## # ##############################################################################
@ -288,22 +281,19 @@ if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
# Update submodules as needed # Update submodules as needed
option(GIT_SUBMODULE "Check submodules during build" ON) option(GIT_SUBMODULE "Check submodules during build" ON)
if(GIT_SUBMODULE) if(GIT_SUBMODULE)
foreach(SUBMODULE ${THIRD_PARTY_SUBMODULES}) set(SUBDIR "${PROJECT_SOURCE_DIR}/ThirdParty")
set(SUBDIR "${PROJECT_SOURCE_DIR}/ThirdParty/${SUBMODULE}") message(STATUS "Initializing GIT submodules")
message(STATUS "Initializing GIT submodules") execute_process(
execute_process( COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive -- ${SUBDIR}
COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive -- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
${SUBDIR} RESULT_VARIABLE GIT_SUBMOD_RESULT
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
RESULT_VARIABLE GIT_SUBMOD_RESULT if(NOT GIT_SUBMOD_RESULT EQUAL "0")
message(
FATAL_ERROR
"git submodule update --init failed with ${GIT_SUBMOD_RESULT}, please checkout submodules"
) )
if(NOT GIT_SUBMOD_RESULT EQUAL "0") endif()
message(
FATAL_ERROR
"git submodule update --init failed for ${SUBMODULE} with ${GIT_SUBMOD_RESULT}, please checkout submodules"
)
endif()
endforeach()
endif() endif()
endif() endif()