-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[swig,gdal] New port #25
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e8af3f1
[swig] New port
m-kuhn cdcf154
Add gdal
m-kuhn 077343e
Add python bindings
m-kuhn 34ff7ad
Test gdal[python]
m-kuhn 508a0f0
Test
m-kuhn bef0566
[gdal] Fix install location
m-kuhn 4c77605
Add missing dependency
m-kuhn b880b4a
Fixup paths for testing python packages
m-kuhn 111eb41
Test numpy again
m-kuhn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
if(GDAL_USE_KEA) | ||
find_package(Kealib CONFIG REQUIRED) | ||
add_library(KEA::KEA ALIAS Kealib::Kealib) | ||
set(GDAL_CHECK_PACKAGE_KEA_NAMES Kealib CACHE INTERNAL "vcpkg") | ||
set(GDAL_CHECK_PACKAGE_KEA_TARGETS Kealib::Kealib CACHE INTERNAL "vcpkg") | ||
endif() | ||
|
||
if(GDAL_USE_WEBP) | ||
find_package(WebP CONFIG REQUIRED) | ||
add_library(WEBP::WebP ALIAS WebP::webp) | ||
set(GDAL_CHECK_PACKAGE_WebP_NAMES WebP CACHE INTERNAL "vcpkg") | ||
set(GDAL_CHECK_PACKAGE_WebP_TARGETS WebP::webp CACHE INTERNAL "vcpkg") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
diff --git a/cmake/modules/packages/FindFreeXL.cmake b/cmake/modules/packages/FindFreeXL.cmake | ||
index 6c86fb8..0634412 100644 | ||
--- a/cmake/modules/packages/FindFreeXL.cmake | ||
+++ b/cmake/modules/packages/FindFreeXL.cmake | ||
@@ -37,7 +37,15 @@ include(SelectLibraryConfigurations) | ||
|
||
find_package(PkgConfig QUIET) | ||
if(PKG_CONFIG_FOUND) | ||
- pkg_check_modules(PC_FREEXL QUIET freexl) | ||
+ pkg_check_modules(PC_FREEXL QUIET IMPORTED_TARGET freexl) | ||
+endif() | ||
+if(PC_FREEXL_FOUND) | ||
+ set(FREEXL_INCLUDE_DIR "${PC_FREEXL_INCLUDE_DIRS}" CACHE STRING "") | ||
+ set(FREEXL_LIBRARY "${PC_FREEXL_LIBRARIES}" CACHE STRING "") | ||
+ if(NOT TARGET FREEXL::freexl) | ||
+ add_library(FREEXL::freexl INTERFACE IMPORTED) | ||
+ set_target_properties(FREEXL::freexl PROPERTIES INTERFACE_LINK_LIBRARIES PkgConfig::PC_FREEXL) | ||
+ endif() | ||
endif() | ||
|
||
find_path(FREEXL_INCLUDE_DIR | ||
diff --git a/cmake/modules/packages/FindOpenJPEG.cmake b/cmake/modules/packages/FindOpenJPEG.cmake | ||
index c697484..6e83222 100644 | ||
--- a/cmake/modules/packages/FindOpenJPEG.cmake | ||
+++ b/cmake/modules/packages/FindOpenJPEG.cmake | ||
@@ -32,9 +32,18 @@ endfunction() | ||
|
||
find_package(PkgConfig QUIET) | ||
if(PKG_CONFIG_FOUND) | ||
- pkg_check_modules(PC_OPENJPEG QUIET libopenjp2) | ||
+ pkg_check_modules(PC_OPENJPEG QUIET IMPORTED_TARGET libopenjp2) | ||
set(OPENJPEG_VERSION_STRING ${PC_OPENJPEG_VERSION}) | ||
endif() | ||
+if(PC_OPENJPEG_FOUND) | ||
+ set(OPENJPEG_INCLUDE_DIR "${PC_OPENJPEG_INCLUDE_DIRS}" CACHE STRING "") | ||
+ set(OPENJPEG_LIBRARY "${PC_OPENJPEG_LIBRARIES}" CACHE STRING "") | ||
+ if(NOT TARGET OPENJPEG::OpenJPEG) | ||
+ add_library(OPENJPEG::OpenJPEG INTERFACE IMPORTED) | ||
+ set_target_properties(OPENJPEG::OpenJPEG PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${PC_OPENJPEG_INCLUDE_DIRS}") | ||
+ set_target_properties(OPENJPEG::OpenJPEG PROPERTIES INTERFACE_LINK_LIBRARIES PkgConfig::PC_OPENJPEG) | ||
+ endif() | ||
+endif() | ||
|
||
|
||
find_path(OPENJPEG_INCLUDE_DIR opj_config.h | ||
diff --git a/cmake/modules/packages/FindPoppler.cmake b/cmake/modules/packages/FindPoppler.cmake | ||
index 3807ec0..8059eb4 100644 | ||
--- a/cmake/modules/packages/FindPoppler.cmake | ||
+++ b/cmake/modules/packages/FindPoppler.cmake | ||
@@ -42,11 +42,19 @@ This module defines the following variables: | ||
|
||
find_package(PkgConfig QUIET) | ||
if(PKG_CONFIG_FOUND) | ||
- pkg_check_modules(PC_Poppler QUIET poppler) | ||
+ pkg_check_modules(PC_Poppler QUIET IMPORTED_TARGET poppler) | ||
if(PC_Poppler_VERSION) | ||
set(Poppler_VERSION_STRING ${PC_Poppler_VERSION}) | ||
endif() | ||
endif() | ||
+if(PC_Poppler_FOUND) | ||
+ find_path(Poppler_INCLUDE_DIR NAMES Object.h PATHS ${PC_Poppler_INCLUDE_DIRS} NO_DEFAULT_PATH) | ||
+ set(Poppler_LIBRARY "${PC_Poppler_LIBRARIES}" CACHE STRING "") | ||
+ if(NOT TARGET Poppler::Poppler) | ||
+ add_library(Poppler::Poppler INTERFACE IMPORTED) | ||
+ set_target_properties(Poppler::Poppler PROPERTIES INTERFACE_LINK_LIBRARIES PkgConfig::PC_Poppler) | ||
+ endif() | ||
+endif() | ||
find_path(Poppler_INCLUDE_DIR NAMES "poppler-config.h" "cpp/poppler-version.h" "qt5/poppler-qt5.h" "qt4/poppler-qt4.h" | ||
"glib/poppler.h" | ||
HINTS ${PC_Poppler_INCLUDE_DIRS} | ||
@@ -77,6 +85,15 @@ endforeach() | ||
foreach(_comp IN LISTS Poppler_known_components) | ||
list(FIND Poppler_FIND_COMPONENTS "${_comp}" _nextcomp) | ||
if(_nextcomp GREATER -1) | ||
+ pkg_check_modules(PC_Poppler_${_comp} QUIET IMPORTED_TARGET ${Poppler_${_comp}_pkg_config}) | ||
+ if(PC_Poppler_${_comp}_FOUND) | ||
+ set(Poppler_${_comp}_INCLUDE_DIR "${PC_Poppler_${_comp}_INCLUDE_DIRS}" CACHE STRING "") | ||
+ set(Poppler_${_comp}_LIBRARY "${PC_Poppler_${_comp}_LIBRARIES}" CACHE STRING "") | ||
+ if(NOT TARGET Poppler::Poppler_${_comp}) | ||
+ add_library(Poppler::${_comp} INTERFACE IMPORTED) | ||
+ set_target_properties(Poppler::${_comp} PROPERTIES INTERFACE_LINK_LIBRARIES PkgConfig::PC_Poppler_${_comp}) | ||
+ endif() | ||
+ endif() | ||
find_path(Poppler_${_comp}_INCLUDE_DIR | ||
NAMES ${Poppler_${_comp}_header} | ||
PATH_SUFFIXES poppler | ||
diff --git a/cmake/modules/packages/FindSPATIALITE.cmake b/cmake/modules/packages/FindSPATIALITE.cmake | ||
index 00612b0..6388719 100644 | ||
--- a/cmake/modules/packages/FindSPATIALITE.cmake | ||
+++ b/cmake/modules/packages/FindSPATIALITE.cmake | ||
@@ -38,9 +38,17 @@ endif() | ||
|
||
find_package(PkgConfig QUIET) | ||
if(PKG_CONFIG_FOUND) | ||
- pkg_check_modules(PC_SPATIALITE QUIET spatialite) | ||
+ pkg_check_modules(PC_SPATIALITE QUIET IMPORTED_TARGET spatialite) | ||
set(SPATIALITE_VERSION_STRING ${PC_SPATIALITE_VERSION}) | ||
endif() | ||
+if(PC_SPATIALITE_FOUND) | ||
+ set(SPATIALITE_INCLUDE_DIR "${PC_SPATIALITE_INCLUDE_DIRS}" CACHE STRING "") | ||
+ set(SPATIALITE_LIBRARY "${PC_SPATIALITE_LIBRARIES}" CACHE STRING "") | ||
+ if(NOT TARGET SPATIALITE::SPATIALITE) | ||
+ add_library(SPATIALITE::SPATIALITE INTERFACE IMPORTED) | ||
+ set_target_properties(SPATIALITE::SPATIALITE PROPERTIES INTERFACE_LINK_LIBRARIES PkgConfig::PC_SPATIALITE) | ||
+ endif() | ||
+endif() | ||
|
||
find_path(SPATIALITE_INCLUDE_DIR | ||
NAMES spatialite.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelper.cmake | ||
index 838f0fd..380e20d 100644 | ||
--- a/cmake/helpers/GdalDriverHelper.cmake | ||
+++ b/cmake/helpers/GdalDriverHelper.cmake | ||
@@ -248,6 +248,10 @@ function(gdal_target_interfaces _TARGET) | ||
if (_res) | ||
target_compile_options(${_TARGET} PRIVATE ${_res}) | ||
endif () | ||
+ get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_LINK_LIBRARIES) | ||
+ if (_res) | ||
+ gdal_target_interfaces(${_TARGET} ${_res}) | ||
+ endif () | ||
endif () | ||
endforeach () | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
diff --git a/cmake/modules/packages/FindLibKML.cmake b/cmake/modules/packages/FindLibKML.cmake | ||
index 9418247..589b83d 100644 | ||
--- a/cmake/modules/packages/FindLibKML.cmake | ||
+++ b/cmake/modules/packages/FindLibKML.cmake | ||
@@ -56,6 +56,8 @@ find_library(LIBKML_BASE_LIBRARY | ||
HINTS ${PC_LIBKML_LIBRARY_DIRS} ) | ||
mark_as_advanced(LIBKML_BASE_LIBRARY) | ||
|
||
+cmake_policy(PUSH) | ||
+cmake_policy(SET CMP0057 NEW) | ||
set(libkml_known_components DOM CONVENIENCE ENGINE REGIONATOR) | ||
foreach(_comp IN LISTS libkml_known_components) | ||
if(${_comp} IN_LIST LibKML_FIND_COMPONENTS) | ||
@@ -99,21 +101,20 @@ find_package_handle_standard_args(LibKML | ||
if(LIBKML_FOUND) | ||
set(LIBKML_INCLUDE_DIRS "${LIBKML_INCLUDE_DIR}") | ||
set(LIBKML_LIBRARIES "${LIBKML_BASE_LIBRARY}") | ||
+ find_package(LibKML CONFIG REQUIRED) | ||
if(NOT TARGET LIBKML::LibKML) | ||
- add_library(LIBKML::LibKML UNKNOWN IMPORTED) | ||
+ add_library(LIBKML::LibKML INTERFACE IMPORTED) | ||
set_target_properties(LIBKML::LibKML PROPERTIES | ||
- INTERFACE_INCLUDE_DIRECTORIES "${LIBKML_INCLUDE_DIR}" | ||
- IMPORTED_LINK_INTERFACE_LANGUAGES "C++" | ||
- IMPORTED_LOCATION "${LIBKML_BASE_LIBRARY}") | ||
+ INTERFACE_LINK_LIBRARIES kmlbase) | ||
endif() | ||
foreach(_comp IN LISTS libkml_known_components) | ||
if(${_comp} IN_LIST LibKML_FIND_COMPONENTS) | ||
+ string(TOLOWER ${_comp} _name) | ||
list(APPEND LIBKML_LIBRARIES "${LIBKML_${_comp}_LIBRARY}") | ||
if(NOT TARGET LIBKML::${_comp}) | ||
- add_library(LIBKML::${_comp} UNKNOWN IMPORTED) | ||
+ add_library(LIBKML::${_comp} INTERFACE IMPORTED) | ||
set_target_properties(LIBKML::${_comp} PROPERTIES | ||
- IMPORTED_LINK_INTERFACE_LANGUAGES "C++" | ||
- IMPORTED_LOCATION "${LIBKML_${_comp}_LIBRARY}") | ||
+ INTERFACE_LINK_LIBRARIES kml${_name}) | ||
endif() | ||
endif() | ||
endforeach() | ||
@@ -129,3 +130,4 @@ if(LIBKML_FOUND) | ||
endif() | ||
endforeach() | ||
endif() | ||
+cmake_policy(POP) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,190 @@ | ||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO OSGeo/gdal | ||
REF "v${VERSION}" | ||
SHA512 764490362968b05c0edc1c73c3b51b9a517689f95f0e3e3af141da8ef81614111859bbbf2a1571f047acfbd6ba50a16320ba15ed238cbd73732a960c718d5d50 | ||
HEAD_REF master | ||
PATCHES | ||
find-link-libraries.patch | ||
fix-gdal-target-interfaces.patch | ||
libkml.patch | ||
target-is-valid.patch | ||
) | ||
# `vcpkg clean` stumbles over one subdir | ||
file(REMOVE_RECURSE "${SOURCE_PATH}/autotest") | ||
|
||
# Avoid abseil, no matter if vcpkg or system | ||
vcpkg_replace_string("${SOURCE_PATH}/ogr/ogrsf_frmts/flatgeobuf/flatbuffers/base.h" [[__has_include("absl/strings/string_view.h")]] "(0)") | ||
|
||
# Cf. cmake/helpers/CheckDependentLibraries.cmake | ||
# The default for all `GDAL_USE_<PKG>` dependencies is `OFF`. | ||
# Here, we explicitly control dependencies provided via vpcpkg. | ||
# "core" is used for a dependency which must be enabled to avoid vendored lib. | ||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS | ||
FEATURES | ||
cfitsio GDAL_USE_CFITSIO | ||
curl GDAL_USE_CURL | ||
expat GDAL_USE_EXPAT | ||
freexl GDAL_USE_FREEXL | ||
geos GDAL_USE_GEOS | ||
core GDAL_USE_GEOTIFF | ||
gif GDAL_USE_GIF | ||
hdf5 GDAL_USE_HDF5 | ||
iconv GDAL_USE_ICONV | ||
jpeg GDAL_USE_JPEG | ||
core GDAL_USE_JSONC | ||
kea GDAL_USE_KEA | ||
lerc GDAL_USE_LERC | ||
libkml GDAL_USE_LIBKML | ||
lzma GDAL_USE_LIBLZMA | ||
libxml2 GDAL_USE_LIBXML2 | ||
mysql-libmariadb GDAL_USE_MYSQL | ||
netcdf GDAL_USE_NETCDF | ||
odbc GDAL_USE_ODBC | ||
openjpeg GDAL_USE_OPENJPEG | ||
openssl GDAL_USE_OPENSSL | ||
pcre2 GDAL_USE_PCRE2 | ||
png GDAL_USE_PNG | ||
poppler GDAL_USE_POPPLER | ||
postgresql GDAL_USE_POSTGRESQL | ||
qhull GDAL_USE_QHULL | ||
#core GDAL_USE_SHAPELIB # https://github.com/OSGeo/gdal/issues/5711, https://github.com/microsoft/vcpkg/issues/16041 | ||
core GDAL_USE_SHAPELIB_INTERNAL | ||
libspatialite GDAL_USE_SPATIALITE | ||
sqlite3 GDAL_USE_SQLITE3 | ||
core GDAL_USE_TIFF | ||
webp GDAL_USE_WEBP | ||
core GDAL_USE_ZLIB | ||
zstd GDAL_USE_ZSTD | ||
python BUILD_PYTHON_BINDINGS | ||
tools BUILD_APPS | ||
INVERTED_FEATURES | ||
libspatialite CMAKE_DISABLE_FIND_PACKAGE_SPATIALITE | ||
) | ||
if(GDAL_USE_ICONV AND VCPKG_TARGET_IS_WINDOWS) | ||
list(APPEND FEATURE_OPTIONS -D_ICONV_SECOND_ARGUMENT_IS_NOT_CONST=ON) | ||
endif() | ||
|
||
# Compatibility with older Android versions https://github.com/OSGeo/gdal/pull/5941 | ||
if(VCPKG_TARGET_IS_ANDROID AND ANRDOID_PLATFORM VERSION_LESS 24 AND (VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")) | ||
list(APPEND FEATURE_OPTIONS -DBUILD_WITHOUT_64BIT_OFFSET=ON) | ||
endif() | ||
|
||
string(REPLACE "dynamic" "" qhull_target "Qhull::qhull${VCPKG_LIBRARY_LINKAGE}_r") | ||
|
||
vcpkg_cmake_configure( | ||
SOURCE_PATH "${SOURCE_PATH}" | ||
OPTIONS | ||
-DVCPKG_HOST_TRIPLET=${HOST_TRIPLET} # for host pkgconf in PATH | ||
${FEATURE_OPTIONS} | ||
-DBUILD_DOCS=OFF | ||
-DBUILD_TESTING=OFF | ||
-DCMAKE_DISABLE_FIND_PACKAGE_CSharp=ON | ||
-DCMAKE_DISABLE_FIND_PACKAGE_Java=ON | ||
-DCMAKE_DISABLE_FIND_PACKAGE_JNI=ON | ||
# -DCMAKE_DISABLE_FIND_PACKAGE_SWIG=ON | ||
-DCMAKE_DISABLE_FIND_PACKAGE_Arrow=ON | ||
-DGDAL_USE_INTERNAL_LIBS=OFF | ||
-DGDAL_USE_EXTERNAL_LIBS=OFF | ||
-DGDAL_BUILD_OPTIONAL_DRIVERS=ON | ||
-DOGR_BUILD_OPTIONAL_DRIVERS=ON | ||
-DFIND_PACKAGE2_KEA_ENABLED=OFF | ||
-DGDAL_CHECK_PACKAGE_MySQL_NAMES=unofficial-libmariadb | ||
-DGDAL_CHECK_PACKAGE_MySQL_TARGETS=unofficial::libmariadb | ||
-DMYSQL_LIBRARIES=unofficial::libmariadb | ||
-DGDAL_CHECK_PACKAGE_NetCDF_NAMES=netCDF | ||
-DGDAL_CHECK_PACKAGE_NetCDF_TARGETS=netCDF::netcdf | ||
-DGDAL_CHECK_PACKAGE_QHULL_NAMES=Qhull | ||
"-DGDAL_CHECK_PACKAGE_QHULL_TARGETS=${qhull_target}" | ||
"-DQHULL_LIBRARY=${qhull_target}" | ||
"-DSWIG_DIR=${CURRENT_HOST_INSTALLED_DIR}/tools/swig" | ||
"-DSWIG_EXECUTABLE=${CURRENT_HOST_INSTALLED_DIR}/tools/swig/swig${VCPKG_HOST_EXECUTABLE_SUFFIX}" | ||
"-DCMAKE_PROJECT_INCLUDE=${CMAKE_CURRENT_LIST_DIR}/cmake-project-include.cmake" | ||
OPTIONS_DEBUG | ||
-DBUILD_APPS=OFF | ||
"-DGDAL_DEBUG_POSTFIX=" | ||
MAYBE_UNUSED_VARIABLES | ||
QHULL_LIBRARY | ||
) | ||
vcpkg_cmake_install() | ||
vcpkg_copy_pdbs() | ||
vcpkg_fixup_pkgconfig() | ||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/gdal) | ||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/gdal/GDALConfig.cmake" | ||
"include(CMakeFindDependencyMacro)" | ||
"include(CMakeFindDependencyMacro) | ||
# gdal needs a pkg-config tool. A host dependency provides pkgconf. | ||
get_filename_component(vcpkg_host_prefix \"\${CMAKE_CURRENT_LIST_DIR}/../../../${HOST_TRIPLET}\" ABSOLUTE) | ||
list(APPEND CMAKE_PROGRAM_PATH \"\${vcpkg_host_prefix}/tools/pkgconf\")" | ||
) | ||
|
||
if (BUILD_APPS) | ||
vcpkg_copy_tools( | ||
TOOL_NAMES | ||
gdal_contour | ||
gdal_create | ||
gdal_footprint | ||
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 | ||
sozip | ||
AUTO_CLEAN | ||
) | ||
endif() | ||
|
||
file(REMOVE_RECURSE | ||
"${CURRENT_PACKAGES_DIR}/debug/include" | ||
"${CURRENT_PACKAGES_DIR}/debug/share" | ||
) | ||
|
||
file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/gdal-config" "${CURRENT_PACKAGES_DIR}/debug/bin/gdal-config") | ||
|
||
file(GLOB bin_files "${CURRENT_PACKAGES_DIR}/bin/*") | ||
if(NOT bin_files) | ||
file(REMOVE_RECURSE | ||
"${CURRENT_PACKAGES_DIR}/bin" | ||
"${CURRENT_PACKAGES_DIR}/debug/bin" | ||
) | ||
endif() | ||
|
||
if("python" IN_LIST FEATURES) | ||
file(REMOVE_RECURSE | ||
"${CURRENT_PACKAGES_DIR}/debug/Lib" | ||
"${CURRENT_PACKAGES_DIR}/debug/Scripts" | ||
) | ||
file(COPY "${CURRENT_PACKAGES_DIR}/Lib/site-packages/" DESTINATION "${CURRENT_PACKAGES_DIR}/${PYTHON3_SITE}") | ||
# TODO: Generalize for non windows | ||
file(COPY "${CURRENT_PACKAGES_DIR}/Scripts" DESTINATION "${CURRENT_PACKAGES_DIR}/${PYTHON3_SITE}/../../Scripts") | ||
file(REMOVE_RECURSE | ||
"${CURRENT_PACKAGES_DIR}/Lib/site-packages" | ||
"${CURRENT_PACKAGES_DIR}/Scripts" | ||
) | ||
vcpkg_python_test_import(MODULE "osgeo.gdal") | ||
endif() | ||
|
||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/cpl_config.h" "#define GDAL_PREFIX \"${CURRENT_PACKAGES_DIR}\"" "") | ||
|
||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") | ||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") | ||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.TXT") |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is certainly a hack, ideally we would convince setuptools to install into the proper prefix
tools/python3
in the package directory, right now it installs into the root of the package directory. https://github.com/OSGeo/gdal/blob/a8a0fd5e526f664212dcca3204c686c768cbcc3d/swig/python/CMakeLists.txt#L207 Is where it's invoked.Also, the current (hacky) destination for scripts is handcoded, relative to PYTHON3_SITE which is brittle too.