Skip to content

Commit

Permalink
[libgeotiff] Fix packagename via find_package (#15750)
Browse files Browse the repository at this point in the history
* [libgeotiff] Fix packagename via find_package

* Update port_versions

* Update portfile.cmake

* Update patch

* [libgeotiff] Fix packagename via find_package

* Update port_versions

* Update patch

* [pdal] Fix geotiff package name

* Update versions

* [pdal] Update dependency

* Update versions/p-/pdal.json
  • Loading branch information
NancyLi1013 authored Jan 29, 2021
1 parent db66cbe commit 82a9a84
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 17 deletions.
1 change: 1 addition & 0 deletions ports/libgeotiff/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Source: libgeotiff
Version: 1.6.0
Port-Version: 1
Homepage: https://github.com/OSGeo/libgeotiff
Description: Libgeotiff is an open source library normally hosted on top of libtiff for reading, and writing GeoTIFF information tags.
Build-Depends: tiff, proj4, zlib, libjpeg-turbo
2 changes: 1 addition & 1 deletion ports/libgeotiff/cmakelists.patch
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ index 47a2b00..3809ba3 100644
set (PROJECT_ROOT_DIR "..")
endif ()
+else()
+ set (INSTALL_CMAKE_DIR "share/${PROJECT_NAME}")
+ set (INSTALL_CMAKE_DIR "share/${PROJECT_NAME_LOWER}")
+ set (PROJECT_ROOT_DIR "../..")
+endif()

Expand Down
21 changes: 21 additions & 0 deletions ports/libgeotiff/fix-config-version.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/libgeotiff/cmake/project-config-version.cmake.in b/libgeotiff/cmake/project-config-version.cmake.in
index d695aa2..efe32ba 100644
--- a/libgeotiff/cmake/project-config-version.cmake.in
+++ b/libgeotiff/cmake/project-config-version.cmake.in
@@ -5,14 +5,14 @@ set (PACKAGE_VERSION_MAJOR "@PROJECT_VERSION_MAJOR@")
set (PACKAGE_VERSION_MINOR "@PROJECT_VERSION_MINOR@")
set (PACKAGE_VERSION_PATCH "@PROJECT_VERSION_PATCH@")

-if (NOT PACKAGE_FIND_NAME STREQUAL "@PROJECT_NAME@")
+if (NOT PACKAGE_FIND_NAME STREQUAL "@PROJECT_NAME_LOWER@")
# Check package name (in particular, because of the way cmake finds
# package config files, the capitalization could easily be "wrong").
# This is necessary to ensure that the automatically generated
# variables, e.g., <package>_FOUND, are consistently spelled. Make
# this a WARNING, because this is a user error that needs to be fixed.
message (WARNING
- "Mismatched package names: use find_package(@PROJECT_NAME@ ...) instead"
+ "Mismatched package names: use find_package(@PROJECT_NAME_LOWER@ ...) instead"
" of find_package(${PACKAGE_FIND_NAME} ...)")
set (PACKAGE_VERSION_UNSUITABLE TRUE)
elseif (NOT (APPLE OR CMAKE_SIZEOF_VOID_P EQUAL @CMAKE_SIZEOF_VOID_P@))
5 changes: 3 additions & 2 deletions ports/libgeotiff/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ vcpkg_from_github(
geotiff-config.patch
fix-proj4.patch
fix-staticbuild.patch
fix-config-version.patch
)

set(SOURCE_PATH ${SOURCE_PATH}/libgeotiff)
Expand All @@ -32,10 +33,10 @@ vcpkg_install_cmake()
vcpkg_copy_tools(TOOL_NAMES applygeo geotifcp listgeo makegeo AUTO_CLEAN)

vcpkg_copy_pdbs()
vcpkg_fixup_cmake_targets(CONFIG_PATH share/GeoTIFF TARGET_PATH share/GeoTIFF)
vcpkg_fixup_cmake_targets(CONFIG_PATH share/geotiff TARGET_PATH share/geotiff)

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/GeoTIFF/geotiff-config.cmake "if (GeoTIFF_USE_STATIC_LIBS)" "if (1)")
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/geotiff/geotiff-config.cmake "if (GeoTIFF_USE_STATIC_LIBS)" "if (1)")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin ${CURRENT_PACKAGES_DIR}/bin)
endif()

Expand Down
2 changes: 1 addition & 1 deletion ports/liblas/CONTROL
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Source: liblas
Version: 1.8.1
Port-Version: 5
Port-Version: 6
Build-Depends: boost, boost-thread, boost-system, boost-iostreams, boost-filesystem, boost-detail, libgeotiff
Description: A C/C++ library for reading and writing the very common LAS LiDAR format.

Expand Down
2 changes: 1 addition & 1 deletion ports/liblas/fix-geotiff.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ index d246a88..d0bba6f 100644
set(WITH_GEOTIFF TRUE CACHE BOOL "Choose if GeoTIFF support should be built")

-find_package (GeoTIFF 1.3.0 )
+find_package (GeoTIFF CONFIG 1.3.0 )
+find_package (geotiff CONFIG REQUIRED)
if(GEOTIFF_FOUND)
set(WITH_GEOTIFF TRUE)
# Confirm required API is available
Expand Down
2 changes: 1 addition & 1 deletion ports/pdal/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: pdal
Version: 1.7.1
Port-Version: 10
Port-Version: 11
Description: PDAL - Point Data Abstraction Library is a library for manipulating point cloud data.
Build-Depends: gdal, geos, jsoncpp, libgeotiff, laszip, boost-system, boost-filesystem
2 changes: 1 addition & 1 deletion ports/pdal/fix-dependency.patch
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ index a03ef14..9d073e6 100644
endforeach(_dir)

+include(CMakeFindDependencyMacro)
+find_dependency(GeoTIFF)
+find_dependency(geotiff)
+find_dependency(CURL)
+find_dependency(Boost COMPONENTS system filesystem)
+find_dependency(geos CONFIG)
Expand Down
15 changes: 15 additions & 0 deletions ports/pdal/geotiff.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/cmake/geotiff.cmake b/cmake/geotiff.cmake
index 1d1e8af..ec077bc 100644
--- a/cmake/geotiff.cmake
+++ b/cmake/geotiff.cmake
@@ -2,8 +2,8 @@
# GeoTIFF support
#

-find_package(GeoTIFF REQUIRED 1.3.0)
-set_package_properties(GeoTIFF PROPERTIES TYPE REQUIRED)
+find_package(geotiff REQUIRED 1.3.0)
+set_package_properties(geotiff PROPERTIES TYPE REQUIRED)
if (GEOTIFF_FOUND)
include_directories("${GEOTIFF_INCLUDE_DIR}")
set(PDAL_HAVE_LIBGEOTIFF 1)
9 changes: 2 additions & 7 deletions ports/pdal/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ vcpkg_extract_source_archive_ex(
libpq.patch
fix-CPL_DLL.patch
0004-fix-const-overloaded.patch
geotiff.patch
)

file(REMOVE "${SOURCE_PATH}/pdal/gitsha.cpp")
Expand All @@ -32,13 +33,7 @@ foreach(_module IN ITEMS FindGEOS) # Overwritten Modules.
)
endforeach()

if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
set(VCPKG_BUILD_SHARED_LIBS ON)
set(VCPKG_BUILD_STATIC_LIBS OFF)
else()
set(VCPKG_BUILD_SHARED_LIBS OFF)
set(VCPKG_BUILD_STATIC_LIBS ON)
endif()
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" VCPKG_BUILD_STATIC_LIBS)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
Expand Down
6 changes: 3 additions & 3 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2966,7 +2966,7 @@
},
"libgeotiff": {
"baseline": "1.6.0",
"port-version": 0
"port-version": 1
},
"libgit2": {
"baseline": "1.1.0",
Expand Down Expand Up @@ -3062,7 +3062,7 @@
},
"liblas": {
"baseline": "1.8.1",
"port-version": 5
"port-version": 6
},
"liblbfgs": {
"baseline": "1.10",
Expand Down Expand Up @@ -4474,7 +4474,7 @@
},
"pdal": {
"baseline": "1.7.1",
"port-version": 10
"port-version": 11
},
"pdal-c": {
"baseline": "1.8-2",
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/libgeotiff.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "413293d224293f65999b988ba07734ad78793405",
"version-string": "1.6.0",
"port-version": 1
},
{
"git-tree": "66eb337495fb9ac5d8cfdb96195b5d1c063088b6",
"version-string": "1.6.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/liblas.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "98b46cc84b9efb95b95bfa0111c22e59a4d9e477",
"version-string": "1.8.1",
"port-version": 6
},
{
"git-tree": "3574373c93114a9a7bac598140a5a7c875830b4c",
"version-string": "1.8.1",
Expand Down
5 changes: 5 additions & 0 deletions versions/p-/pdal.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "b6a58e13d646cb435d82143c23a3e9e8f54f495e",
"version-string": "1.7.1",
"port-version": 11
},
{
"git-tree": "e8b9d999c233cc564ff9eac48cf8e1d9b3094f1b",
"version-string": "1.7.1",
Expand Down

0 comments on commit 82a9a84

Please sign in to comment.