Skip to content

Non-standard install destination paths #80

@rwols

Description

@rwols

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions