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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ports/vtk/FindLZ4.patch
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ index 8c94e3bcd..ade3f9451 100644
- endif ()
-endif ()
+find_package(LZ4 CONFIG REQUIRED)
+set_target_properties(lz4::lz4 PROPERTIES IMPORTED_GLOBAL TRUE)
+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.

+endif()
\ No newline at end of file
2 changes: 1 addition & 1 deletion ports/vtk/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vtk",
"version-semver": "9.0.3-pv5.9.1",
"port-version": 7,
"port-version": 8,
"description": "Software system for 3D computer graphics, image processing, and visualization",
"homepage": "https://github.com/Kitware/VTK",
"license": "BSD-3-Clause",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -7274,7 +7274,7 @@
},
"vtk": {
"baseline": "9.0.3-pv5.9.1",
"port-version": 7
"port-version": 8
},
"vtk-dicom": {
"baseline": "0.8.12",
Expand Down
5 changes: 5 additions & 0 deletions versions/v-/vtk.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "585d1bca8e71d950c6d12ceb6ad720825ecbd704",
"version-semver": "9.0.3-pv5.9.1",
"port-version": 8
},
{
"git-tree": "4ba3d3d0db6e98e9a47d8c5c86790da3ef9af25b",
"version-semver": "9.0.3-pv5.9.1",
Expand Down