Skip to content

Commit

Permalink
Merge pull request #2494 from skliper:fix2493-cfe_locate_relative
Browse files Browse the repository at this point in the history
Fix #2493, Relative prefix exclusion for cfe implementation file search
  • Loading branch information
dzbaker committed Jan 18, 2024
2 parents d830022 + b6da3fc commit 99facb4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmake/global_functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,13 @@ function(cfe_locate_implementation_file OUTPUT_VAR FILE_NAME)
foreach(BASEDIR ${IMPL_SEARCH_BASEDIRS})
list(APPEND IMPL_SEARCH_PATH "${BASEDIR}${FILE_NAME}")

# Get relative directory
string(REPLACE ${MISSION_SOURCE_DIR} "" RELATIVEDIR ${BASEDIR})

# A target-specific prefixed filename gets priority over a direct filename match
# But do not include this variant if the prefix is already part of the basedir
# But do not include this variant if the prefix is already part of the relative search path
foreach (PREFIX ${LOCATEIMPL_ARG_PREFIX})
if (NOT "${BASEDIR}" MATCHES "/${PREFIX}/")
if (NOT "${RELATIVEDIR}" MATCHES "/${PREFIX}/")
list(APPEND IMPL_SEARCH_PATH "${BASEDIR}${PREFIX}_${FILE_NAME}")
endif()
endforeach()
Expand Down

0 comments on commit 99facb4

Please sign in to comment.