diff --git a/cmake/arch_build.cmake b/cmake/arch_build.cmake index e569f500b..d42ea9958 100644 --- a/cmake/arch_build.cmake +++ b/cmake/arch_build.cmake @@ -474,7 +474,9 @@ 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}) @@ -482,6 +484,9 @@ function(process_arch SYSVAR) 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")