aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2016-11-10 17:52:19 -0800
committerRobert Schumacher <roschuma@microsoft.com>2016-11-10 17:52:19 -0800
commitbb0fc030d5ea0c0d872b0446e43e28ae927d6885 (patch)
treee2dabee284b46e6bb1f13e8741f744bd35421c04
parent7220f54e302ce4792868c4ff59b8146c54d2e88c (diff)
downloadvcpkg-bb0fc030d5ea0c0d872b0446e43e28ae927d6885.tar.gz
vcpkg-bb0fc030d5ea0c0d872b0446e43e28ae927d6885.zip
[tiff] Disable non-essential components. Fixes #259.
-rw-r--r--ports/tiff/add-component-options.patch43
-rw-r--r--ports/tiff/portfile.cmake28
2 files changed, 56 insertions, 15 deletions
diff --git a/ports/tiff/add-component-options.patch b/ports/tiff/add-component-options.patch
new file mode 100644
index 000000000..513d37ad6
--- /dev/null
+++ b/ports/tiff/add-component-options.patch
@@ -0,0 +1,43 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 1ee6fd4..439e26a 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -122,6 +122,11 @@ set(EXTRA_DIST
+ nmake.opt
+ libtiff-4.pc.in)
+
++option(BUILD_TOOLS "Build tool executables" ON)
++option(BUILD_DOCS "Build docs" ON)
++option(BUILD_CONTRIB "Build contributed executables" ON)
++option(BUILD_TESTS "Build tests" ON)
++
+ # These are annoyingly verbose, produce false positives or don't work
+ # nicely with all supported compiler versions, so are disabled unless
+ # explicitly enabled.
+@@ -719,12 +724,20 @@ endif()
+ # Process subdirectories
+ add_subdirectory(port)
+ add_subdirectory(libtiff)
+-add_subdirectory(tools)
+-add_subdirectory(test)
+-add_subdirectory(contrib)
+-add_subdirectory(build)
+-add_subdirectory(man)
+-add_subdirectory(html)
++if(BUILD_TOOLS)
++ add_subdirectory(tools)
++endif()
++if(BUILD_TESTS)
++ add_subdirectory(test)
++endif()
++if(BUILD_CONTRIB)
++ add_subdirectory(contrib)
++endif()
++if(BUILD_DOCS)
++ add_subdirectory(build)
++ add_subdirectory(man)
++ add_subdirectory(html)
++endif()
+
+ #message(STATUS "EXTRA_DIST: ${EXTRA_DIST}")
+
diff --git a/ports/tiff/portfile.cmake b/ports/tiff/portfile.cmake
index 6a6701caa..f9137601a 100644
--- a/ports/tiff/portfile.cmake
+++ b/ports/tiff/portfile.cmake
@@ -7,9 +7,19 @@ vcpkg_download_distfile(ARCHIVE
)
vcpkg_extract_source_archive(${ARCHIVE})
+vcpkg_apply_patches(
+ SOURCE_PATH ${SOURCE_PATH}
+ PATCHES add-component-options.patch
+)
+
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
- OPTIONS -Dcxx=OFF
+ OPTIONS
+ -Dcxx=OFF
+ -DBUILD_TOOLS=OFF
+ -DBUILD_DOCS=OFF
+ -DBUILD_CONTRIB=OFF
+ -DBUILD_TESTS=OFF
)
vcpkg_install_cmake()
@@ -19,22 +29,10 @@ file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/debug/share
${CURRENT_PACKAGES_DIR}/share
)
-file(COPY
+file(INSTALL
${SOURCE_PATH}/COPYRIGHT
DESTINATION ${CURRENT_PACKAGES_DIR}/share/tiff
+ RENAME copyright
)
-file(RENAME
- ${CURRENT_PACKAGES_DIR}/share/tiff/COPYRIGHT
- ${CURRENT_PACKAGES_DIR}/share/tiff/c2
-)
-file(RENAME
- ${CURRENT_PACKAGES_DIR}/share/tiff/c2
- ${CURRENT_PACKAGES_DIR}/share/tiff/copyright
-)
-file(GLOB EXES ${CURRENT_PACKAGES_DIR}/bin/*.exe ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe)
-file(REMOVE ${EXES})
-if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
- file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
-endif()
vcpkg_copy_pdbs()