Bug report #11081

FindGEOS does not find a development version (GEOS_VERSION "x.x.xdev")

Added by Gabriele Monfardini almost 10 years ago. Updated almost 10 years ago.

Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:19414


qgis master up-to-date (2014-08-20)
S.O. kubuntu linux

I use a development version of geos, GEOS_VERSION="3.5.0dev", installed in /usr/local/bin
cmake fails with error

CMake Error at cmake/FindGEOS.cmake:162 (STRING):
  string sub-command REGEX, mode MATCH needs at least 5 arguments total to

At line 162

STRING(REGEX MATCH "[0-9]+\\\\.[0-9]\\\\.[0-9]+" GEOS_VERSION ${GEOS_VERSION})

fails since $(GEOS_VERSION) is empty.

${GEOS_VERSION} is empty since at line 161

STRING(REGEX MATCH "#define GEOS_VERSION \\"[0-9]+\\\\.[0-9]+\\\\.[0-9]+\\"" GEOS_VERSION ${VERSIONFILE})

does not find any match since in my geos_c.h I have
#define GEOS_VERSION "3.5.0dev" 

Proposed solution is to change line 161 with

STRING(REGEX MATCH "#define GEOS_VERSION \\"[0-9]+\\\\.[0-9]+\\\\.[0-9]+(dev)*\\"" GEOS_VERSION ${VERSIONFILE})

I've tested this against a dev and a non dev version and it seems to work.

Attached you'll find a unified git diff patch

FindGeos_dev.patch Magnifier - Patch to allow cmake to find a development version (x.x.xdev) of GEOS (612 Bytes) Gabriele Monfardini, 2014-08-20 02:16 AM

Associated revisions

Revision 00ca017d
Added by Jürgen Fischer almost 10 years ago

Fix GEOS dev detection (fixes #11081)


#1 Updated by Jürgen Fischer almost 10 years ago

  • Category set to Build/Install

#2 Updated by Jürgen Fischer almost 10 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF