Fix integration with Qt Creator

+ CMake build flag `QTK_UPDATE_SUBMODULES` to include Assimp as a git submodule
This commit is contained in:
2022-08-21 15:37:42 -04:00
parent 86b3f78368
commit ad4d4636a4
16 changed files with 173 additions and 88 deletions

View File

@@ -10,7 +10,7 @@ find_package(Git)
# _PATH: Path to git submodule location that we want to update
# + submodule_update(extern/assimp)
function(submodule_update _PATH)
if (NOT UPDATE_SUBMODULES)
if (NOT QTK_UPDATE_SUBMODULES)
return()
endif()
@@ -19,12 +19,14 @@ function(submodule_update _PATH)
endif()
execute_process(
COMMAND ${GIT_EXECUTABLE} submodule update --init "${_PATH}"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE result
COMMAND ${GIT_EXECUTABLE} submodule update --init --force "${_PATH}"
RESULT_VARIABLE result
)
if (NOT result EQUAL 0)
message(FATAL_ERROR "[Qtk] Error: Unable to update git submodule at ${_PATH}")
message(
FATAL_ERROR
"[Qtk] Error: Unable to update git submodule at ${_PATH}"
)
endif()
endfunction()