Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TriBITS-generated <tplName>::<libname> IMPORTED targets conflicting with those from related package config and find modules (#299) #548

Closed
bartlettroscoe opened this issue Dec 10, 2022 · 2 comments

Comments

@bartlettroscoe
Copy link
Member

bartlettroscoe commented Dec 10, 2022

Description

One side effect of the TriBITS refactoring that generates <tplName>Config.cmake files with modern IMPORTED targets of the name <tplName>::<libname> is that then can conflict with imported targets of the same name generated by other package config files and find modules. For example, imported targets like CUDA::cufft generated by the refactored FindTPLCUDA.cmake module conflict with IMPORTED targets of the same name generated by the newer FindCUDAToolkit.cmake file module (see trilinos/Trilinos#10954 (comment) which was addressed with PR #528.) Another example is the SEACAS TriBITS TPL find module FindTPLfmt.cmake which generates the IMPORTED target fmt::fmt which conflicts with the IMPORTED target fmt::fmt generated by the Findfmt.cmake find module (see trilinos/Trilinos#11284).

Discussion

Initially, my thoughts were that we should be upgrading the TriBITS TPL find modules FindTPL<tplName>.cmake to call find_package(<tplName>) (which is what was done in PR #528). Then it was suggested in trilinos/Trilinos/11284 to prefix all of the TriBITS-generated targets with TPL:: which is what was done in microsoft/vcpkg/27928. However, doing that for even the <tplName>::all_libs target breaks the proposed standard for CMake packages.

Proposed solution

The proposed solution is change the target names of just the intermediate targets like <tplName>::<libname> where we have seen conflicts as described by namespacing them with tribits:: to produce tribits::<tplName>::<libname>. Now, the INTERFACE target <tplName>::all_libs would not be renamed so it would not break any of the code that looks for that name or break the proposed standard. Note that this does not restrict the usage of the TriBITS-produced targets in any way because they were not usable on their own because they don't have the include directories needed to use them. The include directories are only added to the <tplName>:all_libs target.

@bartlettroscoe bartlettroscoe added this to In Progress in TriBITS Refactor Dec 10, 2022
bartlettroscoe added a commit to bartlettroscoe/TriBITS that referenced this issue Dec 12, 2022
…riBITSPub#299)

This is to avoid clashes such as reported in:

* TriBITSPub#548

like CUDA::cufft from FindCUDAToolkit.cmake and fmt::fmt from Findfmd.cmake.
bartlettroscoe added a commit that referenced this issue Dec 12, 2022
This is to avoid clashes such as reported in:

* #548

like CUDA::cufft from FindCUDAToolkit.cmake and fmt::fmt from Findfmd.cmake.
@bartlettroscoe bartlettroscoe moved this from In Progress to In Review in TriBITS Refactor Dec 12, 2022
@bartlettroscoe
Copy link
Member Author

With the merge of PR #549, this should be addressed from the TriBITS perspective. We just need to update the snapshot to Trilinos 'develop' and this will be resolved in Trilinos as well.

@bartlettroscoe
Copy link
Member Author

This has been done for a long time and no recent complaints. I will close this.

TriBITS Refactor automation moved this from In Review to Done Jun 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

1 participant