With the default configuration (tmech fetched, NUMSIM_USE_SYSTEM_TMECH=OFF), cmake --install followed by a consumer doing
find_package(numsim-materials REQUIRED)
target_link_libraries(app PRIVATE numsim-materials::numsim-materials)
configures successfully and then fails to compile:
error: 'mandel' is not a member of 'tmech'
CMakeLists.txt:128-134 adds the fetched tmech include directory to the interface without linking the target, to keep it out of the export set. That directory is a build-tree path, so the installed package either points at nothing or picks up an older system tmech.
Fix (either)
- install the fetched tmech headers alongside ours and add the installed path to the interface via
$<INSTALL_INTERFACE:...>, or
- require an installed tmech for an installable build and export the dependency, with a version check once tmech's config provides one.
Test
A CI job that installs to a scratch prefix and builds a one-file consumer against it.
All references are to main at 91bd26f.
With the default configuration (tmech fetched,
NUMSIM_USE_SYSTEM_TMECH=OFF),cmake --installfollowed by a consumer doingconfigures successfully and then fails to compile:
CMakeLists.txt:128-134adds the fetched tmech include directory to the interface without linking the target, to keep it out of the export set. That directory is a build-tree path, so the installed package either points at nothing or picks up an older system tmech.Fix (either)
$<INSTALL_INTERFACE:...>, orTest
A CI job that installs to a scratch prefix and builds a one-file consumer against it.
All references are to
mainat 91bd26f.