Skip to content

Commit

Permalink
Use FIND_LIBRARY to find GDAL, GEOS and Postgres libraries
Browse files Browse the repository at this point in the history
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 26f8f16
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmake/FindGDAL.cmake
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindGEOS.cmake
Expand Up @@ -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}")

Expand Down
2 changes: 1 addition & 1 deletion cmake/FindPostgres.cmake
Expand Up @@ -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)

Expand Down

0 comments on commit 26f8f16

Please sign in to comment.