aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi Miura <miurahr@linux.com>2018-02-09 13:29:00 +0900
committerHiroshi Miura <miurahr@linux.com>2018-02-09 13:29:00 +0900
commitfc888e46178675bb708448f24cb07a72b13d7cd1 (patch)
treef46fe2b265c5e9f557e07402774a51f46c753603
parentf68711ed02ac2041f8760c8dc32b9b3804422189 (diff)
downloadvcpkg-fc888e46178675bb708448f24cb07a72b13d7cd1.tar.gz
vcpkg-fc888e46178675bb708448f24cb07a72b13d7cd1.zip
fix tiff detection error when static build
-rw-r--r--ports/libgeotiff/fix-cmake-tiff-detection.patch21
-rw-r--r--ports/libgeotiff/portfile.cmake7
2 files changed, 27 insertions, 1 deletions
diff --git a/ports/libgeotiff/fix-cmake-tiff-detection.patch b/ports/libgeotiff/fix-cmake-tiff-detection.patch
new file mode 100644
index 000000000..166aa7d44
--- /dev/null
+++ b/ports/libgeotiff/fix-cmake-tiff-detection.patch
@@ -0,0 +1,21 @@
+--- a/CMakeLists.txt 2016-08-12 00:40:12.000000000 +0900
++++ b/CMakeLists.txt 2018-02-09 13:27:05.721561755 +0900
+@@ -192,7 +192,8 @@
+ IF(TIFF_FOUND)
+ # Confirm required API is available
+ INCLUDE(CheckFunctionExists)
+- SET(CMAKE_REQUIRED_LIBRARIES ${TIFF_LIBRARIES})
++ FIND_PACKAGE(LibLZMA)
++ SET(CMAKE_REQUIRED_LIBRARIES ${TIFF_LIBRARIES} ${ZLIB_LIBRARIES} ${JPEG_LIBRARIES} ${LIBLZMA_LIBRARIES})
+
+ CHECK_FUNCTION_EXISTS(TIFFOpen HAVE_TIFFOPEN)
+ IF(NOT HAVE_TIFFOPEN)
+@@ -205,7 +206,7 @@
+ SET(TIFF_FOUND) # ReSET to NOT found for TIFF library
+ MESSAGE(FATAL_ERROR "Failed to link with libtiff - TIFFMergeFieldInfo function not found. libtiff 3.6.0 Beta or later required. Please upgrade or use an older version of libgeotiff")
+ ENDIF()
+-
++ SET(CMAKE_REQUIRED_LIBRARIES)
+ INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIR})
+ ADD_DEFINITIONS(-DHAVE_TIFF=1)
+ ENDIF(TIFF_FOUND)
diff --git a/ports/libgeotiff/portfile.cmake b/ports/libgeotiff/portfile.cmake
index 5920a0853..b974ebc35 100644
--- a/ports/libgeotiff/portfile.cmake
+++ b/ports/libgeotiff/portfile.cmake
@@ -13,7 +13,8 @@ vcpkg_extract_source_archive(${ARCHIVE})
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
- PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-directory-output.patch")
+ PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-directory-output.patch"
+ "${CMAKE_CURRENT_LIST_DIR}/fix-cmake-tiff-detection.patch")
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
set(BUILD_SHARED_LIBS ON)
@@ -26,6 +27,10 @@ vcpkg_configure_cmake(
PREFER_NINJA
OPTIONS -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
-DWITH_UTILITIES=OFF
+ -DWITH_TIFF=ON
+ -DWITH_PROJ4=ON
+ -DWITH_ZLIB=ON
+ -DWITH_JPEG=ON
)
vcpkg_build_cmake()