Bug report #2961
mapserver hardwires absolute install path
|Affected QGIS version:||Regression?:||No|
|Operating System:||All||Easy fix?:||No|
|Pull Request or Patch supplied:||Resolution:||fixed|
|Crashes QGIS or corrupts data:||Copied to github as #:||13021|
The new mapserver component hardwires CMAKE_INSTALL_PREFIX in the executable. This locks down the user install location of Qgis, which on OS X (maybe Windows also?) can change from the compiled CMAKE_INSTALL_PREFIX.
But, I realize it could be tricky with the mapserv executable, since I think it wants the QGIS install path to be able to find Qgis resources.
A couple similar options I can think of:
- how the help app handles this: for the OS X build, it backtracks from prefixPath() to the Qgis executable (mapserv could use known QGIS_CGIBIN_SUBDIR values for different systems), then goes from there with the relative QGIS_*_SUBDIR vars. Still a bit fragile, if the QGIS_CGIBIN_SUBDIR is configured different from default.
- configure a matching QGIS_CGIBIN_SUBDIR_REV that backtracks (I use this in the OS X Xcode project in QGIS_LIBEXEC_SUBDIR_REV for other executables). So, mapserv prefixPath() + "/" + QGIS_CGIBIN_SUBDIR_REV = Qgis prefixPath(). I don't know if the relative subdir vars are meant to be user-configurable, if so, this could be tricky to generate an inverse subdir during cmake configuration.
ie, if QGIS_CGIBIN_SUBDIR = bin (unix, Mac), QGIS_CGIBIN_SUBDIR_REV = ..