Skip to content

[libgeotiff] Fix usage#25636

Closed
JackBoosY wants to merge 13 commits intomicrosoft:masterfrom
JackBoosY:dev/jack/fix-liblas-libgeotiff-usage
Closed

[libgeotiff] Fix usage#25636
JackBoosY wants to merge 13 commits intomicrosoft:masterfrom
JackBoosY:dev/jack/fix-liblas-libgeotiff-usage

Conversation

@JackBoosY
Copy link
Contributor

@JackBoosY JackBoosY commented Jul 8, 2022

Related: #24740

@JackBoosY JackBoosY added category:port-bug The issue is with a library, which is something the port should already support info:internal labels Jul 8, 2022
@JackBoosY
Copy link
Contributor Author

cc @dg0yt

# @PROJECT_NAME_UPPER@_LIBRARIES

+cmake_policy(PUSH)
+cmake_policy(SET CMP0012 NEW)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

CMake Warning (dev) at F:/vcpkg/installed/x64-windows/share/GeoTIFF/geotiff-config.cmake:26 (if):
  if given arguments:

    "ON"

  An argument named "ON" appears in a conditional statement.  Policy CMP0012
  is not set: if() recognizes numbers and boolean constants.  Run "cmake
  --help-policy CMP0012" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.
Call Stack (most recent call first):
  F:/vcpkg/scripts/buildsystems/vcpkg.cmake:824 (_find_package)
  CMakeLists.txt:251 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

github-actions[bot]
github-actions bot previously approved these changes Jul 8, 2022
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

You have modified or added at least one vcpkg.json where you should check the license field.

Details

If you feel able to do so, please consider adding a "license" field to the following files:

  • ports/liblas/vcpkg.json

Valid values for the license field can be found in the documentation

JackBoosY added 2 commits July 7, 2022 23:17
github-actions[bot]
github-actions bot previously approved these changes Jul 8, 2022
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

You have modified or added at least one vcpkg.json where you should check the license field.

Details

If you feel able to do so, please consider adding a "license" field to the following files:

  • ports/liblas/vcpkg.json

Valid values for the license field can be found in the documentation

github-actions[bot]
github-actions bot previously approved these changes Jul 8, 2022
@dg0yt
Copy link
Contributor

dg0yt commented Jul 8, 2022

Related: #24740

This issue is unrelated to these ports. Which problem are you really solving? The geotiff patch was already upstream but not release yet.

@JackBoosY
Copy link
Contributor Author

This issue is unrelated to these ports. Which problem are you really solving?

Building vtk[all]:

FAILED: bin/vtkIOLAS-9.0d.dll lib/vtkIOLAS-9.0d.lib 
cmd.exe /C "cd . && F:\vcpkg\downloads\tools\cmake-3.22.2-windows\cmake-3.22.2-windows-i386\bin\cmake.exe -E vs_link_dll --intdir=IO\LAS\CMakeFiles\IOLAS.dir --rc="C:\PROGRA~2\Windows Kits\10\bin\10.0.19041.0\x64\rc.exe" --mt="C:\PROGRA~2\Windows Kits\10\bin\10.0.19041.0\x64\mt.exe" --manifests  -- "C:\PROGRA~2\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\link.exe"  IO\LAS\CMakeFiles\IOLAS.dir\vtkLASReader.cxx.obj  /out:bin\vtkIOLAS-9.0d.dll /implib:lib\vtkIOLAS-9.0d.lib /pdb:bin\vtkIOLAS-9.0d.pdb /dll /version:9.0 /machine:x64  /nologo    /debug /INCREMENTAL  lib\vtkFiltersGeneral-9.0d.lib  F:\vcpkg\installed\x64-windows\debug\lib\liblas_c.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_filesystem-vc140-mt-gd.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_iostreams-vc140-mt-gd.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_program_options-vc140-mt-gd.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_system-vc140-mt-gd.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_thread-vc140-mt-gd.lib  lib\vtkFiltersCore-9.0d.lib  lib\vtkCommonExecutionModel-9.0d.lib  lib\vtkCommonDataModel-9.0d.lib  lib\vtkCommonMisc-9.0d.lib  lib\vtkCommonTransforms-9.0d.lib  lib\vtkCommonMath-9.0d.lib  lib\vtkCommonCore-9.0d.lib  lib\vtksys-9.0d.lib  ws2_32.lib  dbghelp.lib  psapi.lib  F:\vcpkg\installed\x64-windows\debug\lib\liblas.lib  F:\vcpkg\installed\x64-windows\debug\lib\tiffd.lib  geotiff_library.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_program_options-vc140-mt-gd.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_thread-vc140-mt-gd.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_system-vc140-mt-gd.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_iostreams-vc140-mt-gd.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_filesystem-vc140-mt-gd.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_chrono-vc140-mt-gd.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_atomic-vc140-mt-gd.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_regex-vc140-mt-gd.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_regex-vc140-mt-gd.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_chrono-vc140-mt-gd.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_atomic-vc140-mt-gd.lib  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib  && cd ."
LINK Pass 1: command "C:\PROGRA~2\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\link.exe IO\LAS\CMakeFiles\IOLAS.dir\vtkLASReader.cxx.obj /out:bin\vtkIOLAS-9.0d.dll /implib:lib\vtkIOLAS-9.0d.lib /pdb:bin\vtkIOLAS-9.0d.pdb /dll /version:9.0 /machine:x64 /nologo /debug /INCREMENTAL lib\vtkFiltersGeneral-9.0d.lib F:\vcpkg\installed\x64-windows\debug\lib\liblas_c.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_filesystem-vc140-mt-gd.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_iostreams-vc140-mt-gd.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_program_options-vc140-mt-gd.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_system-vc140-mt-gd.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_thread-vc140-mt-gd.lib lib\vtkFiltersCore-9.0d.lib lib\vtkCommonExecutionModel-9.0d.lib lib\vtkCommonDataModel-9.0d.lib lib\vtkCommonMisc-9.0d.lib lib\vtkCommonTransforms-9.0d.lib lib\vtkCommonMath-9.0d.lib lib\vtkCommonCore-9.0d.lib lib\vtksys-9.0d.lib ws2_32.lib dbghelp.lib psapi.lib F:\vcpkg\installed\x64-windows\debug\lib\liblas.lib F:\vcpkg\installed\x64-windows\debug\lib\tiffd.lib geotiff_library.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_program_options-vc140-mt-gd.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_thread-vc140-mt-gd.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_system-vc140-mt-gd.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_iostreams-vc140-mt-gd.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_filesystem-vc140-mt-gd.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_chrono-vc140-mt-gd.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_atomic-vc140-mt-gd.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_regex-vc140-mt-gd.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_regex-vc140-mt-gd.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_chrono-vc140-mt-gd.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_atomic-vc140-mt-gd.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:IO\LAS\CMakeFiles\IOLAS.dir/intermediate.manifest IO\LAS\CMakeFiles\IOLAS.dir/manifest.res" failed (exit code 1104) with the following output:
LINK : fatal error LNK1104: cannot open file 'geotiff_library.lib'

The geotiff patch was already upstream but not release yet.

But apparently, there are still problems with geotiff, see my comment above.

@dg0yt
Copy link
Contributor

dg0yt commented Jul 8, 2022

This issue is unrelated to these ports. Which problem are you really solving?

Building vtk[all]:

FAILED: bin/vtkIOLAS-9.0d.dll lib/vtkIOLAS-9.0d.lib 
cmd.exe /C "cd . && F:\vcpkg\downloads\tools\cmake-3.22.2-windows\cmake-3.22.2-windows-i386\bin\cmake.exe -E vs_link_dll --intdir=IO\LAS\CMakeFiles\IOLAS.dir --rc="C:\PROGRA~2\Windows Kits\10\bin\10.0.19041.0\x64\rc.exe" --mt="C:\PROGRA~2\Windows Kits\10\bin\10.0.19041.0\x64\mt.exe" --manifests  -- "C:\PROGRA~2\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\link.exe"  IO\LAS\CMakeFiles\IOLAS.dir\vtkLASReader.cxx.obj  /out:bin\vtkIOLAS-9.0d.dll /implib:lib\vtkIOLAS-9.0d.lib /pdb:bin\vtkIOLAS-9.0d.pdb /dll /version:9.0 /machine:x64  /nologo    /debug /INCREMENTAL  lib\vtkFiltersGeneral-9.0d.lib  F:\vcpkg\installed\x64-windows\debug\lib\liblas_c.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_filesystem-vc140-mt-gd.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_iostreams-vc140-mt-gd.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_program_options-vc140-mt-gd.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_system-vc140-mt-gd.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_thread-vc140-mt-gd.lib  lib\vtkFiltersCore-9.0d.lib  lib\vtkCommonExecutionModel-9.0d.lib  lib\vtkCommonDataModel-9.0d.lib  lib\vtkCommonMisc-9.0d.lib  lib\vtkCommonTransforms-9.0d.lib  lib\vtkCommonMath-9.0d.lib  lib\vtkCommonCore-9.0d.lib  lib\vtksys-9.0d.lib  ws2_32.lib  dbghelp.lib  psapi.lib  F:\vcpkg\installed\x64-windows\debug\lib\liblas.lib  F:\vcpkg\installed\x64-windows\debug\lib\tiffd.lib  geotiff_library.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_program_options-vc140-mt-gd.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_thread-vc140-mt-gd.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_system-vc140-mt-gd.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_iostreams-vc140-mt-gd.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_filesystem-vc140-mt-gd.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_chrono-vc140-mt-gd.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_atomic-vc140-mt-gd.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_regex-vc140-mt-gd.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_regex-vc140-mt-gd.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_chrono-vc140-mt-gd.lib  F:\vcpkg\installed\x64-windows\debug\lib\boost_atomic-vc140-mt-gd.lib  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib  && cd ."
LINK Pass 1: command "C:\PROGRA~2\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\link.exe IO\LAS\CMakeFiles\IOLAS.dir\vtkLASReader.cxx.obj /out:bin\vtkIOLAS-9.0d.dll /implib:lib\vtkIOLAS-9.0d.lib /pdb:bin\vtkIOLAS-9.0d.pdb /dll /version:9.0 /machine:x64 /nologo /debug /INCREMENTAL lib\vtkFiltersGeneral-9.0d.lib F:\vcpkg\installed\x64-windows\debug\lib\liblas_c.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_filesystem-vc140-mt-gd.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_iostreams-vc140-mt-gd.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_program_options-vc140-mt-gd.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_system-vc140-mt-gd.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_thread-vc140-mt-gd.lib lib\vtkFiltersCore-9.0d.lib lib\vtkCommonExecutionModel-9.0d.lib lib\vtkCommonDataModel-9.0d.lib lib\vtkCommonMisc-9.0d.lib lib\vtkCommonTransforms-9.0d.lib lib\vtkCommonMath-9.0d.lib lib\vtkCommonCore-9.0d.lib lib\vtksys-9.0d.lib ws2_32.lib dbghelp.lib psapi.lib F:\vcpkg\installed\x64-windows\debug\lib\liblas.lib F:\vcpkg\installed\x64-windows\debug\lib\tiffd.lib geotiff_library.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_program_options-vc140-mt-gd.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_thread-vc140-mt-gd.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_system-vc140-mt-gd.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_iostreams-vc140-mt-gd.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_filesystem-vc140-mt-gd.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_chrono-vc140-mt-gd.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_atomic-vc140-mt-gd.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_regex-vc140-mt-gd.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_regex-vc140-mt-gd.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_chrono-vc140-mt-gd.lib F:\vcpkg\installed\x64-windows\debug\lib\boost_atomic-vc140-mt-gd.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:IO\LAS\CMakeFiles\IOLAS.dir/intermediate.manifest IO\LAS\CMakeFiles\IOLAS.dir/manifest.res" failed (exit code 1104) with the following output:
LINK : fatal error LNK1104: cannot open file 'geotiff_library.lib'

Where does the geotiff_library identifier come from: from the geotiff package, from the liblas package, or from vtk?

@JackBoosY
Copy link
Contributor Author

Where does the geotiff_library identifier come from: from the geotiff package, from the liblas package, or from vtk?

Comes from liblas, that's why I also fixed liblas in this PR.

@dg0yt
Copy link
Contributor

dg0yt commented Jul 8, 2022

Where does the geotiff_library identifier come from: from the geotiff package, from the liblas package, or from vtk?

Comes from liblas, that's why I also fixed liblas in this PR.

So this doesn't explain why you revert the upstreamed libgeotiff patch.

github-actions[bot]
github-actions bot previously approved these changes Jul 8, 2022
@JackBoosY JackBoosY requested a review from LilyWangLL July 8, 2022 12:37
LilyWangLL
LilyWangLL previously approved these changes Jul 8, 2022
@LilyWangLL LilyWangLL added the info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. label Jul 8, 2022
JackBoosY added 2 commits July 8, 2022 08:37
@JackBoosY JackBoosY dismissed stale reviews from LilyWangLL and github-actions[bot] via 75f6d32 July 8, 2022 15:37
github-actions[bot]
github-actions bot previously approved these changes Jul 8, 2022
@dg0yt
Copy link
Contributor

dg0yt commented Jul 8, 2022

I will do an independent review of port liblas.

@JackBoosY JackBoosY removed the info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. label Jul 9, 2022
@JackBoosY JackBoosY changed the title [libgeotiff/liblas] Fix usage [libgeotiff] Fix usage Jul 11, 2022
@JackBoosY JackBoosY requested a review from LilyWangLL July 11, 2022 04:47
set(PROJ_LIBRARIES PROJ::proj)
- string(APPEND CONFIG_DEPENDENCIES " find_dependency(PROJ CONFIG)\n")
+ string(APPEND CONFIG_PRIVATE_DEPENDENCIES " find_dependency(PROJ CONFIG)\n")
+ string(APPEND CONFIG_PUBLIC_DEPENDENCIES " find_dependency(PROJ CONFIG)\n")
Copy link
Contributor

Choose a reason for hiding this comment

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

I still think this change is wrong/not needed. It is a private dependency. It is not part of INTERFACE_LINK_LIBRARIES.
However, CMake starts to export a new property IMPORTED_LINK_DEPENDENT_LIBRARIES. If this is going to need find_dependency, you will have a lot of more ports to update.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Anyway, this port requires to link with proj: #25636 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

This port does link with proj. That's how proj.dll comes into the list in your comment.
The question is if downstream consumers are forced to explicitly link to proj, too (public dependency).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No ideas with this. Maybe we also should fix them.

Copy link
Contributor

Choose a reason for hiding this comment

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

You have to show what is actually broken. If it ain't broken, don't fix it.

Copy link
Contributor Author

@JackBoosY JackBoosY Jul 11, 2022

Choose a reason for hiding this comment

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

In geotiff-depends-debug.cmake:

set_target_properties(geotiff_library PROPERTIES
  IMPORTED_IMPLIB_DEBUG "${_IMPORT_PREFIX}/debug/lib/geotiff_d_i.lib"
  IMPORTED_LINK_DEPENDENT_LIBRARIES_DEBUG "PROJ::proj"
  IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG "TIFF::TIFF"
  IMPORTED_LOCATION_DEBUG "${_IMPORT_PREFIX}/debug/bin/geotiff_d.dll"
  )

Doc: https://cmake.org/cmake/help/latest/prop_tgt/IMPORTED_LINK_DEPENDENT_LIBRARIES.html

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. That's what I'm saying: PROJ::proj is not in INTERFACE_LINK_LIBRARIES. Either we don't need to deal with this property (because we don't deal with rpath), or you will have to fix another 200 ports. AFAIU, CMake "just ignores entries of IMPORTED_LINK_DEPENDENT_LIBRARIES that cannot be found", cf. https://discourse.cmake.org/t/use-cases-for-imported-link-dependent-libraries/5662.

# @PROJECT_NAME_UPPER@_LIBRARIES

+cmake_policy(PUSH)
+cmake_policy(SET CMP0012 NEW)
Copy link
Contributor

Choose a reason for hiding this comment

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

I often add the policy in wrappers, but I'm not sure if this should be extended to CMake config. Ports which use CMake config hardly run with such low cmake_minimum_required.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is a upstream bug, so it's not appropriate to place it in a wrapper.

Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't mean that it is to be placed in a wrapper for libgeotiff.
I mean that we should not add patches for config consumers which don't do at least cmake_minimum_required(VERSION 2.8). It is not an upstream bug if they don't care for stone-age consumers.
(And liblas had the extra issue that cmake_minimum_required appeared after project.)

@JackBoosY JackBoosY marked this pull request as draft July 22, 2022 07:01
@LilyWangLL
Copy link
Contributor

Closing this PR since it seems that no progress is being made. Please ping me to reopen if work is still being done.

@LilyWangLL LilyWangLL closed this Sep 19, 2022
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants