Skip to content

Commit

Permalink
[tiff] Make BUILD_TOOLS option a feature (microsoft#9010)
Browse files Browse the repository at this point in the history
* [tiff] Make BUILD_TOOLS option a feature

* [tiff] Fix tool-feature for static linkage
  • Loading branch information
ShinNoNoir authored and ras0219-msft committed Nov 22, 2019
1 parent b12c450 commit 90a40c6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
5 changes: 4 additions & 1 deletion ports/tiff/CONTROL
Original file line number Diff line number Diff line change
@@ -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
18 changes: 17 additions & 1 deletion ports/tiff/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()

0 comments on commit 90a40c6

Please sign in to comment.