aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-02-27 23:23:23 -0800
committerRobert Schumacher <roschuma@microsoft.com>2017-02-27 23:23:23 -0800
commit20c92a800ff3e89641abff80b7b5ef828e43b0c6 (patch)
treeeb667742ebc1b8cc8598328979ed2a43126084f2
parent2d3fa9d7f4f101be62e5ff54885982e8f49ac099 (diff)
downloadvcpkg-20c92a800ff3e89641abff80b7b5ef828e43b0c6.tar.gz
vcpkg-20c92a800ff3e89641abff80b7b5ef828e43b0c6.zip
[szip] Change default component to match build type
-rw-r--r--ports/szip/CONTROL2
-rw-r--r--ports/szip/default-component-shared.patch37
-rw-r--r--ports/szip/portfile.cmake1
3 files changed, 39 insertions, 1 deletions
diff --git a/ports/szip/CONTROL b/ports/szip/CONTROL
index cabcb582b..acc364810 100644
--- a/ports/szip/CONTROL
+++ b/ports/szip/CONTROL
@@ -1,3 +1,3 @@
Source: szip
-Version: 2.1
+Version: 2.1-1
Description: Szip compression software, providing lossless compression of scientific data
diff --git a/ports/szip/default-component-shared.patch b/ports/szip/default-component-shared.patch
new file mode 100644
index 000000000..3db94c503
--- /dev/null
+++ b/ports/szip/default-component-shared.patch
@@ -0,0 +1,37 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d4163a0..4e2a312 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -267,6 +267,14 @@ set (SZIP_VERSION_MAJOR ${SZIP_PACKAGE_VERSION_MAJOR})
+ set (SZIP_VERSION_MINOR ${SZIP_PACKAGE_VERSION_MINOR})
+
+ #-----------------------------------------------------------------------------
++# Set default component
++#-----------------------------------------------------------------------------
++set (SZIP_DEFAULT_COMPONENT static)
++if (BUILD_SHARED_LIBS)
++ set (SZIP_DEFAULT_COMPONENT shared)
++endif ()
++
++#-----------------------------------------------------------------------------
+ # Configure the szip-config.cmake file for the build directory
+ #-----------------------------------------------------------------------------
+ set(INCLUDE_INSTALL_DIR ${SZIP_INSTALL_INCLUDE_DIR} )
+diff --git a/config/cmake/szip-config.cmake.in b/config/cmake/szip-config.cmake.in
+index 4a7fec7..ad54287 100644
+--- a/config/cmake/szip-config.cmake.in
++++ b/config/cmake/szip-config.cmake.in
+@@ -37,10 +37,10 @@ if (NOT TARGET "@SZIP_PACKAGE@")
+ include (@PACKAGE_SHARE_INSTALL_DIR@/@SZIP_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake)
+ endif ()
+
+-# Handle default component(static) :
++# Handle default component(@SZIP_DEFAULT_COMPONENT@) :
+ if (NOT ${SZIP_PACKAGE_NAME}_FIND_COMPONENTS)
+- set (${SZIP_PACKAGE_NAME}_FIND_COMPONENTS static)
+- set (${SZIP_PACKAGE_NAME}_FIND_REQUIRED_static true)
++ set (${SZIP_PACKAGE_NAME}_FIND_COMPONENTS @SZIP_DEFAULT_COMPONENT@)
++ set (${SZIP_PACKAGE_NAME}_FIND_REQUIRED_@SZIP_DEFAULT_COMPONENT@ true)
+ endif ()
+
+ # Handle requested components:
diff --git a/ports/szip/portfile.cmake b/ports/szip/portfile.cmake
index 06040cedc..0edee4dc4 100644
--- a/ports/szip/portfile.cmake
+++ b/ports/szip/portfile.cmake
@@ -25,6 +25,7 @@ vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
${CMAKE_CURRENT_LIST_DIR}/disable-static-lib-in-shared-build.patch
+ ${CMAKE_CURRENT_LIST_DIR}/default-component-shared.patch
)
vcpkg_configure_cmake(