[tiff] Make BUILD_TOOLS option a feature (#9010)

* [tiff] Make BUILD_TOOLS option a feature

* [tiff] Fix tool-feature for static linkage
This commit is contained in:
Raynor Vliegendhart 2019-11-22 02:00:19 +01:00 committed by Robert Schumacher
parent b12c4501d8
commit 90a40c6658
2 changed files with 21 additions and 2 deletions

View File

@ -1,5 +1,8 @@
Source: tiff
Version: 4.0.10-7
Version: 4.0.10-8
Build-Depends: zlib, libjpeg-turbo, liblzma
Homepage: https://download.osgeo.org/libtiff
Description: A library that supports the manipulation of TIFF image files
Feature: tool
Description: Build tools

View File

@ -21,11 +21,15 @@ if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" OR VCPKG_TARGET_ARCHITECTURE STREQ
set (TIFF_CXX_TARGET -Dcxx=OFF)
endif()
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
tool BUILD_TOOLS
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DBUILD_TOOLS=OFF
${FEATURE_OPTIONS}
-DBUILD_DOCS=OFF
-DBUILD_CONTRIB=OFF
-DBUILD_TESTS=OFF
@ -50,4 +54,16 @@ file(REMOVE_RECURSE
file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/tiff)
file(INSTALL ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/tiff RENAME copyright)
if ("tool" IN_LIST FEATURES)
file(GLOB TIFF_TOOLS ${CURRENT_PACKAGES_DIR}/bin/*.exe)
file(INSTALL ${TIFF_TOOLS} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
file(REMOVE ${TIFF_TOOLS})
file(GLOB TIFF_TOOLS ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe)
file(REMOVE ${TIFF_TOOLS})
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()
endif()
vcpkg_copy_pdbs()