Using MrSID through vcpkg distribution of GDAL

112 Views Asked by At

my company uses GDAL with several additional dependencies. One of which is MrSID (the free reading SDK only).

Until now we've been manually downloading and building our 3rd party dependencies, but we're really hoping to move as much of that as possible to NuGet and/or vcpkg to simplify our upgrade process.

All of the additional GDAL dependencies we use, except for MrSID, are available through vcpkg. I haven't found any documentation through microsoft or GDAL on setting up a vcpkg installation to use MrSID.

Does anyone have any experience with this?

1

There are 1 best solutions below

0
On BEST ANSWER

I was able to fix it by the following:

  • Download the sdk you want from extensis

    • Make a \vcpkg\extra directory and unzip the mrsid sdk into it
  • Open \vcpkg\ports\gdal\portfile.cmake

    • Add the relevant MRSID CMAKE params to vcpkg_cmake_configure() on line 95:

    -DGDAL_USE_MRSID=ON

    "-DMRSID_LIBRARY=${CMAKE_CURRENT_LIST_DIR}/../../extra/MrSID_DSDK-9.5.5.5244-win32-vc17/Raster_DSDK/lib/lti_dsdk.lib"

    "-DMRSID_INCLUDE_DIR=${CMAKE_CURRENT_LIST_DIR}/../../extra/MrSID_DSDK-9.5.5.5244-win32-vc17/Raster_DSDK/include"

  • Run .\vcpkg remove gdal

  • Delete the contents of \vcpkg\buildtrees\gdal\

  • Run .\vcpkg install gdal

  • copy tli_dsdk_9.5.dll to the Debug and Release output directories of your project

I don't love changing the portfile.cmake since I'll have to redo the edit every time I want to update gdal; but I believe vcpkg is unable to distribute MrSID because of LizardTech's rules, and having a packagemanager is a significant upgrade for this process. I may make a script or custom vcpkg port to simplify this in the future.