Ticket #3376 (closed bug: fixed)
CMake cannot find GDAL or GEOS
| Reported by: | sharpie | Owned by: | nobody |
|---|---|---|---|
| Priority: | major: does not work as expected | Milestone: | Version 1.7.0 |
| Component: | Build/Install | Version: | 1.6.0 |
| Keywords: | cmake osx | Cc: | |
| Platform Version: | Platform: | OS X | |
| Must Fix for Release: | No | Awaiting user input: | no |
Description
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.
