-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use namespaces for exported targets.
There is a major GOTCHA for exported targets. If an imported library is namespaced (eg `HSPlasma::HSPlasma`), CMake will ensure that the library exists when it is used in a call to `target_link_libraries()`. If an imported library is *not* namespaced (eg `HSPlasma`), then, if the target doesn't exist, CMake will simply pass that library name to the linker and hope for the best. This can lead to confusing errors where, when a non-namespaced imported target is used, configuration can "succeed" but HSPlasma is not actually found correctly. The error doesn't actually emerge until the downstream project attempts to link against the nonexistent HSPlasma. This change allows downstream users to link against `HSPlasma::HSPlasma` and get a free configure-time check that libHSPlasma has been properly found. An `ALIAS` has been added for the old exported target names to ensure backwards compatibility.
- Loading branch information
Showing
4 changed files
with
13 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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