• Brad King's avatar
    install: Allow absolute EXPORT destination with relative targets (#15258) · dd089e08
    Brad King authored
    When install(EXPORT) is given an absolute destination we cannot compute
    the install prefix relative to the installed export file location.
    Previously we disallowed installation of targets in such exports with a
    relative destination, but did not enforce this for target property
    values besides the location of the main target file.  This could lead to
    broken installations when the EXPORT is installed to an absolute path
    but usage requirements are specified relative to the install prefix.
    
    Since an EXPORT installed to an absolute destination cannot be relocated
    we can just hard-code the value of CMAKE_INSTALL_PREFIX as the base for
    relative paths.  This will allow absolute install(EXPORT) destinations
    to work with relative destinations for targets and usage requirements.
    
    Extend the ExportImport test with a case covering this behavior.
    dd089e08
cmExportInstallFileGenerator.cxx 18.3 KB