From 061e92ab17c2e21c3d73c7ea7319fe4e925bd8c3 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Mon, 13 Sep 2021 23:41:20 +0200 Subject: [PATCH] [gdal] Make building executables optional (#19243) * [gdal] Optional "tool" feature to build executables Fixes #19189 * x-add-version * Fix remove of tools * Always delete the debug tools * Add patch to make tools build optional (non-windows) * Update patch to make tools build optional (windows) * Update git-tree * Update tools patch * Update git-tree * Revise windows tools handling * x-add-version * Remove empty bin dir * Update git-tree * Remove obsolete static tools patch * Update git-tree * update * reindent * x-add-version * restore version Co-authored-by: Kai Pastor --- ports/gdal/0003-Fix-static-build.patch | 22 -- ports/gdal/0007-Control-tools.patch | 83 ++++++ ports/gdal/portfile.cmake | 346 +++++++++++++------------ ports/gdal/vcpkg.json | 5 +- versions/baseline.json | 2 +- versions/g-/gdal.json | 5 + 6 files changed, 273 insertions(+), 190 deletions(-) delete mode 100644 ports/gdal/0003-Fix-static-build.patch create mode 100644 ports/gdal/0007-Control-tools.patch diff --git a/ports/gdal/0003-Fix-static-build.patch b/ports/gdal/0003-Fix-static-build.patch deleted file mode 100644 index 42f76d205cf471..00000000000000 --- a/ports/gdal/0003-Fix-static-build.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/makefile.vc b/makefile.vc -index 8559f79..87f8fc9 100644 ---- a/makefile.vc -+++ b/makefile.vc -@@ -61,7 +61,7 @@ TARGET_LIB = staticlib - - DEFAULT_TARGETS = - --default: $(TARGET_LIB) $(PLUGIN_TARGET) apps_dir -+default: $(TARGET_LIB) $(PLUGIN_TARGET) - - # Batch commands to clean main build output are stored in a macro so they can be reused by different - # targets in an inline temporary batch file. -@@ -230,8 +230,6 @@ install: default docs - if exist $(GDAL_DLL) $(INSTALL) $(GDAL_DLL) $(BINDIR) - cd frmts - $(MAKE) /f makefile.vc plugins-install -- cd ..\apps -- $(MAKE) /f makefile.vc install - cd .. - $(INSTALL) data\*.* "$(DATADIR)" - $(INSTALL) LICENSE.TXT "$(DATADIR)" diff --git a/ports/gdal/0007-Control-tools.patch b/ports/gdal/0007-Control-tools.patch new file mode 100644 index 00000000000000..7c2b8ce7243e2a --- /dev/null +++ b/ports/gdal/0007-Control-tools.patch @@ -0,0 +1,83 @@ +diff --git a/GDALmake.opt.in b/GDALmake.opt.in +index 07955b2..0d79ac3 100644 +--- a/GDALmake.opt.in ++++ b/GDALmake.opt.in +@@ -660,3 +660,6 @@ O_OBJ = $(foreach file,$(OBJ),../o/$(file)) + + %-clean: + $(MAKE) -C $* clean ++ ++ ++BUILD_TOOLS = @BUILD_TOOLS@ +\ No newline at end of file +diff --git a/apps/GNUmakefile b/apps/GNUmakefile +index 9624cf7..f91403d 100644 +--- a/apps/GNUmakefile ++++ b/apps/GNUmakefile +@@ -43,6 +43,11 @@ NON_DEFAULT_LIST = multireadtest$(EXE) dumpoverviews$(EXE) \ + gdaltorture$(EXE) gdal2ogr$(EXE) test_ogrsf$(EXE) \ + gdalasyncread$(EXE) testreprojmulti$(EXE) + ++ifeq ($(BUILD_TOOLS),no) ++BIN_LIST = ++NON_DEFAULT_LIST = ++endif ++ + default: gdal-config-inst gdal-config $(BIN_LIST) + + all: default $(NON_DEFAULT_LIST) +diff --git a/apps/makefile.vc b/apps/makefile.vc +index 6e1fc9b..66f9b29 100644 +--- a/apps/makefile.vc ++++ b/apps/makefile.vc +@@ -20,6 +20,7 @@ GNM_PROGRAMS = gnmmanage.exe gnmanalyse.exe + !ENDIF + + ++!IF "$(BUILD_TOOLS)" == "1" + default: gdal_translate.exe gdalinfo.exe gdaladdo.exe gdalwarp.exe \ + nearblack.exe gdalmanage.exe gdalenhance.exe gdaltransform.exe\ + gdaldem.exe gdallocationinfo.exe gdalsrsinfo.exe gdalmdiminfo.exe \ +@@ -28,6 +29,10 @@ default: gdal_translate.exe gdalinfo.exe gdaladdo.exe gdalwarp.exe \ + all: default multireadtest.exe \ + dumpoverviews.exe gdalwarpsimple.exe gdalflattenmask.exe \ + gdaltorture.exe gdal2ogr.exe test_ogrsf.exe ++!ELSE ++default: ++all: ++!ENDIF + OBJ = commonutils.obj gdalinfo_lib.obj gdal_translate_lib.obj gdalwarp_lib.obj ogr2ogr_lib.obj \ + gdaldem_lib.obj nearblack_lib.obj gdal_grid_lib.obj gdal_rasterize_lib.obj gdalbuildvrt_lib.obj \ + gdalmdiminfo_lib.obj gdalmdimtranslate_lib.obj +@@ -223,5 +228,9 @@ clean: + -del *.manifest + -del *.exp + ++!IF "$(BUILD_TOOLS)" == "1" + install: default + copy *.exe $(BINDIR) ++!ELSE ++install: ++!ENDIF +\ No newline at end of file +diff --git a/configure.ac b/configure.ac +index b88676a..0a46a9c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -6150,6 +6150,16 @@ case "${host_os}" in + ;; + esac + ++BUILD_TOOLS=yes ++AC_ARG_WITH([tools], AS_HELP_STRING([--with-tools], [Build the tools]),,) ++if test "$with_tools" = "yes"; then ++ AC_MSG_RESULT([enabled]) ++else ++ BUILD_TOOLS=no ++ AC_MSG_RESULT([disabled by user]) ++fi ++AC_SUBST(BUILD_TOOLS,$BUILD_TOOLS) ++ + AC_OUTPUT(GDALmake.opt) + + dnl --------------------------------------------------------------------------- diff --git a/ports/gdal/portfile.cmake b/ports/gdal/portfile.cmake index fc46f224d9ad6b..10d1e42fca12a7 100644 --- a/ports/gdal/portfile.cmake +++ b/ports/gdal/portfile.cmake @@ -9,17 +9,16 @@ vcpkg_download_distfile(ARCHIVE URLS "http://download.osgeo.org/gdal/${GDAL_VERSION_STR}/gdal${GDAL_VERSION_PKG}.zip" FILENAME "gdal${GDAL_VERSION_PKG}.zip" SHA512 ${GDAL_PACKAGE_SUM} -) + ) set(GDAL_PATCHES 0001-Fix-debug-crt-flags.patch 0002-Fix-build.patch 0004-Fix-cfitsio.patch 0005-Fix-configure.patch -) -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - list(APPEND GDAL_PATCHES 0003-Fix-static-build.patch) -else() + 0007-Control-tools.patch + ) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") list(APPEND GDAL_PATCHES 0006-Fix-mingw-dllexport.patch) endif() @@ -27,171 +26,179 @@ vcpkg_extract_source_archive_ex( ARCHIVE "${ARCHIVE}" OUT_SOURCE_PATH SOURCE_PATH PATCHES ${GDAL_PATCHES} -) + ) if (VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) - set(NATIVE_DATA_DIR "${CURRENT_PACKAGES_DIR}/share/gdal") - set(NATIVE_HTML_DIR "${CURRENT_PACKAGES_DIR}/share/gdal/html") - - include("${CMAKE_CURRENT_LIST_DIR}/dependency_win.cmake") - find_dependency_win() - - set(NMAKE_OPTIONS "") - set(NMAKE_OPTIONS_REL "") - set(NMAKE_OPTIONS_DBG "") - - if("mysql-libmysql" IN_LIST FEATURES OR "mysql-libmariadb" IN_LIST FEATURES) - list(APPEND NMAKE_OPTIONS "MYSQL_INC_DIR=${MYSQL_INCLUDE_DIR}") - list(APPEND NMAKE_OPTIONS_REL "MYSQL_LIB=${MYSQL_LIBRARY_REL}") - list(APPEND NMAKE_OPTIONS_DBG "MYSQL_LIB=${MYSQL_LIBRARY_DBG}") - endif() - - list(APPEND NMAKE_OPTIONS - "DATADIR=${NATIVE_DATA_DIR}" - "HTMLDIR=${NATIVE_HTML_DIR}" - "GEOS_DIR=${GEOS_INCLUDE_DIR}" - "GEOS_CFLAGS=-I${GEOS_INCLUDE_DIR} -DHAVE_GEOS" - "PROJ_INCLUDE=-I${PROJ_INCLUDE_DIR}" - "EXPAT_DIR=${EXPAT_INCLUDE_DIR}" - "EXPAT_INCLUDE=-I${EXPAT_INCLUDE_DIR}" - "CURL_INC=-I${CURL_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}" - OPENJPEG_VERSION=20100 - WEBP_ENABLED=YES - "WEBP_CFLAGS=-I${WEBP_INCLUDE_DIR}" - "LIBXML2_INC=-I${XML2_INCLUDE_DIR}" - PNG_EXTERNAL_LIB=1 - "PNGDIR=${PNG_INCLUDE_DIR}" - "ZLIB_INC=-I${ZLIB_INCLUDE_DIR}" - ZLIB_EXTERNAL_LIB=1 - ACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1 - MSVC_VER=1900 - ) - - if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - list(APPEND NMAKE_OPTIONS WIN64=YES) - endif() - - if (VCPKG_LIBRARY_LINKAGE STREQUAL "static") - list(APPEND NMAKE_OPTIONS CURL_CFLAGS=-DCURL_STATICLIB) - list(APPEND NMAKE_OPTIONS DLLBUILD=0) - list(APPEND NMAKE_OPTIONS "PROJ_FLAGS=-DPROJ_STATIC -DPROJ_VERSION=5") - else() - # Enables PDBs for release and debug builds - list(APPEND NMAKE_OPTIONS WITH_PDB=1) - list(APPEND NMAKE_OPTIONS DLLBUILD=1) - endif() - - if (VCPKG_CRT_LINKAGE STREQUAL "static") - set(LINKAGE_FLAGS "/MT") - else() - set(LINKAGE_FLAGS "/MD") - endif() - - list(APPEND NMAKE_OPTIONS_REL - ${NMAKE_OPTIONS} - "GDAL_HOME=${CURRENT_PACKAGES_DIR}" - "CXX_CRT_FLAGS=${LINKAGE_FLAGS}" - "PROJ_LIBRARY=${PROJ_LIBRARY_REL}" - "PNG_LIB=${PNG_LIBRARY_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} ${SPATIALITE_LIBRARY_REL}" - "OPENJPEG_LIB=${OPENJPEG_LIBRARY_REL}" - "WEBP_LIBS=${WEBP_LIBRARY_REL}" - "LIBXML2_LIB=${XML2_LIBRARY_REL} ${ICONV_LIBRARY_REL} ${LZMA_LIBRARY_REL}" - "ZLIB_LIB=${ZLIB_LIBRARY_REL}" - "PG_LIB=${PGSQL_LIBRARY_REL} Secur32.lib Shell32.lib Advapi32.lib Crypt32.lib Gdi32.lib ${OPENSSL_LIBRARY_REL}" - ) - - list(APPEND NMAKE_OPTIONS_DBG - ${NMAKE_OPTIONS} - "GDAL_HOME=${CURRENT_PACKAGES_DIR}/debug" - "CXX_CRT_FLAGS=${LINKAGE_FLAGS}d" - "PROJ_LIBRARY=${PROJ_LIBRARY_DBG}" - "PNG_LIB=${PNG_LIBRARY_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} ${SPATIALITE_LIBRARY_DBG}" - "OPENJPEG_LIB=${OPENJPEG_LIBRARY_DBG}" - "WEBP_LIBS=${WEBP_LIBRARY_DBG}" - "LIBXML2_LIB=${XML2_LIBRARY_DBG} ${ICONV_LIBRARY_DBG} ${LZMA_LIBRARY_DBG}" - "ZLIB_LIB=${ZLIB_LIBRARY_DBG}" - "PG_LIB=${PGSQL_LIBRARY_DBG} Secur32.lib Shell32.lib Advapi32.lib Crypt32.lib Gdi32.lib ${OPENSSL_LIBRARY_DBG}" - DEBUG=1 - ) - - # Begin build process - vcpkg_install_nmake( - SOURCE_PATH "${SOURCE_PATH}" - TARGET devinstall - OPTIONS_RELEASE + set(NATIVE_DATA_DIR "${CURRENT_PACKAGES_DIR}/share/gdal") + set(NATIVE_HTML_DIR "${CURRENT_PACKAGES_DIR}/share/gdal/html") + + include("${CMAKE_CURRENT_LIST_DIR}/dependency_win.cmake") + find_dependency_win() + + set(NMAKE_OPTIONS "") + set(NMAKE_OPTIONS_REL "") + set(NMAKE_OPTIONS_DBG "") + + if("mysql-libmysql" IN_LIST FEATURES OR "mysql-libmariadb" IN_LIST FEATURES) + list(APPEND NMAKE_OPTIONS "MYSQL_INC_DIR=${MYSQL_INCLUDE_DIR}") + list(APPEND NMAKE_OPTIONS_REL "MYSQL_LIB=${MYSQL_LIBRARY_REL}") + list(APPEND NMAKE_OPTIONS_DBG "MYSQL_LIB=${MYSQL_LIBRARY_DBG}") + endif() + + list(APPEND NMAKE_OPTIONS + "DATADIR=${NATIVE_DATA_DIR}" + "HTMLDIR=${NATIVE_HTML_DIR}" + "GEOS_DIR=${GEOS_INCLUDE_DIR}" + "GEOS_CFLAGS=-I${GEOS_INCLUDE_DIR} -DHAVE_GEOS" + "PROJ_INCLUDE=-I${PROJ_INCLUDE_DIR}" + "EXPAT_DIR=${EXPAT_INCLUDE_DIR}" + "EXPAT_INCLUDE=-I${EXPAT_INCLUDE_DIR}" + "CURL_INC=-I${CURL_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}" + OPENJPEG_VERSION=20100 + WEBP_ENABLED=YES + "WEBP_CFLAGS=-I${WEBP_INCLUDE_DIR}" + "LIBXML2_INC=-I${XML2_INCLUDE_DIR}" + PNG_EXTERNAL_LIB=1 + "PNGDIR=${PNG_INCLUDE_DIR}" + "ZLIB_INC=-I${ZLIB_INCLUDE_DIR}" + ZLIB_EXTERNAL_LIB=1 + ACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1 + MSVC_VER=1900 + ) + + if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + list(APPEND NMAKE_OPTIONS WIN64=YES) + endif() + + if (VCPKG_LIBRARY_LINKAGE STREQUAL "static") + list(APPEND NMAKE_OPTIONS CURL_CFLAGS=-DCURL_STATICLIB) + list(APPEND NMAKE_OPTIONS DLLBUILD=0) + list(APPEND NMAKE_OPTIONS "PROJ_FLAGS=-DPROJ_STATIC -DPROJ_VERSION=5") + else() + # Enables PDBs for release and debug builds + list(APPEND NMAKE_OPTIONS WITH_PDB=1) + list(APPEND NMAKE_OPTIONS DLLBUILD=1) + endif() + + if (VCPKG_CRT_LINKAGE STREQUAL "static") + set(LINKAGE_FLAGS "/MT") + else() + set(LINKAGE_FLAGS "/MD") + endif() + + list(APPEND NMAKE_OPTIONS_REL + ${NMAKE_OPTIONS} + "GDAL_HOME=${CURRENT_PACKAGES_DIR}" + "CXX_CRT_FLAGS=${LINKAGE_FLAGS}" + "PROJ_LIBRARY=${PROJ_LIBRARY_REL}" + "PNG_LIB=${PNG_LIBRARY_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} ${SPATIALITE_LIBRARY_REL}" + "OPENJPEG_LIB=${OPENJPEG_LIBRARY_REL}" + "WEBP_LIBS=${WEBP_LIBRARY_REL}" + "LIBXML2_LIB=${XML2_LIBRARY_REL} ${ICONV_LIBRARY_REL} ${LZMA_LIBRARY_REL}" + "ZLIB_LIB=${ZLIB_LIBRARY_REL}" + "PG_LIB=${PGSQL_LIBRARY_REL} Secur32.lib Shell32.lib Advapi32.lib Crypt32.lib Gdi32.lib ${OPENSSL_LIBRARY_REL}" + ) + + list(APPEND NMAKE_OPTIONS_DBG + ${NMAKE_OPTIONS} + "GDAL_HOME=${CURRENT_PACKAGES_DIR}/debug" + "CXX_CRT_FLAGS=${LINKAGE_FLAGS}d" + "PROJ_LIBRARY=${PROJ_LIBRARY_DBG}" + "PNG_LIB=${PNG_LIBRARY_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} ${SPATIALITE_LIBRARY_DBG}" + "OPENJPEG_LIB=${OPENJPEG_LIBRARY_DBG}" + "WEBP_LIBS=${WEBP_LIBRARY_DBG}" + "LIBXML2_LIB=${XML2_LIBRARY_DBG} ${ICONV_LIBRARY_DBG} ${LZMA_LIBRARY_DBG}" + "ZLIB_LIB=${ZLIB_LIBRARY_DBG}" + "PG_LIB=${PGSQL_LIBRARY_DBG} Secur32.lib Shell32.lib Advapi32.lib Crypt32.lib Gdi32.lib ${OPENSSL_LIBRARY_DBG}" + DEBUG=1 + ) + + if("tools" IN_LIST FEATURES) + list(APPEND NMAKE_OPTIONS_REL "BUILD_TOOLS=1") + else() + list(APPEND NMAKE_OPTIONS_REL "BUILD_TOOLS=0") + endif() + list(APPEND NMAKE_OPTIONS_DBG "BUILD_TOOLS=0") + + # Begin build process + vcpkg_install_nmake( + SOURCE_PATH "${SOURCE_PATH}" + TARGET devinstall + OPTIONS_RELEASE "${NMAKE_OPTIONS_REL}" - OPTIONS_DEBUG + OPTIONS_DEBUG "${NMAKE_OPTIONS_DBG}" - ) - - if(NOT VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/gdal/html") - endif() - - if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - set(GDAL_EXES - gdal_contour - gdal_create - gdal_grid - gdal_rasterize - gdal_translate - gdal_viewshed - gdaladdo - gdalbuildvrt - gdaldem - gdalenhance - gdalinfo - gdallocationinfo - gdalmanage - gdalmdiminfo - gdalmdimtranslate - gdalsrsinfo - gdaltindex - gdaltransform - gdalwarp - gnmanalyse - gnmmanage - nearblack - ogr2ogr - ogrinfo - ogrlineref - ogrtindex - testepsg - ) - vcpkg_copy_tools(TOOL_NAMES ${GDAL_EXES} AUTO_CLEAN) - else() - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") - endif() - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/share/gdal/html") - - vcpkg_copy_pdbs() - - if(NOT VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/gdal204.pdb") - endif() + ) + + if(NOT VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/gdal/html") + endif() + + if("tools" IN_LIST FEATURES) + set(GDAL_EXES + gdal_contour + gdal_create + gdal_grid + gdal_rasterize + gdal_translate + gdal_viewshed + gdaladdo + gdalbuildvrt + gdaldem + gdalenhance + gdalinfo + gdallocationinfo + gdalmanage + gdalmdiminfo + gdalmdimtranslate + gdalsrsinfo + gdaltindex + gdaltransform + gdalwarp + gnmanalyse + gnmmanage + nearblack + ogr2ogr + ogrinfo + ogrlineref + ogrtindex + testepsg + ) + # vcpkg_copy_tools removed the bin directories for us so no need to remove again + vcpkg_copy_tools(TOOL_NAMES ${GDAL_EXES} AUTO_CLEAN) + elseif(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") + endif() + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/share/gdal/html") + + vcpkg_copy_pdbs() + + if(NOT VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/gdal204.pdb") + endif() else() # See https://github.com/microsoft/vcpkg/issues/16990 file(TOUCH "${SOURCE_PATH}/config.rpath") - + set(CONF_OPTS --with-hide-internal-symbols=yes --with-perl=no --with-python=no --with-java=no - ) + ) set(CONF_CHECKS "") function(add_config option check) list(APPEND CONF_OPTS "${option}") @@ -299,7 +306,7 @@ else() --with-teigha=no --with-tiledb=no --with-xerces=no - ) + ) endif() # proj needs a C++ runtime library @@ -309,15 +316,22 @@ else() list(APPEND CONF_OPTS "--with-proj-extra-lib-for-test=-lstdc++") endif() + if("tools" IN_LIST FEATURES) + list(APPEND CONF_OPTS "--with-tools=yes") + else() + list(APPEND CONF_OPTS "--with-tools=no") + endif() + vcpkg_configure_make( SOURCE_PATH "${SOURCE_PATH}" AUTOCONFIG COPY_SOURCE OPTIONS - ${CONF_OPTS} + ${CONF_OPTS} OPTIONS_DEBUG - --enable-debug - ) + --enable-debug + --with-tools=no + ) # Verify configuration results (tightly coupled to vcpkg_configure_make) function(check_config logfile) @@ -341,12 +355,12 @@ else() endforeach() vcpkg_install_make(MAKEFILE GNUmakefile) - + file(REMOVE_RECURSE - "${CURRENT_PACKAGES_DIR}/lib/gdalplugins" - "${CURRENT_PACKAGES_DIR}/debug/lib/gdalplugins" - "${CURRENT_PACKAGES_DIR}/debug/share" - ) + "${CURRENT_PACKAGES_DIR}/lib/gdalplugins" + "${CURRENT_PACKAGES_DIR}/debug/lib/gdalplugins" + "${CURRENT_PACKAGES_DIR}/debug/share" + ) vcpkg_fixup_pkgconfig() set(pc_file_debug "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/gdal.pc") diff --git a/ports/gdal/vcpkg.json b/ports/gdal/vcpkg.json index 2bb7b63b114c34..12e83cb84d850b 100644 --- a/ports/gdal/vcpkg.json +++ b/ports/gdal/vcpkg.json @@ -1,7 +1,7 @@ { "name": "gdal", "version-semver": "3.2.2", - "port-version": 4, + "port-version": 5, "description": "The Geographic Data Abstraction Library for reading and writing geospatial raster and vector data", "homepage": "https://gdal.org", "supports": "!arm", @@ -47,6 +47,9 @@ "system-libraries": { "$supports": "!windows", "description": "Include drivers which need additional libraries" + }, + "tools": { + "description": "Builds gdal and ogr executables" } } } diff --git a/versions/baseline.json b/versions/baseline.json index 01a9c09aaebb72..654cbe96b6b052 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2270,7 +2270,7 @@ }, "gdal": { "baseline": "3.2.2", - "port-version": 4 + "port-version": 5 }, "gdcm": { "baseline": "3.0.7", diff --git a/versions/g-/gdal.json b/versions/g-/gdal.json index 762f3061eeb770..bf73dab76cd942 100644 --- a/versions/g-/gdal.json +++ b/versions/g-/gdal.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "3f821ae473a38c3ceac861552f560da4a9109ff8", + "version-semver": "3.2.2", + "port-version": 5 + }, { "git-tree": "b87df6a4a70bb9afb31992195a8ccc6e04d59663", "version-semver": "3.2.2",