TriBITSPub / TriBITS

TriBITS: Tribal Build, Integrate, and Test System,
http://tribits.org
Other
36 stars 46 forks source link

Address relocatable package installs and usage of <Package>Config.cmake files #563

Open bartlettroscoe opened 1 year ago

bartlettroscoe commented 1 year ago

Parent Issue:

Description

As mentioned in https://github.com/TriBITSPub/TriBITS/issues/63#issuecomment-1420845228 and discussed in more detail in CMake Issue #24378 there is a problem with building, packaging, and installing from a binary package, and then downstream CMake projects using the installed CMake packages using find_package(<Package>). The problem is that the <Package>Config.cmake files will not easily know where to find their upstream dependencies.

Proposed implementation

The proposed solution to this problem discussed in CMake Issue #24378 comment is outlined below:

The above proposed implementation would solve the Spack binary install use case by setting <Project>_SUPER_INSTALL_PREFIX to the base Spack package install dir and then all paths would be relative to that directory as well.

NOTE: We would have to also make all library paths relative as well according to the above process (i.e. based on the values of <ExternalPackage>_USE_RELATIVE_PATH and <Project>_SUPER_INSTALL_PREFIX).