Lines like this:
|
sbom_file(FILENAME ${CMAKE_INSTALL_LIBDIR}/$<TARGET_FILE_NAME:${SBOM_TARGET_TARGET}> |
assume that the static library is installed into ${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/$<TARGET_FILE_NAME:${SBOM_TARGET_TARGET}>, but that may not necessarily be the case.
I tried looking into how to account for that, perhaps getting an INSTALL_DESTINATION property from the target, but it seems there is no such target property!
We could solve this by overriding the install() command and recording all install destinations. Not sure how that would look like exactly.
function(install)
# ...
# record ALL the install destinations of ALL files...
# ...
# invoke the original install() command
_install(${ARGN})
endfunction()
This seems like a hard problem! I don't know how reliable it is to override built-in functions like this.
Lines like this:
cmake-sbom/cmake/sbom.cmake
Line 732 in 6bc34fd
assume that the static library is installed into
${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/$<TARGET_FILE_NAME:${SBOM_TARGET_TARGET}>, but that may not necessarily be the case.I tried looking into how to account for that, perhaps getting an INSTALL_DESTINATION property from the target, but it seems there is no such target property!
We could solve this by overriding the
install()command and recording all install destinations. Not sure how that would look like exactly.This seems like a hard problem! I don't know how reliable it is to override built-in functions like this.