diff --git a/CMakeModules/DependencyConfiguration.cmake b/CMakeModules/DependencyConfiguration.cmake index 6d230bd..54b9143 100644 --- a/CMakeModules/DependencyConfiguration.cmake +++ b/CMakeModules/DependencyConfiguration.cmake @@ -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}) diff --git a/CMakeModules/FetchDependencies.cmake b/CMakeModules/FetchDependencies.cmake index 0c2cf40..e4ab6af 100644 --- a/CMakeModules/FetchDependencies.cmake +++ b/CMakeModules/FetchDependencies.cmake @@ -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) diff --git a/CMakeModules/FindCEC.cmake b/CMakeModules/FindCEC.cmake index 2c71c07..53d36d5 100644 --- a/CMakeModules/FindCEC.cmake +++ b/CMakeModules/FindCEC.cmake @@ -8,16 +8,17 @@ 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 - HINTS ${_CEC_LIBDIR} + PATH_SUFFIXES cec libcec cec/lib libcec/lib + HINTS ${_CEC_LIBDIR} ) include(FindPackageHandleStandardArgs) diff --git a/CMakeModules/InputConfiguration.cmake b/CMakeModules/InputConfiguration.cmake index 59cc7db..f60f978 100644 --- a/CMakeModules/InputConfiguration.cmake +++ b/CMakeModules/InputConfiguration.cmake @@ -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) diff --git a/CMakeModules/QtConfiguration.cmake b/CMakeModules/QtConfiguration.cmake index 7264435..c557b3c 100644 --- a/CMakeModules/QtConfiguration.cmake +++ b/CMakeModules/QtConfiguration.cmake @@ -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}) diff --git a/src/input/InputCEC.h b/src/input/InputCEC.h index 8808684..019b03d 100644 --- a/src/input/InputCEC.h +++ b/src/input/InputCEC.h @@ -4,7 +4,7 @@ #include #include #include "input/InputComponent.h" -#include +#include using namespace CEC;