[libwebm] Avoid building executables

This commit is contained in:
Robert Schumacher 2018-10-23 10:38:27 -07:00
parent ece1e7a67a
commit 66107362b1
3 changed files with 33 additions and 17 deletions

View File

@ -1,3 +1,3 @@
Source: libwebm
Version: 1.0.0.27-2
Version: 1.0.0.27-3
Description: WebM File Parser

View File

@ -0,0 +1,20 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b48868f..f2fe35b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,6 +41,7 @@ endif(WIN32)
include_directories("${LIBWEBM_SRC_DIR}")
+if(BUILD_SAMPLES)
# Sample section.
add_executable(sample
"${LIBWEBM_SRC_DIR}/sample.cpp")
@@ -69,6 +70,7 @@ add_executable(webm2pes
"${LIBWEBM_SRC_DIR}/webm2pes.cc"
"${LIBWEBM_SRC_DIR}/webm2pes.h")
target_link_libraries(webm2pes LINK_PUBLIC webm)
+endif()
install(
TARGETS webm

View File

@ -1,21 +1,17 @@
include(vcpkg_common_functions)
set(LIBWEBM_VERSION 1.0.0.27)
set(LIBWEBM_HASH 15650b8b121b226654a5abed45a3586ddaf785dee8dac7c72df3f3f9aef76af4e561b75a2ef05328af8dfcfde21948b2edb59cd884dad08b8919cab4ee5a8596)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libwebm-libwebm-${LIBWEBM_VERSION})
vcpkg_download_distfile(ARCHIVE
URLS "https://github.com/webmproject/libwebm/archive/libwebm-${LIBWEBM_VERSION}.tar.gz"
FILENAME "libwebm-${LIBWEBM_VERSION}.tar.gz"
SHA512 ${LIBWEBM_HASH}
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO webmproject/libwebm
REF libwebm-1.0.0.27
SHA512 15650b8b121b226654a5abed45a3586ddaf785dee8dac7c72df3f3f9aef76af4e561b75a2ef05328af8dfcfde21948b2edb59cd884dad08b8919cab4ee5a8596
HEAD_REF master
PATCHES
0001-fix-cmake.patch
no-samples.patch
)
vcpkg_extract_source_archive(${ARCHIVE})
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES "${CMAKE_CURRENT_LIST_DIR}/0001-fix-cmake.patch")
if(VCPKG_CRT_LINKAGE STREQUAL dynamic)
if(VCPKG_CRT_LINKAGE STREQUAL "dynamic")
set(LIBWEBM_CRT_LINKAGE -DMSVC_RUNTIME=dll)
else()
set(LIBWEBM_CRT_LINKAGE -DMSVC_RUNTIME=static)
@ -24,9 +20,9 @@ endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS ${LIBWEBM_CRT_LINKAGE})
OPTIONS ${LIBWEBM_CRT_LINKAGE}
)
vcpkg_build_cmake()
vcpkg_install_cmake()
vcpkg_copy_pdbs()