Bug report #2961

mapserver hardwires absolute install path

Added by William Kyngesburye about 10 years ago. Updated about 10 years ago.

Status:Closed
Priority:Low
Assignee:nobody -
Category:Build/Install
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

Description

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 = ..

History

#1 Updated by Volker Fröhlich about 10 years ago

Somewhat related:

I don't think it's a good idea to default to bin for the CGI files for safety reasons. Besides that, there are also 2 non-binary files that go into the same directory, which also shouldn't be done for bin.

#2 Updated by Marco Hugentobler about 10 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

It is now () possible to set the prefix path with the environment variable QGIS_PREFIX_PATH. If not set, it defaults to the cmake install prefix.

Also available in: Atom PDF