aboutsummaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
authorjenkins4kodi <jenkins4kodi@users.noreply.github.com>2015-03-02 16:17:12 +0100
committerjenkins4kodi <jenkins4kodi@users.noreply.github.com>2015-03-02 16:17:12 +0100
commitf3fe6fbc0ee4c25ae63f1ed0be884d8480e97985 (patch)
tree011a0aec9931a8840ced8589c60553a77437d8e0 /project
parentd9962077a4d3fae66da5db0724efdc6554f43f7f (diff)
parent98bf72d090d374a0b164e73c18aec7e5d06f7f0f (diff)
Merge pull request #6227 from Montellese/binary_addons_pvr
Diffstat (limited to 'project')
-rw-r--r--project/Win32BuildSetup/BuildSetup.bat14
-rw-r--r--project/Win32BuildSetup/buildpvraddons.bat104
-rw-r--r--project/cmake/addons/CMakeLists.txt35
-rw-r--r--project/cmake/addons/addons/pvr.argustv/platforms.txt1
-rw-r--r--project/cmake/addons/addons/pvr.argustv/pvr.argustv.txt1
-rw-r--r--project/cmake/addons/addons/pvr.demo/platforms.txt1
-rw-r--r--project/cmake/addons/addons/pvr.demo/pvr.demo.txt1
-rw-r--r--project/cmake/addons/addons/pvr.dvblink/platforms.txt1
-rw-r--r--project/cmake/addons/addons/pvr.dvblink/pvr.dvblink.txt1
-rw-r--r--project/cmake/addons/addons/pvr.dvbviewer/platforms.txt1
-rw-r--r--project/cmake/addons/addons/pvr.dvbviewer/pvr.dvbviewer.txt1
-rw-r--r--project/cmake/addons/addons/pvr.hts/platforms.txt1
-rw-r--r--project/cmake/addons/addons/pvr.hts/pvr.hts.txt1
-rw-r--r--project/cmake/addons/addons/pvr.iptvsimple/platforms.txt1
-rw-r--r--project/cmake/addons/addons/pvr.iptvsimple/pvr.iptvsimple.txt1
-rw-r--r--project/cmake/addons/addons/pvr.mediaportal.tvserver/platforms.txt1
-rw-r--r--project/cmake/addons/addons/pvr.mediaportal.tvserver/pvr.mediaportal.tvserver.txt1
-rw-r--r--project/cmake/addons/addons/pvr.mythtv/platforms.txt1
-rw-r--r--project/cmake/addons/addons/pvr.mythtv/pvr.mythtv.txt1
-rw-r--r--project/cmake/addons/addons/pvr.nextpvr/platforms.txt1
-rw-r--r--project/cmake/addons/addons/pvr.nextpvr/pvr.nextpvr.txt1
-rw-r--r--project/cmake/addons/addons/pvr.njoy/platforms.txt1
-rw-r--r--project/cmake/addons/addons/pvr.njoy/pvr.njoy.txt1
-rw-r--r--project/cmake/addons/addons/pvr.vdr.vnsi/platforms.txt1
-rw-r--r--project/cmake/addons/addons/pvr.vdr.vnsi/pvr.vdr.vnsi.txt1
-rw-r--r--project/cmake/addons/addons/pvr.vuplus/platforms.txt1
-rw-r--r--project/cmake/addons/addons/pvr.vuplus/pvr.vuplus.txt1
-rw-r--r--project/cmake/addons/addons/pvr.wmc/platforms.txt1
-rw-r--r--project/cmake/addons/addons/pvr.wmc/pvr.wmc.txt1
-rw-r--r--project/cmake/addons/depends/common/kodi-platform/deps.txt2
-rw-r--r--project/cmake/addons/depends/common/kodi-platform/kodi-platform.txt1
-rw-r--r--project/cmake/addons/depends/common/tinyxml/CMakeLists.txt23
-rw-r--r--project/cmake/addons/depends/common/tinyxml/tinyxml.txt1
-rw-r--r--project/cmake/kodi-config.cmake.in3
-rw-r--r--project/cmake/scripts/common/addon-helpers.cmake18
-rw-r--r--project/cmake/scripts/common/check_target_platform.cmake21
-rw-r--r--project/cmake/scripts/common/handle-depends.cmake39
-rw-r--r--project/cmake/scripts/common/prepare-env.cmake10
38 files changed, 155 insertions, 142 deletions
diff --git a/project/Win32BuildSetup/BuildSetup.bat b/project/Win32BuildSetup/BuildSetup.bat
index 8114e64af9..0455fa83e2 100644
--- a/project/Win32BuildSetup/BuildSetup.bat
+++ b/project/Win32BuildSetup/BuildSetup.bat
@@ -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
@@ -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
)
@@ -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...
diff --git a/project/Win32BuildSetup/buildpvraddons.bat b/project/Win32BuildSetup/buildpvraddons.bat
deleted file mode 100644
index 8fdc4e4db4..0000000000
--- a/project/Win32BuildSetup/buildpvraddons.bat
+++ /dev/null
@@ -1,104 +0,0 @@
-@ECHO OFF
-
-REM Batch file to download and build pvr-addons and place them in application's add-ons folder
-
-SET CUR_DIR=%CD%
-SET EXITCODE=0
-
-SET DEPS_DIR=..\BuildDependencies
-SET TMP_DIR=%DEPS_DIR%\tmp
-
-SET LIBNAME=xbmc-pvr-addons
-SET VERSION=2fb0fc22668b1efdec05e66161d6c419844ee9cd
-SET SOURCE=%LIBNAME%
-SET GIT_URL=git://github.com/opdenkamp/%LIBNAME%.git
-SET SOURCE_DIR=%TMP_DIR%\%SOURCE%
-SET BUILT_ADDONS_DIR=%SOURCE_DIR%\addons
-
-REM check if MSBuild.exe is used because it requires different command line switches
-IF "%msbuildemitsolution%" == "1" (
- set OPTS_EXE=%SOURCE_DIR%\project\VS2010Express\xbmc-pvr-addons.sln /t:Build /p:Configuration="Release" /property:VCTargetsPath="%MSBUILDROOT%Microsoft.Cpp\v4.0\V120\\" /m
-) ELSE (
- set OPTS_EXE=%SOURCE_DIR%\project\VS2010Express\xbmc-pvr-addons.sln /build Release
-)
-
-REM Try wrapped msysgit - must be in the path
-SET GITEXE=git.cmd
-CALL %GITEXE% --help > NUL 2>&1
-IF errorlevel 1 GOTO nowrapmsysgit
-GOTO work
-
-:nowrapmsysgit
-
-REM Fallback on regular msysgit - must be in the path
-SET GITEXE=git.exe
-%GITEXE% --help > NUL
-IF errorlevel 9009 IF NOT errorlevel 9010 GOTO nomsysgit
-GOTO work
-
-:nomsysgit
-
-REM Fallback on tgit.exe of TortoiseGit if available
-SET GITEXE=tgit.exe
-%GITEXE% --version > NUL 2>&1
-IF errorlevel 9009 IF NOT errorlevel 9010 GOTO error
-GOTO work
-
-
-:work
-IF NOT EXIST "%TMP_DIR%" MD "%TMP_DIR%"
-
-REM clone the git repository into SOURCE_DIR
-CALL %GITEXE% clone %GIT_URL% "%SOURCE_DIR%" > NUL 2>&1
-CD "%SOURCE_DIR%"
-REM get the proper revision
-CALL %GITEXE% checkout %VERSION% > NUL 2>&1
-
-:build
-REM run DownloadBuildDeps.bat of pvr-addons
-CD "project\BuildDependencies"
-CALL DownloadBuildDeps.bat > NUL 2>&1
-CD "%CUR_DIR%"
-
-REM build xbmc-pvr-addons.sln
-ECHO Building PVR addons
-"%MSBUILDROOT%12.0\bin\MSBuild.exe" %OPTS_EXE%
-
-IF %errorlevel%==1 (
- goto fail
-)
-
-REM copy the built pvr addons into ADDONS_DIR
-CD "%BUILT_ADDONS_DIR%"
-SET ADDONS_DIR=..\..\..\..\Win32BuildSetup\BUILD_WIN32\addons\
-
-REM exclude some files
-ECHO addon.xml.in > exclude.txt
-ECHO _win32.exp >> exclude.txt
-ECHO _win32.lib >> exclude.txt
-ECHO _win32.pdb >> exclude.txt
-FOR /D %%A IN ("pvr.*") DO (
- IF EXIST "%%A\addon" (
- ECHO Installing %%A
- XCOPY "%%A\addon\*" "%ADDONS_DIR%\%%A" /E /Q /I /Y /EXCLUDE:exclude.txt > NUL
- )
-)
-DEL exclude.txt > NUL
-CD "%CUR_DIR%"
-
-REM cleanup temporary directories
-RMDIR "%TMP_DIR%" /S /Q > NUL
-
-GOTO done
-
-:error
-ECHO No git command available. Unable to fetch and build pvr-addons.
-SET EXITCODE=1
-
-:fail
-ECHO Failed to build one or more pvr addons
-SET EXITCODE=1
-
-:done
-SET GITEXE=
-EXIT /B %EXITCODE%
diff --git a/project/cmake/addons/CMakeLists.txt b/project/cmake/addons/CMakeLists.txt
index f355aeebc2..0afc622aeb 100644
--- a/project/cmake/addons/CMakeLists.txt
+++ b/project/cmake/addons/CMakeLists.txt
@@ -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
@@ -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})
@@ -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})
@@ -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()
diff --git a/project/cmake/addons/addons/pvr.argustv/platforms.txt b/project/cmake/addons/addons/pvr.argustv/platforms.txt
new file mode 100644
index 0000000000..baa6044435
--- /dev/null
+++ b/project/cmake/addons/addons/pvr.argustv/platforms.txt
@@ -0,0 +1 @@
+all \ No newline at end of file
diff --git a/project/cmake/addons/addons/pvr.argustv/pvr.argustv.txt b/project/cmake/addons/addons/pvr.argustv/pvr.argustv.txt
new file mode 100644
index 0000000000..bb928b6f64
--- /dev/null
+++ b/project/cmake/addons/addons/pvr.argustv/pvr.argustv.txt
@@ -0,0 +1 @@
+pvr.argustv https://github.com/kodi-pvr/pvr.argustv b6a58d3 \ No newline at end of file
diff --git a/project/cmake/addons/addons/pvr.demo/platforms.txt b/project/cmake/addons/addons/pvr.demo/platforms.txt
new file mode 100644
index 0000000000..baa6044435
--- /dev/null
+++ b/project/cmake/addons/addons/pvr.demo/platforms.txt
@@ -0,0 +1 @@
+all \ No newline at end of file
diff --git a/project/cmake/addons/addons/pvr.demo/pvr.demo.txt b/project/cmake/addons/addons/pvr.demo/pvr.demo.txt
new file mode 100644
index 0000000000..71e18c0513
--- /dev/null
+++ b/project/cmake/addons/addons/pvr.demo/pvr.demo.txt
@@ -0,0 +1 @@
+pvr.demo https://github.com/kodi-pvr/pvr.demo e457cf4 \ No newline at end of file
diff --git a/project/cmake/addons/addons/pvr.dvblink/platforms.txt b/project/cmake/addons/addons/pvr.dvblink/platforms.txt
new file mode 100644
index 0000000000..baa6044435
--- /dev/null
+++ b/project/cmake/addons/addons/pvr.dvblink/platforms.txt
@@ -0,0 +1 @@
+all \ No newline at end of file
diff --git a/project/cmake/addons/addons/pvr.dvblink/pvr.dvblink.txt b/project/cmake/addons/addons/pvr.dvblink/pvr.dvblink.txt
new file mode 100644
index 0000000000..58e0d5a43c
--- /dev/null
+++ b/project/cmake/addons/addons/pvr.dvblink/pvr.dvblink.txt
@@ -0,0 +1 @@
+pvr.dvblink https://github.com/kodi-pvr/pvr.dvblink 10b9c1d \ No newline at end of file
diff --git a/project/cmake/addons/addons/pvr.dvbviewer/platforms.txt b/project/cmake/addons/addons/pvr.dvbviewer/platforms.txt
new file mode 100644
index 0000000000..baa6044435
--- /dev/null
+++ b/project/cmake/addons/addons/pvr.dvbviewer/platforms.txt
@@ -0,0 +1 @@
+all \ No newline at end of file
diff --git a/project/cmake/addons/addons/pvr.dvbviewer/pvr.dvbviewer.txt b/project/cmake/addons/addons/pvr.dvbviewer/pvr.dvbviewer.txt
new file mode 100644
index 0000000000..8ebacac18b
--- /dev/null
+++ b/project/cmake/addons/addons/pvr.dvbviewer/pvr.dvbviewer.txt
@@ -0,0 +1 @@
+pvr.dvbviewer https://github.com/kodi-pvr/pvr.dvbviewer 3420504 \ No newline at end of file
diff --git a/project/cmake/addons/addons/pvr.hts/platforms.txt b/project/cmake/addons/addons/pvr.hts/platforms.txt
new file mode 100644
index 0000000000..baa6044435
--- /dev/null
+++ b/project/cmake/addons/addons/pvr.hts/platforms.txt
@@ -0,0 +1 @@
+all \ No newline at end of file
diff --git a/project/cmake/addons/addons/pvr.hts/pvr.hts.txt b/project/cmake/addons/addons/pvr.hts/pvr.hts.txt
new file mode 100644
index 0000000000..4c8068db00
--- /dev/null
+++ b/project/cmake/addons/addons/pvr.hts/pvr.hts.txt
@@ -0,0 +1 @@
+pvr.hts https://github.com/kodi-pvr/pvr.hts 3bc77ae \ No newline at end of file
diff --git a/project/cmake/addons/addons/pvr.iptvsimple/platforms.txt b/project/cmake/addons/addons/pvr.iptvsimple/platforms.txt
new file mode 100644
index 0000000000..baa6044435
--- /dev/null
+++ b/project/cmake/addons/addons/pvr.iptvsimple/platforms.txt
@@ -0,0 +1 @@
+all \ No newline at end of file
diff --git a/project/cmake/addons/addons/pvr.iptvsimple/pvr.iptvsimple.txt b/project/cmake/addons/addons/pvr.iptvsimple/pvr.iptvsimple.txt
new file mode 100644
index 0000000000..73358b76c9
--- /dev/null
+++ b/project/cmake/addons/addons/pvr.iptvsimple/pvr.iptvsimple.txt
@@ -0,0 +1 @@
+pvr.iptvsimple https://github.com/kodi-pvr/pvr.iptvsimple f6ca894 \ No newline at end of file
diff --git a/project/cmake/addons/addons/pvr.mediaportal.tvserver/platforms.txt b/project/cmake/addons/addons/pvr.mediaportal.tvserver/platforms.txt
new file mode 100644
index 0000000000..baa6044435
--- /dev/null
+++ b/project/cmake/addons/addons/pvr.mediaportal.tvserver/platforms.txt
@@ -0,0 +1 @@
+all \ No newline at end of file
diff --git a/project/cmake/addons/addons/pvr.mediaportal.tvserver/pvr.mediaportal.tvserver.txt b/project/cmake/addons/addons/pvr.mediaportal.tvserver/pvr.mediaportal.tvserver.txt
new file mode 100644
index 0000000000..534ede17b4
--- /dev/null
+++ b/project/cmake/addons/addons/pvr.mediaportal.tvserver/pvr.mediaportal.tvserver.txt
@@ -0,0 +1 @@
+pvr.mediaportal.tvserver https://github.com/kodi-pvr/pvr.mediaportal.tvserver 87422e6 \ No newline at end of file
diff --git a/project/cmake/addons/addons/pvr.mythtv/platforms.txt b/project/cmake/addons/addons/pvr.mythtv/platforms.txt
new file mode 100644
index 0000000000..baa6044435
--- /dev/null
+++ b/project/cmake/addons/addons/pvr.mythtv/platforms.txt
@@ -0,0 +1 @@
+all \ No newline at end of file
diff --git a/project/cmake/addons/addons/pvr.mythtv/pvr.mythtv.txt b/project/cmake/addons/addons/pvr.mythtv/pvr.mythtv.txt
new file mode 100644
index 0000000000..9c77d98933
--- /dev/null
+++ b/project/cmake/addons/addons/pvr.mythtv/pvr.mythtv.txt
@@ -0,0 +1 @@
+pvr.mythtv https://github.com/kodi-pvr/pvr.mythtv 6e9cf98 \ No newline at end of file
diff --git a/project/cmake/addons/addons/pvr.nextpvr/platforms.txt b/project/cmake/addons/addons/pvr.nextpvr/platforms.txt
new file mode 100644
index 0000000000..baa6044435
--- /dev/null
+++ b/project/cmake/addons/addons/pvr.nextpvr/platforms.txt
@@ -0,0 +1 @@
+all \ No newline at end of file
diff --git a/project/cmake/addons/addons/pvr.nextpvr/pvr.nextpvr.txt b/project/cmake/addons/addons/pvr.nextpvr/pvr.nextpvr.txt
new file mode 100644
index 0000000000..0d3df74776
--- /dev/null
+++ b/project/cmake/addons/addons/pvr.nextpvr/pvr.nextpvr.txt
@@ -0,0 +1 @@
+pvr.nextpvr https://github.com/kodi-pvr/pvr.nextpvr 79557b2 \ No newline at end of file
diff --git a/project/cmake/addons/addons/pvr.njoy/platforms.txt b/project/cmake/addons/addons/pvr.njoy/platforms.txt
new file mode 100644
index 0000000000..baa6044435
--- /dev/null
+++ b/project/cmake/addons/addons/pvr.njoy/platforms.txt
@@ -0,0 +1 @@
+all \ No newline at end of file
diff --git a/project/cmake/addons/addons/pvr.njoy/pvr.njoy.txt b/project/cmake/addons/addons/pvr.njoy/pvr.njoy.txt
new file mode 100644
index 0000000000..e33573b950
--- /dev/null
+++ b/project/cmake/addons/addons/pvr.njoy/pvr.njoy.txt
@@ -0,0 +1 @@
+pvr.njoy https://github.com/kodi-pvr/pvr.njoy dee3094 \ No newline at end of file
diff --git a/project/cmake/addons/addons/pvr.vdr.vnsi/platforms.txt b/project/cmake/addons/addons/pvr.vdr.vnsi/platforms.txt
new file mode 100644
index 0000000000..baa6044435
--- /dev/null
+++ b/project/cmake/addons/addons/pvr.vdr.vnsi/platforms.txt
@@ -0,0 +1 @@
+all \ No newline at end of file
diff --git a/project/cmake/addons/addons/pvr.vdr.vnsi/pvr.vdr.vnsi.txt b/project/cmake/addons/addons/pvr.vdr.vnsi/pvr.vdr.vnsi.txt
new file mode 100644
index 0000000000..8d6f7707a4
--- /dev/null
+++ b/project/cmake/addons/addons/pvr.vdr.vnsi/pvr.vdr.vnsi.txt
@@ -0,0 +1 @@
+pvr.vdr.vnsi https://github.com/FernetMenta/pvr.vdr.vnsi 3cc618e \ No newline at end of file
diff --git a/project/cmake/addons/addons/pvr.vuplus/platforms.txt b/project/cmake/addons/addons/pvr.vuplus/platforms.txt
new file mode 100644
index 0000000000..baa6044435
--- /dev/null
+++ b/project/cmake/addons/addons/pvr.vuplus/platforms.txt
@@ -0,0 +1 @@
+all \ No newline at end of file
diff --git a/project/cmake/addons/addons/pvr.vuplus/pvr.vuplus.txt b/project/cmake/addons/addons/pvr.vuplus/pvr.vuplus.txt
new file mode 100644
index 0000000000..e3983d824f
--- /dev/null
+++ b/project/cmake/addons/addons/pvr.vuplus/pvr.vuplus.txt
@@ -0,0 +1 @@
+pvr.vuplus https://github.com/kodi-pvr/pvr.vuplus 6acc177 \ No newline at end of file
diff --git a/project/cmake/addons/addons/pvr.wmc/platforms.txt b/project/cmake/addons/addons/pvr.wmc/platforms.txt
new file mode 100644
index 0000000000..baa6044435
--- /dev/null
+++ b/project/cmake/addons/addons/pvr.wmc/platforms.txt
@@ -0,0 +1 @@
+all \ No newline at end of file
diff --git a/project/cmake/addons/addons/pvr.wmc/pvr.wmc.txt b/project/cmake/addons/addons/pvr.wmc/pvr.wmc.txt
new file mode 100644
index 0000000000..1be8ad5c8d
--- /dev/null
+++ b/project/cmake/addons/addons/pvr.wmc/pvr.wmc.txt
@@ -0,0 +1 @@
+pvr.wmc https://github.com/kodi-pvr/pvr.wmc e4b5285 \ No newline at end of file
diff --git a/project/cmake/addons/depends/common/kodi-platform/deps.txt b/project/cmake/addons/depends/common/kodi-platform/deps.txt
new file mode 100644
index 0000000000..f0e8246220
--- /dev/null
+++ b/project/cmake/addons/depends/common/kodi-platform/deps.txt
@@ -0,0 +1,2 @@
+kodi
+tinyxml \ No newline at end of file
diff --git a/project/cmake/addons/depends/common/kodi-platform/kodi-platform.txt b/project/cmake/addons/depends/common/kodi-platform/kodi-platform.txt
new file mode 100644
index 0000000000..fb6916adf2
--- /dev/null
+++ b/project/cmake/addons/depends/common/kodi-platform/kodi-platform.txt
@@ -0,0 +1 @@
+kodi-platform https://github.com/xbmc/kodi-platform 68315f0
diff --git a/project/cmake/addons/depends/common/tinyxml/CMakeLists.txt b/project/cmake/addons/depends/common/tinyxml/CMakeLists.txt
new file mode 100644
index 0000000000..5468bfb9d2
--- /dev/null
+++ b/project/cmake/addons/depends/common/tinyxml/CMakeLists.txt
@@ -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)
diff --git a/project/cmake/addons/depends/common/tinyxml/tinyxml.txt b/project/cmake/addons/depends/common/tinyxml/tinyxml.txt
new file mode 100644
index 0000000000..456b0c59e5
--- /dev/null
+++ b/project/cmake/addons/depends/common/tinyxml/tinyxml.txt
@@ -0,0 +1 @@
+tinyxml http://mirrors.xbmc.org/build-deps/sources/tinyxml-2.6.2_2.tar.gz
diff --git a/project/cmake/kodi-config.cmake.in b/project/cmake/kodi-config.cmake.in
index 50e12a8a71..0e3b1580ad 100644
--- a/project/cmake/kodi-config.cmake.in
+++ b/project/cmake/kodi-config.cmake.in
@@ -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@)
diff --git a/project/cmake/scripts/common/addon-helpers.cmake b/project/cmake/scripts/common/addon-helpers.cmake
index 3f42ffa595..b94df2aebd 100644
--- a/project/cmake/scripts/common/addon-helpers.cmake
+++ b/project/cmake/scripts/common/addon-helpers.cmake
@@ -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})
diff --git a/project/cmake/scripts/common/check_target_platform.cmake b/project/cmake/scripts/common/check_target_platform.cmake
index 19a9d1410c..fc8b4036df 100644
--- a/project/cmake/scripts/common/check_target_platform.cmake
+++ b/project/cmake/scripts/common/check_target_platform.cmake
@@ -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()
diff --git a/project/cmake/scripts/common/handle-depends.cmake b/project/cmake/scripts/common/handle-depends.cmake
index 145d1242e1..b3bf3cd531 100644
--- a/project/cmake/scripts/common/handle-depends.cmake
+++ b/project/cmake/scripts/common/handle-depends.cmake
@@ -60,11 +60,12 @@ function(add_addon_depends addon searchpath)
-DENABLE_STATIC=1
-DBUILD_SHARED_LIBS=0)
# if there are no make rules override files available take care of manually passing on ARCH_DEFINES
- # TODO: figure out if we should use -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} ${ARCH_DEFINES}" and why it doesn't work
- # TODO: figure out why this doesn't work for OSX32 and IOS/ATV2
- if(NOT CMAKE_USER_MAKE_RULES_OVERRIDE AND NOT CMAKE_USER_MAKE_RULES_OVERRIDE_CXX AND NOT APPLE)
- list(APPEND BUILD_ARGS -DCMAKE_C_FLAGS=${ARCH_DEFINES}
- -DCMAKE_CXX_FLAGS=${ARCH_DEFINES})
+ if(NOT CMAKE_USER_MAKE_RULES_OVERRIDE AND NOT CMAKE_USER_MAKE_RULES_OVERRIDE_CXX)
+ # make sure we create strings, not lists
+ set(TMP_C_FLAGS "${CMAKE_C_FLAGS} ${ARCH_DEFINES}")
+ set(TMP_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARCH_DEFINES}")
+ list(APPEND BUILD_ARGS -DCMAKE_C_FLAGS=${TMP_C_FLAGS}
+ -DCMAKE_CXX_FLAGS=${TMP_CXX_FLAGS})
endif()
if(CMAKE_TOOLCHAIN_FILE)
@@ -74,26 +75,24 @@ function(add_addon_depends addon searchpath)
endif()
# if there's a CMakeLists.txt use it to prepare the build
+ set(PATCH_FILE ${BUILD_DIR}/${id}/tmp/patch.cmake)
if(EXISTS ${dir}/CMakeLists.txt)
- file(APPEND ${BUILD_DIR}/${id}/tmp/patch.cmake
+ file(APPEND ${PATCH_FILE}
"file(COPY ${dir}/CMakeLists.txt
DESTINATION ${BUILD_DIR}/${id}/src/${id})\n")
- set(PATCH_COMMAND ${CMAKE_COMMAND} -P ${BUILD_DIR}/${id}/tmp/patch.cmake)
- else()
- set(PATCH_COMMAND "")
endif()
# check if we have patches to apply
file(GLOB patches ${dir}/*.patch)
list(SORT patches)
foreach(patch ${patches})
- set(PATCH_COMMAND ${CMAKE_COMMAND} -P ${BUILD_DIR}/${id}/tmp/patch.cmake)
- file(APPEND ${BUILD_DIR}/${id}/tmp/patch.cmake
+ file(APPEND ${PATCH_FILE}
"execute_process(COMMAND patch -p1 -i ${patch})\n")
endforeach()
# if there's an install.txt use it to properly install the built files
+ set(INSTALL_COMMAND "")
if(EXISTS ${dir}/install.txt)
set(INSTALL_COMMAND INSTALL_COMMAND ${CMAKE_COMMAND}
-DINPUTDIR=${BUILD_DIR}/${id}/src/${id}-build/
@@ -104,8 +103,6 @@ function(add_addon_depends addon searchpath)
-P ${PROJECT_SOURCE_DIR}/install.cmake)
elseif(EXISTS ${dir}/noinstall.txt)
set(INSTALL_COMMAND INSTALL_COMMAND "")
- else()
- set(INSTALL_COMMAND "")
endif()
# check if there's a deps.txt containing dependencies on other libraries
@@ -116,15 +113,20 @@ function(add_addon_depends addon searchpath)
set(deps)
endif()
- if(CROSS_AUTOCONF)
- set(PATCH_COMMAND ${CMAKE_COMMAND} -P ${BUILD_DIR}/${id}/tmp/patch.cmake)
+ if(CROSS_AUTOCONF AND AUTOCONF_FILES)
foreach(afile ${AUTOCONF_FILES})
- file(APPEND ${BUILD_DIR}/${id}/tmp/patch.cmake
+ file(APPEND ${PATCH_FILE}
"message(STATUS \"AUTOCONF: copying ${afile} to ${BUILD_DIR}/${id}/src/${id}\")\n
file(COPY ${afile} DESTINATION ${BUILD_DIR}/${id}/src/${id})\n")
endforeach()
endif()
+ # if the patch file exists we need to set the PATCH_COMMAND
+ set(PATCH_COMMAND "")
+ if (EXISTS ${PATCH_FILE})
+ set(PATCH_COMMAND ${CMAKE_COMMAND} -P ${PATCH_FILE})
+ endif()
+
# prepare the setup of the call to externalproject_add()
set(EXTERNALPROJECT_SETUP PREFIX ${BUILD_DIR}/${id}
CMAKE_ARGS ${extraflags} ${BUILD_ARGS}
@@ -143,9 +145,8 @@ function(add_addon_depends addon searchpath)
GIT_TAG ${revision}
"${EXTERNALPROJECT_SETUP}")
else()
- if(WIN32)
- set(CONFIGURE_COMMAND "")
- else()
+ set(CONFIGURE_COMMAND "")
+ if(NOT WIN32)
# manually specify the configure command to be able to pass in the custom PKG_CONFIG_PATH
set(CONFIGURE_COMMAND PKG_CONFIG_PATH=${OUTPUT_DIR}/lib/pkgconfig
${CMAKE_COMMAND} -DCMAKE_LIBRARY_PATH=${OUTPUT_DIR}/lib ${extraflags} ${BUILD_ARGS}
diff --git a/project/cmake/scripts/common/prepare-env.cmake b/project/cmake/scripts/common/prepare-env.cmake
index 7edc54a78f..7df421cfc1 100644
--- a/project/cmake/scripts/common/prepare-env.cmake
+++ b/project/cmake/scripts/common/prepare-env.cmake
@@ -41,6 +41,14 @@ if(NOT EXISTS "${XBMC_INCLUDE_DIR}/")
file(MAKE_DIRECTORY ${XBMC_INCLUDE_DIR})
endif()
+# make sure C++11 is always set
+if(NOT WIN32)
+ string(REGEX MATCH "-std=(gnu|c)\\+\\+11" cxx11flag "${CMAKE_CXX_FLAGS}")
+ if(NOT cxx11flag)
+ set(CXX11_SWITCH "-std=c++11")
+ endif()
+endif()
+
# kodi-config.cmake.in (further down) expects a "prefix" variable
get_filename_component(prefix "${DEPENDS_PATH}" ABSOLUTE)
@@ -77,4 +85,4 @@ foreach(binding ${bindings})
#endif
#include \"kodi/${headerfile}\"")
endif()
-endforeach() \ No newline at end of file
+endforeach()