fix tiff detection error when static build

This commit is contained in:
Hiroshi Miura 2018-02-09 13:29:00 +09:00
parent f68711ed02
commit fc888e4617
2 changed files with 27 additions and 1 deletions

View File

@ -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)

View File

@ -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()