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

[vtk] use interface target instead of alias for lz4 #23352

Merged
merged 2 commits into from
Mar 3, 2022

Conversation

Neumann-A
Copy link
Contributor

No description provided.

@Cheney-W Cheney-W added category:port-bug The issue is with a library, which is something the port should already support info:reviewed Pull Request changes follow basic guidelines labels Mar 3, 2022
+if(NOT TARGET LZ4::LZ4)
+add_library(LZ4::LZ4 ALIAS lz4::lz4)
+ add_library(LZ4::LZ4 INTERFACE IMPORTED)
+ target_link_libraries(LZ4::LZ4 INTERFACE lz4::lz4)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMake 3.11 is needed to use target_link_libraries with imported targets. (https://cmake.org/cmake/help/v3.22/release/3.11.html?highlight=target_link_libraries#commands).
But IIUC this file may be installed and eventually be used in user project where vcpkg supports CMake 3.7.2.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current code also requires 3.11 due to an alias target targeting a GLOBAL IMPORTED target. Furthermore I think this doesn't matter at all since find_package(vtk) will most likely require a higher CMake any way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[VTK]: Using find_package(VTK....) in a outside project leads to CMake Error
4 participants