Adapt scripts to download depends on windows

This commit is contained in:
Tobias Hieta 2015-12-03 15:41:22 +01:00 committed by Tobias Hieta
parent 6f84cbe988
commit edba502237
6 changed files with 38 additions and 21 deletions

View File

@ -10,18 +10,20 @@ if(APPLE AND NOT DISABLE_BUNDLED_DEPS)
endif(APPLE AND NOT DISABLE_BUNDLED_DEPS)
if(WIN32)
set(DEFAULT_ROOT "${CMAKE_SOURCE_DIR}/dependencies/all-deps")
download_deps("plexmediaplayer-windows-dependencies" dir)
message("dependencies are: ${dir}")
set(DEFAULT_ROOT "${dir}")
endif(WIN32)
set(DEPENDENCY_ROOT ${DEFAULT_ROOT} CACHE PATH "Path where the deps are located")
if(IS_DIRECTORY ${DEPENDENCY_ROOT})
message(STATUS "Going to use bundled deps in directory: ${DEPENDENCY_ROOT}")
set(CMAKE_FIND_ROOT_PATH ${DEPENDENCY_ROOT})
set(CMAKE_PREFIX_PATH ${DEPENDENCY_ROOT})
list(APPEND CMAKE_FIND_ROOT_PATH ${DEPENDENCY_ROOT})
list(APPEND CMAKE_PREFIX_PATH ${DEPENDENCY_ROOT})
set(ENV{PKG_CONFIG_LIBDIR} ${CMAKE_FIND_ROOT_PATH}/lib/pkgconfig)
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
include_directories(${CMAKE_FIND_ROOT_PATH}/include)
include_directories(${DEPENDENCY_ROOT}/include)
else(IS_DIRECTORY ${DEPENDENCY_ROOT})
message(STATUS "Not using bundled deps")
endif(IS_DIRECTORY ${DEPENDENCY_ROOT})

View File

@ -28,6 +28,9 @@ function(download_deps depname dirpath)
set(DEP_DIRNAME "konvergo-qt-${ARCHSTR}-release-${DEP_HASH}")
elseif(depname STREQUAL plexmediaplayer-dependencies)
set(DEP_DIRNAME "konvergo-depends-${ARCHSTR}-release-${DEP_HASH}")
elseif(depname STREQUAL plexmediaplayer-windows-dependencies)
set(ARCHSTR "mingw32-x86_64")
set(DEP_DIRNAME "konvergo-depends-windows-${ARCHSTR}-release-${DEP_HASH}")
else()
set(DEP_DIRNAME "${depname}-${ARCHSTR}-release-${DEP_HASH}")
endif()
@ -44,7 +47,8 @@ function(download_deps depname dirpath)
list(GET SHA_STATUS 0 SHASUCCESS)
if(SHASUCCESS EQUAL 0)
file(STRINGS ${DEP_DIR}/${DEP_FILENAME}.sha.txt CONTENT_HASH LIMIT_COUNT 1)
file(STRINGS ${DEP_DIR}/${DEP_FILENAME}.sha.txt CONTENT_HASH_RAW LIMIT_COUNT 1)
string(SUBSTRING ${CONTENT_HASH_RAW} 0 40 CONTENT_HASH)
message(STATUS "Downloading ${DEP_FILENAME}...")
@ -67,12 +71,21 @@ function(download_deps depname dirpath)
COMMAND ${CMAKE_COMMAND} -E tar xjf ${DEP_DIR}/${DEP_FILENAME}
WORKING_DIRECTORY ${DEP_DIR}
)
message(STATUS "Fixing install library names...")
execute_process(
COMMAND ${PROJECT_SOURCE_DIR}/scripts/fix-install-names.py ${DEP_DIR}/${DEP_DIRNAME}
WORKING_DIRECTORY ${DEP_DIR}
)
message(STATUS "Done")
if(APPLE)
message(STATUS "Fixing install library names...")
execute_process(
COMMAND ${PROJECT_SOURCE_DIR}/scripts/fix-install-names.py ${DEP_DIR}/${DEP_DIRNAME}
WORKING_DIRECTORY ${DEP_DIR}
)
message(STATUS "Done")
endif(APPLE)
if(WIN32 AND EXISTS ${DEP_DIR}/${DEP_DIRNAME}/bin/mpv-1.def)
message(STATUS "Fixing mpv.lib...")
execute_process(
COMMAND LIB /def:bin\\mpv-1.def /out:lib\\mpv.lib /MACHINE:X64
WORKING_DIRECTORY ${DEP_DIR}/${DEP_DIRNAME}
)
endif(WIN32 AND EXISTS ${DEP_DIR}/${DEP_DIRNAME}/bin/mpv-1.def)
endif()
else(SHASUCCESS EQUAL 0)
list(GET SHA_STATUS 1 SHAERROR)

View File

@ -8,15 +8,16 @@ if (PKG_CONFIG_FOUND)
endif (PKG_CONFIG_FOUND)
Find_Path(CEC_INCLUDE_DIR
NAMES cec.h
NAMES cec/cec.h libcec/cec.h
PATHS /usr/include usr/local/include
PATH_SUFFIXES libcec
PATH_SUFFIXES cec cec/cec libcec cec/include
HINTS ${_CEC_INCLUDEDIR}
)
Find_Library(CEC_LIBRARY
NAMES cec
PATHS /usr/lib usr/local/lib
PATH_SUFFIXES cec libcec cec/lib libcec/lib
HINTS ${_CEC_LIBDIR}
)

View File

@ -1,3 +1,4 @@
message(STATUS ${CMAKE_FIND_ROOT_PATH})
OPTION(ENABLE_SDL2 "Enable SDL2 for joystick handling" ON)
if(ENABLE_SDL2)
find_package(SDL2)

View File

@ -1,11 +1,11 @@
include(FetchDependencies)
if(APPLE)
download_deps("plexmediaplayer-qt" dir)
set(QTROOT ${dir})
else()
set(QTROOT "/usr/local/Qt/Qt5.5" CACHE PATH "Root of the QT binaries.")
endif()
download_deps("plexmediaplayer-qt" dir)
set(QTROOT ${dir})
list(APPEND CMAKE_FIND_ROOT_PATH ${dir})
list(APPEND CMAKE_PREFIX_PATH ${dir})
include_directories(${dir}/include)
set(REQUIRED_QT_VERSION "5.5.0")
message(STATUS ${QTROOT})

View File

@ -4,7 +4,7 @@
#include <QMutex>
#include <QTimer>
#include "input/InputComponent.h"
#include <cec.h>
#include <libcec/cec.h>
using namespace CEC;