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

cmake: Detect if libshvvisu exists #46

Merged
merged 1 commit into from
Mar 8, 2024
Merged

Conversation

syyyr
Copy link
Collaborator

@syyyr syyyr commented Mar 8, 2024

libshv won't build Qt-based libs, if the Qt dependencies aren't met. shvspy has different Qt dependencies, so they could be met even if libshv's aren't. This could mean that the libshv::libshvvisu target doesn't get created. CMake correctly recognizes this as an error when trying to link this target, but unfortunately creates a non-working Makefile anyway. Users who ignore the errors and try to use this Makefile might get confused as to why shvpsy doesn't build.

The solution is to explicitly check for the libshv::libshvvisu target, and erroring out if it doesn't exist. No Makefile is generated this way.

The other solution would be to add a flag to libshv that would force libshv to make the Qt-based libs and produce an error, if it can't. However, this change would really only be useful for projects that consume libshv as a submodule, which is very common, but still not the "right" usage. I'd rather not put extra code into libshv for that.

libshv won't build Qt-based libs, if the Qt dependencies aren't met. shvspy has
different Qt dependencies, so they could be met even if libshv's aren't. This
could mean that the `libshv::libshvvisu` target doesn't get created. CMake
correctly recognizes this as an error when trying to link this target, but
unfortunately creates a non-working Makefile anyway. Users who ignore the errors
and try to use this Makefile might get confused as to why shvpsy doesn't build.

The solution is to explicitly check for the `libshv::libshvvisu` target, and
erroring out if it doesn't exist. No Makefile is generated this way.

The other solution would be to add a flag to libshv that would force libshv to
make the Qt-based libs and produce an error, if it can't. However, this change
would really only be useful for projects that consume libshv as a submodule,
which is very common, but still not the "right" usage. I'd rather not put extra
code into libshv for that.
@syyyr
Copy link
Collaborator Author

syyyr commented Mar 8, 2024

Related: #46

@fvacek fvacek merged commit 0b86595 into master Mar 8, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants