diff --git a/cmake/modules/hunter_pack_git_submodule.cmake b/cmake/modules/hunter_pack_git_submodule.cmake index 58049fa4d0..5d095003f5 100644 --- a/cmake/modules/hunter_pack_git_submodule.cmake +++ b/cmake/modules/hunter_pack_git_submodule.cmake @@ -120,6 +120,9 @@ function(hunter_pack_git_submodule) endif() set(head_file "${output}") + if(NOT IS_ABSOLUTE "${head_file}") + set(head_file "${submodule_dir}/${head_file}") + endif() if(NOT EXISTS "${head_file}") hunter_internal_error("File not found: '${head_file}'") endif() @@ -163,6 +166,9 @@ function(hunter_pack_git_submodule) endif() set(ref_file "${output}") + if(NOT IS_ABSOLUTE "${ref_file}") + set(ref_file "${submodule_dir}/${ref_file}") + endif() if(NOT EXISTS "${ref_file}") hunter_internal_error("File not found: ${ref_file}") endif()