Skip to content
Permalink
Browse files

Use FIND_LIBRARY to find GDAL, GEOS and Postgres libraries

On OpenBSD, there's no libgdal.so symlink, only a versioned library (ie
libgdal.so.X.Y where X.Y changes over time so is never constant)
Using cmake's FIND_LIBRARY allows to let cmake find the library.

Without this, the build would fail on OpenBSD:
ninja: error: '/usr/local/lib/libgdal.so', needed by 'output/lib/libqgis_core.so.18.0', missing and no known rule to make it
  • Loading branch information
landryb committed Jan 25, 2018
1 parent 7ee4bb7 commit 26f8f165c48162c0b4271d385a4e8479e9696ef8
Showing with 3 additions and 3 deletions.
  1. +1 −1 cmake/FindGDAL.cmake
  2. +1 −1 cmake/FindGEOS.cmake
  3. +1 −1 cmake/FindPostgres.cmake
@@ -167,7 +167,7 @@ ELSE(WIN32)
SET(GDAL_LIBRARY ${GDAL_LINK_DIRECTORIES}/lib${GDAL_LIB_NAME}.dylib CACHE STRING INTERNAL FORCE)
ENDIF (NOT GDAL_LIBRARY)
ELSE (APPLE)
SET(GDAL_LIBRARY ${GDAL_LINK_DIRECTORIES}/lib${GDAL_LIB_NAME}.so CACHE STRING INTERNAL)
FIND_LIBRARY(GDAL_LIBRARY NAMES ${GDAL_LIB_NAME} PATHS ${GDAL_LINK_DIRECTORIES}/lib)
ENDIF (APPLE)

ELSE(GDAL_CONFIG)
@@ -148,7 +148,7 @@ ELSE(WIN32)
SET(GEOS_LIBRARY ${GEOS_LINK_DIRECTORIES}/lib${GEOS_LIB_NAME}.dylib CACHE STRING INTERNAL FORCE)
ENDIF (NOT GEOS_LIBRARY)
ELSE (APPLE)
SET(GEOS_LIBRARY ${GEOS_LINK_DIRECTORIES}/lib${GEOS_LIB_NAME}.so CACHE STRING INTERNAL)
FIND_LIBRARY(GEOS_LIBRARY NAMES ${GEOS_LIB_NAME} PATHS ${GEOS_LIB_DIRECTORIES}/lib)
ENDIF (APPLE)
#MESSAGE("DBG GEOS_LIBRARY=${GEOS_LIBRARY}")

@@ -96,7 +96,7 @@ ELSE(WIN32)
ENDFOREACH(_LIBNAME ${_LIBS})

ELSE (CYGWIN)
SET(POSTGRES_LIBRARY ${PG_TMP}/libpq.so CACHE STRING INTERNAL)
FIND_LIBRARY(POSTGRES_LIBRARY NAMES pq libpq libpqdll PATHS ${PG_TMP}/lib)
ENDIF (APPLE)
ENDIF(POSTGRES_CONFIG)

0 comments on commit 26f8f16

Please sign in to comment.
You can’t perform that action at this time.