2016-11-28 71 views
2

我一直試圖設置這半天,現在我越來越絕望,請幫助。 我正在關注https://developer.mozilla.org/en-US/docs/Web/HTML/DASH_Adaptive_Streaming_for_HTML_5_Video,但我被困在第3步,因爲我無法設置dash_manifest(來自webm-tools)。錯誤,當我運行cmake路徑我正在/到/ webmtools是:設置Webm的工具問題

CMake Error at CMakeLists.txt:24 (add_executable): 
    add_executable cannot create target "webm_info" because another target with 
    the same name already exists. The existing target is an executable created 
    in source directory "/home/relja/Desktop/applicationsAndServices/libwebm". 
    See documentation for policy CMP0002 for more details. 


CMake Error at CMakeLists.txt:31 (target_link_libraries): 
    Attempt to add link library "webm" to target "webm_info" which is not built 
    in this directory. 


-- Configuring incomplete, errors occurred! 
See also "/home/relja/Desktop/applicationsAndServices/webm-tools/CMakeFiles/CMakeOutput.log". 
See also "/home/relja/Desktop/applicationsAndServices/webm-tools/CMakeFiles/CMakeError.log". 

正如我先前提到的我用libwebm對於該方法的步驟2。 我已經嘗試刪除libwebm,爲此我得到了libwebm不存在的響應,因此操作無法執行。我嘗試過使用CMakeLists.txt,但沒有取得任何成果,因爲我不明白這裏的根本原因。文檔不存在(或我找不到),所以我不得不訴諸於此。如果我忘了添加一些內容,請詢問。

編輯1: 我忘了提,我使用Ubuntu 編輯2: 避免了使用unix makefile文件,而不是C進行的問題,做工精細

回答

0

我花了,而與此擺弄,並想出了工作的CMakeLists.txt:

## Copyright (c) 2015 The WebM project authors. All Rights Reserved. 
## 
## Use of this source code is governed by a BSD-style license 
## that can be found in the LICENSE file in the root of the source 
## 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) 
project(WEBMTOOLS) 

set(WEBMTOOLS_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}") 
# TODO(tomfinegan): The libwebm source directory must be configurable. 
set(LIBWEBM_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../libwebm") 
# This is where LIBWEBM targets are built. 
set(LIBWEBM_BUILD_DIR "${CMAKE_BINARY_DIR}/libwebm_build") 

# Libwebm section. 
# Add the libwebm CMakeLists.txt and set the binary dir to allow access to 
# libwebm build output. 
add_subdirectory("${LIBWEBM_SRC_DIR}" "${LIBWEBM_BUILD_DIR}") 
include_directories("${LIBWEBM_SRC_DIR}" 
        "${WEBMTOOLS_SRC_DIR}/shared") 

add_executable(dash_manifest 
    "${WEBMTOOLS_SRC_DIR}/shared/indent.cc" 
    "${WEBMTOOLS_SRC_DIR}/shared/webm_file.cc" 
    "${WEBMTOOLS_SRC_DIR}/shared/webm_incremental_reader.cc" 
    "${WEBMTOOLS_SRC_DIR}/webm_dash_manifest/adaptation_set.cc" 
    "${WEBMTOOLS_SRC_DIR}/webm_dash_manifest/dash_model.cc" 
    "${WEBMTOOLS_SRC_DIR}/webm_dash_manifest/period.cc" 
    "${WEBMTOOLS_SRC_DIR}/webm_dash_manifest/representation.cc" 
    "${WEBMTOOLS_SRC_DIR}/webm_dash_manifest/webm_dash_manifest.cc") 

target_link_libraries(dash_manifest LINK_PUBLIC webm) 

爲了編譯webm_dash_manifest:

cd webm_dash_manifest/ 
make 

另請注意,sample_muxer現在稱爲mkvmuxer_sample。

+0

太棒了,很久以前我已經解決了我的問題(我只是需要這個實驗),在第二次編輯中提到。 您也可以通知https://github.com/webmproject/webm-tools上工作的人。 –

+0

是的,我沒有迴應你的幫助(因爲你表示你已經解決了這個問題),而是幫助任何可能遇到此問題的人。 –