CMake install should use the Tracy:: namespace#326
Merged
wolfpld merged 1 commit intowolfpld:masterfrom Feb 12, 2022
Merged
Conversation
…th that namespace
Collaborator
Author
|
Pinging @Honeybunch who seems to have done the install target changes for VCPKG |
Contributor
|
I actually just realized this when building a new project that uses Tracy from vcpkg. This change is good and I'll create a PR to update the vcpkg patch to 0.7.8 |
Owner
|
I see discrepancy between this PR ( |
Collaborator
Author
|
It has to be |
Contributor
Yeah that was my bad. I was moving a bit too fast trying to come up with that change but it's corrected now :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If we do not add the namespace to the install config, it means we can not use
Tracy::TracyClientas target name when usingfind_packagewhile we already have the alias (when usingadd_subdirectory).This would yield the following error:
This is also an issue the case where you install a library that builds tracy with
add_subdirectoryand links Tracy::TracyClient then installs itself.Note that this is a breaking change, as I suppose people were linking
TracyClientinstead ofTracy::TracyClient(which is dangerous because there is no guarantee it would link the version found by CMake without using an alias).The issue is that CMake will not show any error but not propagate the includes if it does not find the target when not using an alias (which is exactly what we're trying to avoid).
So in the short term it might be an issue, but in the long term I think this is better.