aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2018-03-24 13:26:48 -0700
committerRobert Schumacher <roschuma@microsoft.com>2018-03-24 13:26:48 -0700
commit5ba45ffd9bb450da020e3694f38c78387d5270ec (patch)
tree46ab3e7e54ceec51f48cffc9e9e0c5bbdd703370
parente47f165146535e3c6cc21d62a3b7832ce029e02b (diff)
downloadvcpkg-5ba45ffd9bb450da020e3694f38c78387d5270ec.tar.gz
vcpkg-5ba45ffd9bb450da020e3694f38c78387d5270ec.zip
[shapelib] Add option to disable tests
-rw-r--r--ports/shapelib/CONTROL2
-rw-r--r--ports/shapelib/option-build-test.patch13
-rw-r--r--ports/shapelib/portfile.cmake25
3 files changed, 32 insertions, 8 deletions
diff --git a/ports/shapelib/CONTROL b/ports/shapelib/CONTROL
index 7d37eb8aa..57fbecb53 100644
--- a/ports/shapelib/CONTROL
+++ b/ports/shapelib/CONTROL
@@ -1,3 +1,3 @@
Source: shapelib
-Version: 1.4.1
+Version: 1.4.1-1
Description: Shapefile C Library is simple C API for reading and writing ESRI Shapefiles
diff --git a/ports/shapelib/option-build-test.patch b/ports/shapelib/option-build-test.patch
new file mode 100644
index 000000000..c91410f38
--- /dev/null
+++ b/ports/shapelib/option-build-test.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c3ef935..845ec06 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -148,7 +148,7 @@ set(executables
+ find_program(BASH_EXECUTABLE bash)
+ find_program(SED_EXECUTABLE sed)
+ if(BASH_EXECUTABLE AND SED_EXECUTABLE)
+- set(BUILD_TEST ON)
++ option(BUILD_TEST "" ON)
+ else(BASH_EXECUTABLE AND SED_EXECUTABLE)
+ message(STATUS "WARNING: sed or bash not available so disabling testing")
+ endif(BASH_EXECUTABLE AND SED_EXECUTABLE)
diff --git a/ports/shapelib/portfile.cmake b/ports/shapelib/portfile.cmake
index 0f2787689..eed76736f 100644
--- a/ports/shapelib/portfile.cmake
+++ b/ports/shapelib/portfile.cmake
@@ -11,10 +11,17 @@ vcpkg_download_distfile(ARCHIVE
)
vcpkg_extract_source_archive(${ARCHIVE})
+vcpkg_apply_patches(
+ SOURCE_PATH ${SOURCE_PATH}
+ PATCHES ${CMAKE_CURRENT_LIST_DIR}/option-build-test.patch
+)
+
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
- OPTIONS -DBUILD_TEST=OFF)
+ OPTIONS
+ -DBUILD_TEST=OFF
+)
vcpkg_install_cmake()
@@ -22,15 +29,19 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(GLOB EXES "${CURRENT_PACKAGES_DIR}/bin/*.exe")
-file(COPY ${EXES} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/shapelib)
-file(REMOVE ${EXES})
+if(EXES)
+ file(COPY ${EXES} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/shapelib)
+ file(REMOVE ${EXES})
+endif()
file(GLOB DEBUG_EXES "${CURRENT_PACKAGES_DIR}/debug/bin/*.exe")
-file(REMOVE ${DEBUG_EXES})
+if(DEBUG_EXES)
+ file(REMOVE ${DEBUG_EXES})
+endif()
-if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
- file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
- file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/shapelib)