[gdal] Add libspatialite build-dependency (#6251)

* add libspatialite for gdal

* add libspatialite

* Bump version

* Add libspatialite as feature

* Do not use gen expressions as nmake does not support
This commit is contained in:
Jeremy 2019-05-05 09:35:25 +08:00 committed by Griffin Downs
parent 5ea9105f15
commit 4c7f464233
2 changed files with 15 additions and 3 deletions

View File

@ -6,3 +6,7 @@ Build-Depends: proj, libpng, geos, sqlite3, curl, expat, libpq, openjpeg, libweb
Feature: mysql-libmariadb
Build-Depends: libmariadb
Description: Add mysql support using libmariadb
Feature: libspatialite
Build-Depends: libspatialite
Description: Create or update SpatiaLite databases using libspatialite

View File

@ -135,6 +135,14 @@ if("mysql-libmysql" IN_LIST FEATURES OR "mysql-libmariadb" IN_LIST FEATURES)
list(APPEND NMAKE_OPTIONS_DBG MYSQL_LIB=${MYSQL_LIBRARY_DBG})
endif()
if ("libspatialite" IN_LIST FEATURES)
# Setup spatialite libraries + include path
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include/spatialite" SPATIALITE_INCLUDE_DIR)
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/spatialite.lib" SPATIALITE_LIBRARY_REL)
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/spatialite.lib" SPATIALITE_LIBRARY_DBG)
set(HAVE_SPATIALITE "-DHAVE_SPATIALITE")
endif()
list(APPEND NMAKE_OPTIONS
GDAL_HOME=${NATIVE_PACKAGES_DIR}
DATADIR=${NATIVE_DATA_DIR}
@ -145,7 +153,7 @@ list(APPEND NMAKE_OPTIONS
EXPAT_DIR=${EXPAT_INCLUDE_DIR}
EXPAT_INCLUDE=-I${EXPAT_INCLUDE_DIR}
CURL_INC=-I${CURL_INCLUDE_DIR}
SQLITE_INC=-I${SQLITE_INCLUDE_DIR}
"SQLITE_INC=-I${SQLITE_INCLUDE_DIR} ${HAVE_SPATIALITE}"
PG_INC_DIR=${PGSQL_INCLUDE_DIR}
OPENJPEG_ENABLED=YES
OPENJPEG_CFLAGS=-I${OPENJPEG_INCLUDE_DIR}
@ -184,7 +192,7 @@ list(APPEND NMAKE_OPTIONS_REL
GEOS_LIB=${GEOS_LIBRARY_REL}
EXPAT_LIB=${EXPAT_LIBRARY_REL}
"CURL_LIB=${CURL_LIBRARY_REL} wsock32.lib wldap32.lib winmm.lib"
SQLITE_LIB=${SQLITE_LIBRARY_REL}
"SQLITE_LIB=${SQLITE_LIBRARY_REL} ${SPATIALITE_LIBRARY_REL}"
OPENJPEG_LIB=${OPENJPEG_LIBRARY_REL}
WEBP_LIBS=${WEBP_LIBRARY_REL}
LIBXML2_LIB=${XML2_LIBRARY_REL}
@ -202,7 +210,7 @@ list(APPEND NMAKE_OPTIONS_DBG
GEOS_LIB=${GEOS_LIBRARY_DBG}
EXPAT_LIB=${EXPAT_LIBRARY_DBG}
"CURL_LIB=${CURL_LIBRARY_DBG} wsock32.lib wldap32.lib winmm.lib"
SQLITE_LIB=${SQLITE_LIBRARY_DBG}
"SQLITE_LIB=${SQLITE_LIBRARY_DBG} ${SPATIALITE_LIBRARY_DBG}"
OPENJPEG_LIB=${OPENJPEG_LIBRARY_DBG}
WEBP_LIBS=${WEBP_LIBRARY_DBG}
LIBXML2_LIB=${XML2_LIBRARY_DBG}