# Automatically initialize and update Git submodules if(EXISTS "${CMAKE_SOURCE_DIR}/.git") message(STATUS "Updating Git submodules...") execute_process( COMMAND git submodule update --init --recursive WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} RESULT_VARIABLE GIT_SUBMOD_RESULT ) if(NOT GIT_SUBMOD_RESULT EQUAL 0) message(FATAL_ERROR "Failed to update Git submodules") endif() endif()