Skip to content

Commit

Permalink
Merge pull request xbmc#6227 from Montellese/binary_addons_pvr
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins4kodi committed Mar 2, 2015
2 parents d996207 + 98bf72d commit f3fe6fb
Show file tree
Hide file tree
Showing 48 changed files with 468 additions and 218 deletions.
4 changes: 4 additions & 0 deletions m4/ax_cxx_compile_stdcxx_11.m4
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl
CXXFLAGS="$ac_save_CXXFLAGS"])
if eval test x\$$cachevar = xyes; then
CXXFLAGS="$CXXFLAGS $switch"
CXX11_SWITCH="$switch"
AC_SUBST(CXX11_SWITCH)
ac_success=yes
break
fi
Expand All @@ -117,6 +119,8 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl
CXXFLAGS="$ac_save_CXXFLAGS"])
if eval test x\$$cachevar = xyes; then
CXXFLAGS="$CXXFLAGS $switch"
CXX11_SWITCH="$switch"
AC_SUBST(CXX11_SWITCH)
ac_success=yes
break
fi
Expand Down
14 changes: 0 additions & 14 deletions project/Win32BuildSetup/BuildSetup.bat
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ rem CONFIG START
SET buildmode=ask
SET promptlevel=prompt
SET buildmingwlibs=true
SET buildpvraddons=true
SET buildbinaryaddons=true
SET exitcode=0
SET useshell=rxvt
Expand All @@ -40,7 +39,6 @@ FOR %%b in (%1, %2, %3, %4, %5) DO (
IF %%b==noclean SET buildmode=noclean
IF %%b==noprompt SET promptlevel=noprompt
IF %%b==nomingwlibs SET buildmingwlibs=false
IF %%b==nopvraddons SET buildpvraddons=false
IF %%b==nobinaryaddons SET buildbinaryaddons=false
IF %%b==sh SET useshell=sh
)
Expand Down Expand Up @@ -215,18 +213,6 @@ set WORKSPACE=%CD%\..\..
xcopy ..\..\sounds BUILD_WIN32\application\sounds /E /Q /I /Y /EXCLUDE:exclude.txt > NUL

SET build_path=%CD%
IF %buildpvraddons%==true (
ECHO ------------------------------------------------------------
ECHO Building pvr addons...
call buildpvraddons.bat
IF %errorlevel%==1 (
set DIETEXT="failed to build pvr addons"
goto DIE
)

IF EXIST error.log del error.log > NUL
)

IF %buildbinaryaddons%==true (
ECHO ------------------------------------------------------------
ECHO Building addons...
Expand Down
104 changes: 0 additions & 104 deletions project/Win32BuildSetup/buildpvraddons.bat

This file was deleted.

35 changes: 33 additions & 2 deletions project/cmake/addons/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ set(BUILD_ARGS -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
-DCMAKE_USER_MAKE_RULES_OVERRIDE=${CMAKE_USER_MAKE_RULES_OVERRIDE}
-DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX=${CMAKE_USER_MAKE_RULES_OVERRIDE_CXX}
-DCORE_SYSTEM_NAME=${CORE_SYSTEM_NAME}
-DBUILD_SHARED_LIBS=1)
-DBUILD_SHARED_LIBS=1
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS})

if(PACKAGE_ZIP)
# needed for project installing
Expand Down Expand Up @@ -108,6 +110,15 @@ endif()
# include check_target_platform() function
include(${APP_ROOT}/project/cmake/scripts/common/check_target_platform.cmake)

# check install permissions
set(ADDON_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})
check_install_permissions(${CMAKE_INSTALL_PREFIX} can_write)
if(NOT ${can_write} AND NOT WIN32)
set(NEED_SUDO TRUE)
set(ADDON_INSTALL_DIR ${CMAKE_BINARY_DIR}/.install)
message(STATUS "NEED_SUDO: ${NEED_SUDO}")
endif()

### prepare the build environment for the binary addons
# copy the prepare-env.cmake script to the depends path so that we can include it
file(COPY ${APP_ROOT}/project/cmake/scripts/common/prepare-env.cmake DESTINATION ${KODI_LIB_DIR})
Expand Down Expand Up @@ -202,9 +213,20 @@ endforeach()
foreach(id ${downloaded_addons})
externalproject_add(${id}
SOURCE_DIR ${BUILD_DIR}/${id}
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
INSTALL_DIR ${ADDON_INSTALL_DIR}
CMAKE_ARGS ${BUILD_ARGS})

# add a custom step to the external project between the configure and the build step which will always
# be executed and therefore forces a re-build of all changed files
externalproject_add_step(${id} forcebuild
COMMAND ${CMAKE_COMMAND} -E echo "Force build of ${id}"
DEPENDEES configure
DEPENDERS build
ALWAYS 1)

# add "kodi-platform" as a dependency to every addon
add_dependencies(${id} kodi-platform)

set(${id}_DEPENDS_DIR ${BUILD_DIR}/${id}/depends)

if(EXISTS ${${id}_DEPENDS_DIR})
Expand All @@ -216,3 +238,12 @@ foreach(id ${downloaded_addons})
endif()
endif()
endforeach()

if(NEED_SUDO)
add_custom_target(install
COMMAND ${CMAKE_COMMAND} -E echo "\n\n"
COMMAND ${CMAKE_COMMAND} -E echo "WARNING: sudo rights needed to install to ${CMAKE_INSTALL_PREFIX}\n"
COMMAND sudo ${CMAKE_COMMAND} -E copy_directory ${ADDON_INSTALL_DIR}/ ${CMAKE_INSTALL_PREFIX}/
COMMAND sudo ${CMAKE_COMMAND} -E remove_directory ${ADDON_INSTALL_DIR}/
COMMAND sudo -k)
endif()
1 change: 1 addition & 0 deletions project/cmake/addons/addons/pvr.argustv/platforms.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
all
1 change: 1 addition & 0 deletions project/cmake/addons/addons/pvr.argustv/pvr.argustv.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pvr.argustv https://github.com/kodi-pvr/pvr.argustv b6a58d3
1 change: 1 addition & 0 deletions project/cmake/addons/addons/pvr.demo/platforms.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
all
1 change: 1 addition & 0 deletions project/cmake/addons/addons/pvr.demo/pvr.demo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pvr.demo https://github.com/kodi-pvr/pvr.demo e457cf4
1 change: 1 addition & 0 deletions project/cmake/addons/addons/pvr.dvblink/platforms.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
all
1 change: 1 addition & 0 deletions project/cmake/addons/addons/pvr.dvblink/pvr.dvblink.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pvr.dvblink https://github.com/kodi-pvr/pvr.dvblink 10b9c1d
1 change: 1 addition & 0 deletions project/cmake/addons/addons/pvr.dvbviewer/platforms.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
all
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pvr.dvbviewer https://github.com/kodi-pvr/pvr.dvbviewer 3420504
1 change: 1 addition & 0 deletions project/cmake/addons/addons/pvr.hts/platforms.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
all
1 change: 1 addition & 0 deletions project/cmake/addons/addons/pvr.hts/pvr.hts.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pvr.hts https://github.com/kodi-pvr/pvr.hts 3bc77ae
1 change: 1 addition & 0 deletions project/cmake/addons/addons/pvr.iptvsimple/platforms.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
all
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pvr.iptvsimple https://github.com/kodi-pvr/pvr.iptvsimple f6ca894
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
all
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pvr.mediaportal.tvserver https://github.com/kodi-pvr/pvr.mediaportal.tvserver 87422e6
1 change: 1 addition & 0 deletions project/cmake/addons/addons/pvr.mythtv/platforms.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
all
1 change: 1 addition & 0 deletions project/cmake/addons/addons/pvr.mythtv/pvr.mythtv.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pvr.mythtv https://github.com/kodi-pvr/pvr.mythtv 6e9cf98
1 change: 1 addition & 0 deletions project/cmake/addons/addons/pvr.nextpvr/platforms.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
all
1 change: 1 addition & 0 deletions project/cmake/addons/addons/pvr.nextpvr/pvr.nextpvr.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pvr.nextpvr https://github.com/kodi-pvr/pvr.nextpvr 79557b2
1 change: 1 addition & 0 deletions project/cmake/addons/addons/pvr.njoy/platforms.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
all
1 change: 1 addition & 0 deletions project/cmake/addons/addons/pvr.njoy/pvr.njoy.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pvr.njoy https://github.com/kodi-pvr/pvr.njoy dee3094
1 change: 1 addition & 0 deletions project/cmake/addons/addons/pvr.vdr.vnsi/platforms.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
all
1 change: 1 addition & 0 deletions project/cmake/addons/addons/pvr.vdr.vnsi/pvr.vdr.vnsi.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pvr.vdr.vnsi https://github.com/FernetMenta/pvr.vdr.vnsi 3cc618e
1 change: 1 addition & 0 deletions project/cmake/addons/addons/pvr.vuplus/platforms.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
all
1 change: 1 addition & 0 deletions project/cmake/addons/addons/pvr.vuplus/pvr.vuplus.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pvr.vuplus https://github.com/kodi-pvr/pvr.vuplus 6acc177
1 change: 1 addition & 0 deletions project/cmake/addons/addons/pvr.wmc/platforms.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
all
1 change: 1 addition & 0 deletions project/cmake/addons/addons/pvr.wmc/pvr.wmc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pvr.wmc https://github.com/kodi-pvr/pvr.wmc e4b5285
2 changes: 2 additions & 0 deletions project/cmake/addons/depends/common/kodi-platform/deps.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
kodi
tinyxml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kodi-platform https://github.com/xbmc/kodi-platform 68315f0
23 changes: 23 additions & 0 deletions project/cmake/addons/depends/common/tinyxml/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
project(tinyxml)

cmake_minimum_required(VERSION 2.8)

set(SOURCES src/tinystr.cpp
src/tinyxml.cpp
src/tinyxmlerror.cpp
src/tinyxmlparser.cpp)

if(WIN32)
add_definitions(-DWIN32 -D_LIB)
endif()
add_definitions(-DTIXML_USE_STL)

add_library(tinyxml ${SOURCES})

include_directories(${PROJECT_SOURCE_DIR}/include)

set(HEADERS ${PROJECT_SOURCE_DIR}/include/tinystr.h
${PROJECT_SOURCE_DIR}/include/tinyxml.h)

install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
install(TARGETS tinyxml DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
1 change: 1 addition & 0 deletions project/cmake/addons/depends/common/tinyxml/tinyxml.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tinyxml http://mirrors.xbmc.org/build-deps/sources/tinyxml-2.6.2_2.tar.gz
3 changes: 3 additions & 0 deletions project/cmake/kodi-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ SET(KODI_INCLUDE_DIR @prefix@/include)
SET(APP_NAME @APP_NAME@)
SET(APP_VERSION_MAJOR @APP_VERSION_MAJOR@)
SET(APP_VERSION_MINOR @APP_VERSION_MINOR@)
IF(NOT WIN32)
SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} @CXX11_SWITCH@")
ENDIF()
LIST(APPEND CMAKE_MODULE_PATH @prefix@/lib/kodi)
ADD_DEFINITIONS(@ARCH_DEFINES@)

Expand Down
18 changes: 16 additions & 2 deletions project/cmake/scripts/common/addon-helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,23 @@ macro (build_addon target prefix libs)
# Pack files together to create an archive
INSTALL(DIRECTORY ${target} DESTINATION ./ COMPONENT ${target}-${${prefix}_VERSION})
IF(WIN32)
INSTALL(PROGRAMS ${CMAKE_BINARY_DIR}/${target}.dll
DESTINATION ${target}
# get the installation location for the addon's target
get_property(dll_location TARGET ${target} PROPERTY LOCATION)
# in case of a VC++ project the installation location contains a $(Configuration) VS variable
# we replace it with ${CMAKE_BUILD_TYPE} (which doesn't cover the case when the build configuration
# is changed within Visual Studio)
string(REPLACE "$(Configuration)" "${CMAKE_BUILD_TYPE}" dll_location "${dll_location}")

# install the generated DLL file
INSTALL(PROGRAMS ${dll_location} DESTINATION ${target}
COMPONENT ${target}-${${prefix}_VERSION})

IF(CMAKE_BUILD_TYPE MATCHES Debug)
# for debug builds also install the PDB file
get_filename_component(dll_directory ${dll_location} DIRECTORY)
INSTALL(FILES ${dll_directory}/${target}.pdb DESTINATION ${target}
COMPONENT ${target}-${${prefix}_VERSION})
ENDIF()
ELSE(WIN32)
INSTALL(TARGETS ${target} DESTINATION ${target}
COMPONENT ${target}-${${prefix}_VERSION})
Expand Down
21 changes: 21 additions & 0 deletions project/cmake/scripts/common/check_target_platform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,24 @@ function(check_target_platform dir target_platform build)
# make the ${build} variable available to the calling script
set(${build} "${${build}}" PARENT_SCOPE)
endfunction()

function(check_install_permissions install_dir have_perms)
# param[in] install_dir directory to check for write permissions
# param[out] have_perms wether we have permissions to install to install_dir

set(${have_perms} TRUE)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${install_dir}/lib/kodi
COMMAND ${CMAKE_COMMAND} -E make_directory ${install_dir}/share/kodi
COMMAND ${CMAKE_COMMAND} -E touch ${install_dir}/lib/kodi/.cmake-inst-test ${install_dir}/share/kodi/.cmake-inst-test
RESULT_VARIABLE permtest)

if(${permtest} GREATER 0)
message(STATUS "check_install_permissions: ${permtest}")
set(${have_perms} FALSE)
endif()
set(${have_perms} "${${have_perms}}" PARENT_SCOPE)

if(EXISTS ${install_dir}/lib/kodi/.cmake-inst-test OR EXISTS ${install_dir}/share/kodi/.cmake-inst-test)
file(REMOVE ${install_dir}/lib/kodi/.cmake-inst-test ${install_dir}/share/kodi/.cmake-inst-test)
endif()
endfunction()
Loading

0 comments on commit f3fe6fb

Please sign in to comment.