2021-12-07 09:58:47 +08:00
|
|
|
# Allow empty include directory
|
|
|
|
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
|
|
|
|
|
2023-08-16 07:31:44 +08:00
|
|
|
string(REPLACE "-" "" SPATIALITE_TOOLS_VERSION_STR "${VERSION}")
|
2017-10-04 23:34:13 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2021-12-07 09:58:47 +08:00
|
|
|
URLS "https://www.gaia-gis.it/gaia-sins/spatialite-tools-sources/spatialite-tools-${SPATIALITE_TOOLS_VERSION_STR}.tar.gz"
|
2020-12-23 15:21:14 +08:00
|
|
|
FILENAME "spatialite-tools-${SPATIALITE_TOOLS_VERSION_STR}.tar.gz"
|
2023-08-16 07:31:44 +08:00
|
|
|
SHA512 cf255c9e04e78e450e20019e3c988b2b0a770c6b7857a5b1c95d0696ee29902e7a85667c1a38dec9aa164fa6d28a444be6365b0444b78015180c1f27fa68ea89
|
2017-10-04 23:34:13 +08:00
|
|
|
)
|
|
|
|
|
2021-12-07 09:58:47 +08:00
|
|
|
vcpkg_extract_source_archive(SOURCE_PATH
|
|
|
|
ARCHIVE "${ARCHIVE}"
|
2019-10-08 01:35:13 +08:00
|
|
|
PATCHES
|
|
|
|
fix-makefiles.patch
|
2017-10-04 23:34:13 +08:00
|
|
|
)
|
2021-12-07 09:58:47 +08:00
|
|
|
file(REMOVE "${SOURCE_PATH}/config.h")
|
|
|
|
|
|
|
|
set(PKGCONFIG_MODULES expat libxml-2.0 sqlite3)
|
2017-10-04 23:34:13 +08:00
|
|
|
|
2020-12-23 15:21:14 +08:00
|
|
|
if (VCPKG_TARGET_IS_WINDOWS)
|
2021-12-07 09:58:47 +08:00
|
|
|
list(APPEND PKGCONFIG_MODULES readosm spatialite)
|
|
|
|
x_vcpkg_pkgconfig_get_modules(
|
|
|
|
PREFIX PKGCONFIG
|
|
|
|
MODULES --msvc-syntax ${PKGCONFIG_MODULES}
|
|
|
|
LIBS
|
|
|
|
)
|
2017-10-04 23:34:13 +08:00
|
|
|
|
2021-12-10 10:18:18 +08:00
|
|
|
# vcpkg_build_nmake doesn't supply cmake's implicit link libraries
|
|
|
|
if(PKGCONFIG_LIBS_DEBUG MATCHES "libcrypto")
|
|
|
|
string(APPEND PKGCONFIG_LIBS_DEBUG " user32.lib")
|
|
|
|
endif()
|
|
|
|
if(PKGCONFIG_LIBS_RELEASE MATCHES "libcrypto")
|
|
|
|
string(APPEND PKGCONFIG_LIBS_RELEASE " user32.lib")
|
|
|
|
endif()
|
|
|
|
|
2021-12-07 09:58:47 +08:00
|
|
|
set(ICONV_LIBS "iconv.lib")
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
string(APPEND ICONV_LIBS " charset.lib")
|
|
|
|
endif()
|
2017-10-04 23:34:13 +08:00
|
|
|
|
2021-12-07 09:58:47 +08:00
|
|
|
set(UWP_LIBS "")
|
|
|
|
if(VCPKG_TARGET_IS_UWP)
|
|
|
|
set(UWP_LIBS "windowsapp.lib /APPCONTAINER")
|
|
|
|
endif()
|
2017-10-04 23:34:13 +08:00
|
|
|
|
2021-12-07 09:58:47 +08:00
|
|
|
file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}" INST_DIR)
|
2017-10-04 23:34:13 +08:00
|
|
|
|
2021-12-07 09:58:47 +08:00
|
|
|
vcpkg_install_nmake(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2022-11-03 02:32:43 +08:00
|
|
|
PREFER_JOM
|
|
|
|
CL_LANGUAGE C
|
2021-12-07 09:58:47 +08:00
|
|
|
OPTIONS_RELEASE
|
|
|
|
"INSTDIR=${INST_DIR}"
|
|
|
|
"LIBS_ALL=/link ${PKGCONFIG_LIBS_RELEASE} ${ICONV_LIBS} ${UWP_LIBS}"
|
|
|
|
OPTIONS_DEBUG
|
|
|
|
"INSTDIR=${INST_DIR}\\debug"
|
|
|
|
"LIBS_ALL=/link ${PKGCONFIG_LIBS_DEBUG} ${ICONV_LIBS} ${UWP_LIBS}"
|
|
|
|
)
|
2017-10-04 23:34:13 +08:00
|
|
|
|
2021-12-07 09:58:47 +08:00
|
|
|
set(TOOL_EXES
|
|
|
|
shp_sanitize
|
|
|
|
spatialite_osm_filter
|
|
|
|
spatialite_osm_raw
|
|
|
|
spatialite_gml
|
|
|
|
spatialite_osm_map
|
|
|
|
exif_loader
|
|
|
|
spatialite_osm_net
|
|
|
|
spatialite_network
|
|
|
|
spatialite_tool
|
|
|
|
shp_doctor
|
|
|
|
spatialite
|
|
|
|
)
|
|
|
|
vcpkg_copy_tools(TOOL_NAMES ${TOOL_EXES} AUTO_CLEAN)
|
2017-10-04 23:34:13 +08:00
|
|
|
|
2021-12-07 09:58:47 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")
|
2017-10-04 23:34:13 +08:00
|
|
|
|
2021-12-07 09:58:47 +08:00
|
|
|
else()
|
|
|
|
x_vcpkg_pkgconfig_get_modules(
|
|
|
|
PREFIX PKGCONFIG
|
|
|
|
MODULES ${PKGCONFIG_MODULES}
|
|
|
|
LIBS
|
|
|
|
)
|
2017-10-04 23:34:13 +08:00
|
|
|
|
2021-12-07 09:58:47 +08:00
|
|
|
vcpkg_configure_make(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
|
|
AUTOCONFIG
|
|
|
|
OPTIONS
|
|
|
|
--disable-minizip
|
|
|
|
--disable-readline
|
|
|
|
--enable-readosm
|
|
|
|
OPTIONS_DEBUG
|
|
|
|
"LIBS=${PKGCONFIG_LIBS_DEBUG} \$LIBS"
|
|
|
|
OPTIONS_RELEASE
|
|
|
|
"LIBS=${PKGCONFIG_LIBS_RELEASE} \$LIBS"
|
|
|
|
)
|
2017-10-04 23:34:13 +08:00
|
|
|
|
2021-12-07 09:58:47 +08:00
|
|
|
vcpkg_install_make()
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")
|
2017-10-04 23:34:13 +08:00
|
|
|
endif()
|
|
|
|
|
2020-12-23 15:21:14 +08:00
|
|
|
# Handle copyright
|
2021-12-07 09:58:47 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|