[xerces-c] Avoid building executables (#4576)

This commit is contained in:
Robert Schumacher 2018-11-01 19:47:20 -07:00 committed by GitHub
parent a589f9f9ed
commit cc3fae8e5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 11 deletions

View File

@ -1,3 +1,3 @@
Source: xerces-c
Version: 3.2.2-4
Version: 3.2.2-5
Description: Xerces-C++ is a XML parser, for parsing, generating, manipulating, and validating XML documents using the DOM, SAX, and SAX2 APIs.

View File

@ -0,0 +1,21 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4254f89..aa08565 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -175,10 +175,16 @@ install(
COMPONENT "development")
# Process subdirectories
+if(NOT DISABLE_DOC)
add_subdirectory(doc)
+endif()
add_subdirectory(src)
+if(NOT DISABLE_TESTS)
add_subdirectory(tests)
+endif()
+if(NOT DISABLE_SAMPLES)
add_subdirectory(samples)
+endif()
# Display configuration summary
message(STATUS "")

View File

@ -6,11 +6,16 @@ vcpkg_from_github(
REF Xerces-C_3_2_2
SHA512 66f60fe9194376ac0ca99d13ea5bce23ada86e0261dde30686c21ceb5499e754dab8eb0a98adadd83522bda62709377715501f6dac49763e3a686f9171cc63ea
HEAD_REF trunk
PATCHES disable-tests.patch
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DDISABLE_TESTS=ON
-DDISABLE_DOC=ON
-DDISABLE_SAMPLES=ON
)
vcpkg_install_cmake()
@ -21,16 +26,6 @@ else()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/XercesC TARGET_PATH share/xercesc)
endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
else()
file(GLOB release_exe "${CURRENT_PACKAGES_DIR}/bin/*.exe")
file(GLOB debug_exe "${CURRENT_PACKAGES_DIR}/debug/bin/*.exe")
if(release_exe OR debug_exe)
file(REMOVE ${release_exe} ${debug_exe})
endif()
endif()
file(READ ${CURRENT_PACKAGES_DIR}/share/xercesc/XercesCConfigInternal.cmake _contents)
string(REPLACE
"get_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)"