diff --git a/dependencies/CMakeLists.txt b/dependencies/CMakeLists.txt index 85411db9..5e0ab489 100644 --- a/dependencies/CMakeLists.txt +++ b/dependencies/CMakeLists.txt @@ -4,8 +4,8 @@ function(initialize_submodule DIRECTORY) if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${DIRECTORY}/.git) find_package(Git QUIET REQUIRED) message(STATUS "${CMAKE_CURRENT_SOURCE_DIR}/${DIRECTORY}/.git does not exist. Initializing ${DIRECTORY} submodule ...") - execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init ${DIRECTORY} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init ${CMAKE_CURRENT_SOURCE_DIR}/${DIRECTORY} + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} RESULT_VARIABLE GIT_EXIT_CODE) if(NOT GIT_EXIT_CODE EQUAL "0") message(FATAL_ERROR "${GIT_EXECUTABLE} submodule update --init dependencies/${DIRECTORY} failed with exit code ${GIT_EXIT_CODE}, please checkout submodules") @@ -67,4 +67,4 @@ if (SIMDJSON_COMPETITION) add_library(competition-all INTERFACE) target_link_libraries(competition-all INTERFACE competition-core competition-jsoncppdist competition-json11 competition-fastjson competition-gason competition-ujson4c) -endif() \ No newline at end of file +endif()