[shapelib] Add option to disable tests

This commit is contained in:
Robert Schumacher 2018-03-24 13:26:48 -07:00
parent e47f165146
commit 5ba45ffd9b
3 changed files with 32 additions and 8 deletions

View File

@ -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

View File

@ -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)

View File

@ -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)