From aaf3a9bf0bd868c192cc0bf1a28cf0264fb32cc3 Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Wed, 4 Mar 2020 21:26:51 +0100 Subject: [PATCH 1/2] Fix File not found .git/HEAD error --- cmake/modules/hunter_pack_git_submodule.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/modules/hunter_pack_git_submodule.cmake b/cmake/modules/hunter_pack_git_submodule.cmake index 58049fa4d0..dbf2ec0caf 100644 --- a/cmake/modules/hunter_pack_git_submodule.cmake +++ b/cmake/modules/hunter_pack_git_submodule.cmake @@ -120,7 +120,7 @@ function(hunter_pack_git_submodule) endif() set(head_file "${output}") - if(NOT EXISTS "${head_file}") + if(NOT EXISTS "${submodule_dir}/${head_file}") hunter_internal_error("File not found: '${head_file}'") endif() set_property( @@ -163,7 +163,7 @@ function(hunter_pack_git_submodule) endif() set(ref_file "${output}") - if(NOT EXISTS "${ref_file}") + if(NOT EXISTS "${submodule_dir}/${ref_file}") hunter_internal_error("File not found: ${ref_file}") endif() From ff4964d3d1426e52c6dc4ddc68811e5fd8c2c20c Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Sun, 22 Mar 2020 15:25:53 +0100 Subject: [PATCH 2/2] Verify if git path output is absolute --- cmake/modules/hunter_pack_git_submodule.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmake/modules/hunter_pack_git_submodule.cmake b/cmake/modules/hunter_pack_git_submodule.cmake index dbf2ec0caf..5d095003f5 100644 --- a/cmake/modules/hunter_pack_git_submodule.cmake +++ b/cmake/modules/hunter_pack_git_submodule.cmake @@ -120,7 +120,10 @@ function(hunter_pack_git_submodule) endif() set(head_file "${output}") - if(NOT EXISTS "${submodule_dir}/${head_file}") + 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() set_property( @@ -163,7 +166,10 @@ function(hunter_pack_git_submodule) endif() set(ref_file "${output}") - if(NOT EXISTS "${submodule_dir}/${ref_file}") + 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()