Develop PVR addons with new cmake build system

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
FernetMenta Offline
Team-Kodi Developer
Posts: 6,190
Joined: Jul 2010
Reputation: 140
Location: Munich
Post: #181
Unfortunately the bootstrapping method is cumbersome and not developer friendly. If you want to build an addon that is not the repo, you have to create some files yourself. Build for example pvr.demo and check the cmake/addons folder for generated files. Modify those to fit you local addon.
find quote
Philipp91 Offline
Junior Member
Posts: 3
Joined: Mar 2017
Reputation: 0
Post: #182
Does post #1 need an update (for Windows) because xbmc\project\cmake is now xbmc\cmake?

// Edit: And the names of c-flag-overrides.cmake and cxx-flag-overrides.cmake have changed.

Windows build fails on my machine: http://pastebin.com/5xVr8Ak0
Line 74-81 error C2440: "return": "PTSTR" cannot be converted to "PSTR"
regarding source line xbmc\cmake\addons\build\depends\include\p8-platform/util/StdString.h(1019): inline PSTR SST2A(PTSTR p) { return p; }
(This post was last modified: 2017-03-18 17:27 by Philipp91.)
find quote
popy Offline
Senior Member
Posts: 213
Joined: Nov 2008
Reputation: 1
Post: #183
(2016-04-22 00:07)tester100 Wrote:  
(2015-02-21 22:58)FernetMenta Wrote:  We have changed the build system for PVR addons. Now they are built with cmake and every addon has its own repository.
CMake (http://www.cmake.org/Wiki/CMake) generates the build environment required for a particular platform.

Team-Kodi provides the infrastructure to build PVR addons for the supported plattforms. The addons are maintained in their
own repositories from where the build process loads them. The repository is specified in a .txt file in the Kodi source
tree. For the pvr.demo addon this is in home/xbmc/progs/src/xbmc/project/cmake/addons/addons/pvr.demo/pvr.demo.txt.
You can clone this repository to any location of your system. You also need to clone the Kodi repository which contains
common files, libs, and API for the addons.

For setup of an development environment follow these steps. The examples are with absolute paths. You can substitute
the path to match your systems.



Windows:

Change to addons folder:
Code:
cd D:\Projects\xbmx\xbmc\project\cmake\addons\build

Generate build environment with config for debugging. This command generates a Visual Studio 2013 solution.
Code:
cmake -DADDONS_TO_BUILD="pvr.demo" -DADDON_SRC_PREFIX="D:\Projects" -DCMAKE_BUILD_TYPE=Debug -G "Visual Studio 12"  -DCMAKE_USER_MAKE_RULES_OVERRIDE="D:\Projects\xbmx\xbmc\project\cmake\scripts\windows\c-flag-overrides.cmake" -DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX="D:\Projects\xbmx\xbmc\project\cmake\scripts\windows\cxx-flag-overrides.cmake" -DCMAKE_INSTALL_PREFIX="D:\Projects\xbmx\xbmc\addons" -DBUILD_DIR="D:\Projects\xbmx\xbmc\project\cmake\addons\build" -DPACKAGE_ZIP=1 "D:\Projects\xbmx\xbmc\project\cmake\addons"

Open Visual Studio, load and build this solution:
Code:
D:\Projects\xbmx\xbmc\project\cmake\addons\build\kodi-addons.sln

Setup Development Environment.

Open Visual Studio, load Kodi solution. Then add existing solution:
Code:
D:\Projects\xbmx\xbmc\project\cmake\addons\build\pvr.demo-prefix\src\pvr.demo-build\pvr.demo.sln

Create post-build step. Required to copy files for debugging

Create Post-Build Event in Visual Studio
Code:
tbd

For a more convenient method see post #9, credits to Montellese who provided this script.




Hi lads

i am getting issue to compile the pvr.demo addon.

basically its saing that i have a cmake generator error.

i am using vs2013 with 12.0 v120 to compile kodi 16 jarvis without any issues i can buil setup install.exe ok and kodi.exe app exe just fine no issues at all my only issue is building it with the addon also this is my log

This is my message log


Quote:[email protected] MINGW64 /c/xbmc/project/cmake/addons/build (Jarvis)

$ cmake -DADDONS_TO_BUILD="pvr.demo" -DADDON_SRC_PREFIX="C:\xbmc" -DCMAKE_BUILD_TYPE=Debug -G "Visual Studio 12" -DCMAKE_USER_MAKE_RULES_OVERRIDE="C:\xbmc\project\cmake\scripts\windows\c-flag-overrides.cmake" -DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX="c:\xbmc\project\cmake\scripts\windows\cxx-flag-overrides.cmake" -DCMAKE_INSTALL_PREFIX="C:\xbmc\addons" -DBUILD_DIR="C:\xbmc\project\cmake\addons\build" -DPACKAGE_ZIP=1 "C:\xbmc\project\cmake\addons"

CMake Error: Error: generator : Visual Studio 12 2013
Does not match the generator used previously: NMake Makefiles
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.

btw i am using cmake.exe 3.5x is that an issue or do i need a previous version?

Hey succussfully built kodi v17 krypton incl all pvr addons on windows 10 x64, just followed the how to here: HOW-TO:Compile_Kodi_for_Windows (wiki)
The BuildSetup.bat builds the complete kodi incl. all addons, youll get the kodi setup exe.

When you just want to build one addon (in my case pvr.mediaportal.tvserver) you have to run:


Code:
tools\buildsteps\win32\make-addons.bat addon pvr.mediaportal.tvserver

So far so good but ill want to modify something, in my case: project\cmake\addons\build\pvr.mediaportal.tvserver\src\GUIDialogRecordSettings.​cpp
When ill do so and recompile with the above command the make-addons.bat extracting the source again and overwrites my changes.

What i am doing wrong?

thx
pOpY
(This post was last modified: 2017-06-19 19:59 by popy.)
find quote
popy Offline
Senior Member
Posts: 213
Joined: Nov 2008
Reputation: 1
Post: #184
Update: I have created a solution using a modified version of this "prepare-addons-dev.bat" to work with VS 2015 (v14):

https://gist.github.com/Montellese/149ecbd5ca20941d2be4
https://forum.kodi.tv/showthread.php?tid...pid1935737

if anybody wants it, i can upload it.

pOpY
find quote
garbear Offline
Team-Kodi Developer
Posts: 1,750
Joined: Dec 2010
Reputation: 112
Location: city of angels
Post: #185
(2017-06-19 19:57)popy Wrote:  Hey succussfully built kodi v17 krypton incl all pvr addons on windows 10 x64, just followed the how to here: HOW-TO:Compile_Kodi_for_Windows (wiki)
The BuildSetup.bat builds the complete kodi incl. all addons, youll get the kodi setup exe.

When you just want to build one addon (in my case pvr.mediaportal.tvserver) you have to run:


Code:
tools\buildsteps\win32\make-addons.bat addon pvr.mediaportal.tvserver

So far so good but ill want to modify something, in my case: project\cmake\addons\build\pvr.mediaportal.tvserver\src\GUIDialogRecordSettings.​cpp
When ill do so and recompile with the above command the make-addons.bat extracting the source again and overwrites my changes.

What i am doing wrong?

thx
pOpY

make-addons.bat is used when packaging add-ons for release. If you're developing, there's another script you should use: tools\windows\prepare-binary-addons-dev.bat. This will download the source locally and build from there. Follow the descriptions in my README, particularly the Developing on Windows section.

BTC: 1JtXwJdGdE9YnYgThWBT2StFCU5sEYkbVD (personal), https://kodi.tv/contribute/donate-bitcoin (foundation). Donations in the form of controllers, especially ones that don't work in Kodi, are also appreciated.
find quote
popy Offline
Senior Member
Posts: 213
Joined: Nov 2008
Reputation: 1
Post: #186
(2017-06-19 22:38)garbear Wrote:  
(2017-06-19 19:57)popy Wrote:  Hey succussfully built kodi v17 krypton incl all pvr addons on windows 10 x64, just followed the how to here: HOW-TO:Compile_Kodi_for_Windows (wiki)
The BuildSetup.bat builds the complete kodi incl. all addons, youll get the kodi setup exe.

When you just want to build one addon (in my case pvr.mediaportal.tvserver) you have to run:


Code:
tools\buildsteps\win32\make-addons.bat addon pvr.mediaportal.tvserver

So far so good but ill want to modify something, in my case: project\cmake\addons\build\pvr.mediaportal.tvserver\src\GUIDialogRecordSettings.​cpp
When ill do so and recompile with the above command the make-addons.bat extracting the source again and overwrites my changes.

What i am doing wrong?

thx
pOpY

make-addons.bat is used when packaging add-ons for release. If you're developing, there's another script you should use: tools\windows\prepare-binary-addons-dev.bat. This will download the source locally and build from there. Follow the descriptions in my README, particularly the Developing on Windows section.
Thx, for the hint.
Haven't seen that on github.
Just readed the wiki




Gesendet von meinem LG-H815 mit Tapatalk
find quote
Post Reply