mirror of
https://github.com/KingDuckZ/dindexer.git
synced 2025-02-16 11:35:49 +00:00
Fix detection of strings starting by ../
This commit is contained in:
parent
a5d9d6b716
commit
aeb8dee561
1 changed files with 3 additions and 4 deletions
|
@ -58,9 +58,8 @@ function (add_shared_git_project SUBMODULE_PATH)
|
||||||
#Check if submodule is a subdirectory of the current source dir
|
#Check if submodule is a subdirectory of the current source dir
|
||||||
file(RELATIVE_PATH reported_submodule_rel_path "${CMAKE_CURRENT_SOURCE_DIR}" "${reported_submodule_dir}")
|
file(RELATIVE_PATH reported_submodule_rel_path "${CMAKE_CURRENT_SOURCE_DIR}" "${reported_submodule_dir}")
|
||||||
string(LENGTH "${reported_submodule_rel_path}" rel_path_len)
|
string(LENGTH "${reported_submodule_rel_path}" rel_path_len)
|
||||||
message(STATUS "\"${reported_submodule_rel_path}\" - ${rel_path_len}")
|
|
||||||
if (${rel_path_len} GREATER 2)
|
if (${rel_path_len} GREATER 2)
|
||||||
string(SUBSTRING reported_submodule_rel_path 0 3 first_bit)
|
string(SUBSTRING "${reported_submodule_rel_path}" 0 3 first_bit)
|
||||||
if ("../" STREQUAL "${first_bit}")
|
if ("../" STREQUAL "${first_bit}")
|
||||||
set(is_out_of_dirtree ON)
|
set(is_out_of_dirtree ON)
|
||||||
else()
|
else()
|
||||||
|
@ -77,10 +76,10 @@ function (add_shared_git_project SUBMODULE_PATH)
|
||||||
|
|
||||||
set(shared_project_binary "${CMAKE_CURRENT_BINARY_DIR}/shared_projects/${proj_name_orig}")
|
set(shared_project_binary "${CMAKE_CURRENT_BINARY_DIR}/shared_projects/${proj_name_orig}")
|
||||||
if (is_out_of_dirtree)
|
if (is_out_of_dirtree)
|
||||||
#message("Would call add_subdirectory(\"${reported_submodule_dir}\" \"${shared_project_binary}\")")
|
#message(FATAL_ERROR "Would call add_subdirectory(\"${reported_submodule_dir}\" \"${shared_project_binary}\")")
|
||||||
add_subdirectory("${reported_submodule_dir}" "${shared_project_binary}")
|
add_subdirectory("${reported_submodule_dir}" "${shared_project_binary}")
|
||||||
else()
|
else()
|
||||||
#message("Would call add_subdirectory(\"${reported_submodule_rel_path}\")")
|
#message(FATAL_ERROR "Would call add_subdirectory(\"${reported_submodule_rel_path}\")")
|
||||||
add_subdirectory("${reported_submodule_rel_path}")
|
add_subdirectory("${reported_submodule_rel_path}")
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
Loading…
Add table
Reference in a new issue