Skip to content

Commit

Permalink
Merge pull request nasa#1158 from jphickey/fix-790-install-symlink
Browse files Browse the repository at this point in the history
Fix nasa#790, allow directories and symlinks in FILELIST.
  • Loading branch information
astrogeco authored Feb 24, 2021
2 parents 414036e + 51a614c commit 9fd5d76
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmake/arch_build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -474,14 +474,19 @@ function(process_arch SYSVAR)
add_subdirectory(cmake/target ${TGTNAME})

foreach(INSTFILE ${${TGTNAME}_FILELIST})
if(EXISTS ${MISSION_DEFS}/${TGTNAME}_${INSTFILE})
if(EXISTS ${MISSION_DEFS}/${TGTNAME}/${INSTFILE})
set(FILESRC ${MISSION_DEFS}/${TGTNAME}/${INSTFILE})
elseif(EXISTS ${MISSION_DEFS}/${TGTNAME}_${INSTFILE})
set(FILESRC ${MISSION_DEFS}/${TGTNAME}_${INSTFILE})
elseif(EXISTS ${MISSION_DEFS}/${INSTFILE})
set(FILESRC ${MISSION_DEFS}/${INSTFILE})
else()
set(FILESRC)
endif()
if (FILESRC)
# In case the file is a symlink, follow it to get to the actual file
get_filename_component(FILESRC "${FILESRC}" REALPATH)
message("NOTE: Selected ${FILESRC} as source for ${INSTFILE} on ${TGTNAME}")
install(FILES ${FILESRC} DESTINATION ${TGTNAME}/${INSTALL_SUBDIR} RENAME ${INSTFILE})
else(FILESRC)
message("WARNING: Install file ${INSTFILE} for ${TGTNAME} not found")
Expand Down

0 comments on commit 9fd5d76

Please sign in to comment.