Skip to content

Commit 64ee9ba

Browse files
committed
More tweaks
1 parent bac747f commit 64ee9ba

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

cmake/yup_modules.cmake

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -720,14 +720,16 @@ function (yup_add_module module_path modules_definitions module_group)
720720
endif()
721721

722722
foreach (searchpath IN LISTS module_searchpaths)
723-
if (EXISTS "${searchpath}")
724-
list (APPEND module_include_paths "${searchpath}")
725-
elseif (EXISTS "${module_path}/${searchpath}")
726-
list (APPEND module_include_paths "${module_path}/${searchpath}")
727-
elseif (module_upstream_path AND EXISTS "${module_upstream_path}/${searchpath}")
723+
if (module_upstream_path AND EXISTS "${module_upstream_path}/${searchpath}")
728724
list (APPEND module_include_paths "${module_upstream_path}/${searchpath}")
729725
elseif (module_upstream OR module_repository)
730-
list (APPEND module_include_paths "${CMAKE_BINARY_DIR}/externals/${module_name}/${searchpath}")
726+
if (EXISTS "${CMAKE_BINARY_DIR}/externals/${module_name}/${searchpath}")
727+
list (APPEND module_include_paths "${CMAKE_BINARY_DIR}/externals/${module_name}/${searchpath}")
728+
endif()
729+
elseif (EXISTS "${module_path}/${searchpath}")
730+
list (APPEND module_include_paths "${module_path}/${searchpath}")
731+
elseif (EXISTS "${searchpath}")
732+
list (APPEND module_include_paths "${searchpath}")
731733
endif()
732734
endforeach()
733735

cmake/yup_utilities.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,10 @@ endfunction()
208208
function (_yup_collect_upstream_candidate_paths module_name module_path output_variable)
209209
set (candidate_paths
210210
"${module_path}/upstream"
211-
"${CMAKE_SOURCE_DIR}/build/externals/${module_name}"
212-
"${CMAKE_SOURCE_DIR}/../build/externals/${module_name}")
211+
"${CMAKE_SOURCE_DIR}/build/externals/${module_name}")
212+
213+
get_filename_component (parent_candidate_path "${CMAKE_SOURCE_DIR}/../build/externals/${module_name}" REALPATH)
214+
list (APPEND candidate_paths "${parent_candidate_path}")
213215

214216
set (candidate_root "${CMAKE_BINARY_DIR}")
215217
set (max_depth 10)

0 commit comments

Comments
 (0)