mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-21 04:33:10 +08:00
CMake: Fix submodule init
This commit is contained in:
@@ -138,13 +138,15 @@ function(px4_add_git_submodule)
|
||||
string(REPLACE "/" "_" NAME ${PATH})
|
||||
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/git_init_${NAME}.stamp
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
COMMAND git submodule init ${PATH}
|
||||
COMMAND git submodule update --init --recursive ${PATH}
|
||||
COMMAND touch ${CMAKE_BINARY_DIR}/git_init_${NAME}.stamp
|
||||
DEPENDS ${CMAKE_SOURCE_DIR}/.gitmodules
|
||||
)
|
||||
add_custom_target(${TARGET}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
COMMAND git submodule update --recursive ${PATH}
|
||||
# This is NOT a good approach as it overwrites checked out branches
|
||||
# behind the back of a developer
|
||||
#COMMAND git submodule update --recursive ${PATH}
|
||||
DEPENDS ${CMAKE_BINARY_DIR}/git_init_${NAME}.stamp
|
||||
)
|
||||
endfunction()
|
||||
|
||||
Reference in New Issue
Block a user