[QGIS-trac] [Quantum GIS] #3376: CMake cannot find GDAL or GEOS

Quantum GIS qgis at qgis.org
Thu Dec 30 06:40:01 EST 2010


#3376: CMake cannot find GDAL or GEOS
------------------------------------------------+---------------------------
   Reporter:  sharpie                           |              Owner:  nobody       
       Type:  bug                               |             Status:  new          
   Priority:  major: does not work as expected  |          Milestone:  Version 1.7.0
  Component:  Build/Install                     |            Version:  1.6.0        
   Keywords:  cmake osx                         |   Platform_version:               
   Platform:  OS X                              |           Must_fix:  No           
Status_info:  0                                 |  
------------------------------------------------+---------------------------
 With QGIS 1.6.0, the CMake scripts seem to be unable to detect the GEOS or
 GRASS libraries even though they are accessible in /usr/local/lib.

 Running cmake .., I get:

 {{{
 GEOS_INCLUDE_DIR=/usr/local/include
 GEOS_LIBRARY=GEOS_LIBRARY-NOTFOUND
 CMake Error at cmake/FindGEOS.cmake:163 (MESSAGE):
   Could not find GEOS
 Call Stack (most recent call first):
   CMakeLists.txt:141 (FIND_PACKAGE)


 -- Configuring incomplete, errors occurred!
 }}}

 It is odd that CMake discovers the headers, but fails to find the library.

 Even stranger, is that if I add a tracing statement after line 135 of
 FindGEOS.cmake:

 {{{
 IF (APPLE)
   SET(GEOS_LIBRARY ${GEOS_LINK_DIRECTORIES}/lib${GEOS_LIB_NAME}.dylib
 CACHE STRING INTERNAL)
   MESSAGE("Library should be set to:
 ${GEOS_LINK_DIRECTORIES}/lib${GEOS_LIB_NAME}.dylib")
 ELSE (APPLE)
 }}}

 I see a message printed out that has the correct path to the library, yet
 GEOS_LIBRARY is still set to GEOS_LIBRARY-NOTFOUND.

 If I replace the call to SET with a call to FIND_LIBRARY, everything
 works:

 {{{
  IF (APPLE)
    FIND_LIBRARY(GEOS_LIBRARY ${GEOS_LIB_NAME}
      PATHS ${GEOS_LINK_DIRECTORIES}/lib)
  ELSE (APPLE)
 }}}

 Attached is a patch that makes this change for FindGEOS.cmake and
 FindGDAL.cmake.  I don't have William Kyngesburye's frameworks installed
 so I can't judge whether or not these changes negatively impact his build
 process.

 Version 1.5.0 builds from source just fine.

-- 
Ticket URL: <https://trac.osgeo.org/qgis/ticket/3376>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats


More information about the QGIS-trac mailing list