Skip to content

Commit

Permalink
[libwebm] add version 1.0.0.27
Browse files Browse the repository at this point in the history
  • Loading branch information
Mixaill committed Mar 14, 2017
1 parent d46563d commit 19685ae
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 0 deletions.
65 changes: 65 additions & 0 deletions ports/libwebm/0001-fix-cmake.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
From 5bd18b68658c2ba66e358341c159b17d9ba18791 Mon Sep 17 00:00:00 2001
From: Mikhail Paulyshka <[email protected]>
Date: Wed, 15 Mar 2017 00:01:24 +0300
Subject: [PATCH] fix cmake

- enable shared lib
- add install target
- set _CRT_SECURE_NO_WARNINGS
---
CMakeLists.txt | 29 +++++++++++++++++++++++++++--
1 file changed, 27 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index bf99829..a7bf021 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,14 +5,21 @@
## tree. An additional intellectual property rights grant can be found
## in the file PATENTS. All contributing project authors may
## be found in the AUTHORS file in the root of the source tree.
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.4)
project(LIBWEBM)
+
+set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
+
include("${CMAKE_CURRENT_SOURCE_DIR}/build/msvc_runtime.cmake")

set(LIBWEBM_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}")

+if(MSVC)
+ add_definitions(-D_CRT_SECURE_NO_WARNINGS)
+endif()
+
# Libwebm section.
-add_library(webm STATIC
+add_library(webm
"${LIBWEBM_SRC_DIR}/mkvmuxer.cpp"
"${LIBWEBM_SRC_DIR}/mkvmuxer.hpp"
"${LIBWEBM_SRC_DIR}/mkvmuxertypes.hpp"
@@ -62,3 +69,21 @@ add_executable(webm2pes
"${LIBWEBM_SRC_DIR}/webm2pes.cc"
"${LIBWEBM_SRC_DIR}/webm2pes.h")
target_link_libraries(webm2pes LINK_PUBLIC webm)
+
+install(
+ TARGETS webm
+ RUNTIME DESTINATION bin
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib)
+
+install(
+ FILES
+ "mkvmuxer.hpp"
+ "mkvmuxertypes.hpp"
+ "mkvmuxerutil.hpp"
+ "mkvparser.hpp"
+ "mkvreader.hpp"
+ "mkvwriter.hpp"
+ "webmids.hpp"
+ DESTINATION
+ "include/libwebm")
--
2.11.0.windows.1

3 changes: 3 additions & 0 deletions ports/libwebm/CONTROL
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Source: libwebm
Version: 1.0.0.27-1
Description: WebM File Parser
36 changes: 36 additions & 0 deletions ports/libwebm/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
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_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)
set(LIBWEBM_CRT_LINKAGE -DMSVC_RUNTIME=dll)
else()
set(LIBWEBM_CRT_LINKAGE -DMSVC_RUNTIME=static)
endif()

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS ${LIBWEBM_CRT_LINKAGE})

vcpkg_build_cmake()
vcpkg_install_cmake()
vcpkg_copy_pdbs()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

file(COPY ${SOURCE_PATH}/LICENSE.TXT DESTINATION ${CURRENT_PACKAGES_DIR}/share/libwebm)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/libwebm/LICENSE.TXT ${CURRENT_PACKAGES_DIR}/share/libwebm/copyright)

0 comments on commit 19685ae

Please sign in to comment.