• 1
  • 2
  • 3
  • 4(current)
  • 5
  • 6
  • 13
Develop PVR addons with new cmake build system
#46
Here is the readme from my libretro game add-on

Building out-of-tree (recommended)

Linux

Clone the repo and create a build directory

Code:
git clone https://github.com/kodi-game/game.libretro.git
cd game.libretro
mkdir build
cd build

Generate a build environment with config for debugging

Code:
cmake -DADDONS_TO_BUILD=game.libretro \
      -DCMAKE_BUILD_TYPE=Debug \
      -DCMAKE_INSTALL_PREFIX=$HOME/workspace/xbmc/addons \
      $HOME/workspace/xbmc/project/cmake/addons

If you are developing in Eclipse, you can create a "makefile project with existing code" using game.libretro/ as the existing code location. To build, enter Properties -> "C/C++ Build" and change the build command to make -C build.

It is also possible to generate Eclipse project files with cmake

Code:
cmake -G"Eclipse CDT4 - Unix Makefiles" \
      -D_ECLIPSE_VERSION=4.4 \
      -DADDONS_TO_BUILD=game.libretro \
      -DCMAKE_BUILD_TYPE=Debug \
      -DCMAKE_INSTALL_PREFIX=$HOME/workspace/xbmc/addons \
      $HOME/workspace/xbmc/project/cmake/addons

Building in-tree (cross-compiling)

Kodi's build system will fetch the add-on from the GitHub URL and git hash specified in game.libretro.txt.

Linux

Ensure that kodi has been built successfully. Then, from the root of the source tree, run

Code:
make install DESTDIR=$HOME/kodi

Build the add-on

Code:
make -C tools/depends/target/binary-addons PREFIX=$HOME/kodi ADDONS="game.libretro"

The compiled .so can be found at

Code:
$HOME/kodi/lib/kodi/addons/game.libretro/game.libretro.so

To rebuild the add-on or compile a different one, clean the build directory

Code:
make -C tools/depends/target/binary-addons clean

Windows

First, download and install CMake.

Run the script from PR6658 to create Visual Studio project files

Code:
tools\windows\prepare-binary-addons-dev.bat

The generated solution can be found at

Code:
project\cmake\addons\build\kodi-addons.sln

OSX

Per README.osx, enter the tools/depends directory and make the add-on:

Code:
cd tools/depends
make -C target/binary-addons ADDONS="game.libretro"

To rebuild the add-on or compile a different one, clean the build directory

Code:
make -C target/binary-addons clean




Devs: is this correct? how do you build out-of-tree on windows? Non-devs: feel free to adapt these instructions for your own project
Reply
#47
Note that for the linux out of tree build, there is no need to pass ADDON_SRC_PREFIX. The addons CMakelist doesn't recognize that option. PACKAGE_ZIP is not needed as well, unless you really want to create a zip package.
Reply
#48
(2015-03-20, 09:39)wsnipex Wrote: Note that for the linux out of tree build, there is no need to pass ADDON_SRC_PREFIX. The addons CMakelist doesn't recognize that option. PACKAGE_ZIP is not needed as well, unless you really want to create a zip package.

removed them from the readme, thanks
Reply
#49
doh, forgot to add, the same goes for ADDONS_TO_BUILD. In standalone mode, there is only 1 addon.
Reply
#50
how has libretro managed to become a PVR addon? you know that this is the PVR dev section of the forum, don't you Smile
Reply
#51
game add-on

EDIT: or more technically, a game client extending "xbmc.gameclient" implementing the game API

EDIT: oh, no I didn't notice this was the PVR forum :p thought it was kodi-application dev. still, it's the same build system so the instructions should be identical
Reply
#52
Hi guys, am I missing something here? I'm a windows developer working on ServerWMC Backend and pvr.wmc addon. I used the batch file mentioned and generated a visual studio solution for pvr.wmc but none of the source files (cpp and header files) seem to be in the visual studio project?
pvr.wmc TV addon and ServerWMC Backend Development Team
http://bit.ly/ServerWMC
Reply
#53
building kodi-addon.sln will create the solution with the source files. see post #1
Reply
#54
(2015-03-21, 18:06)FernetMenta Wrote: building kodi-addon.sln will create the solution with the source files. see post #1

Ah right I get it now. Can i make a suggestion that an explanatory sentence be included at the top of the "For Windows" section in post #1 that briefly outlines at a high level what we are achieving, for those not familiar with cmake? For example something like "We will use cmake to generate a kodi-addons.sln Visual Studio solution, which will then be built to generate the actual addon's Visual Studio solution" Yes i realise the steps do walk through the required actions, but since there is no sort of "this is what we are doing at a high level" statement, I had opened the solution and built it, but somehow missed that there was then ANOTHER generated solution that actually contained the source code etc, and perhaps others may too


Also a question on paths - post #1 mentions that the kodi-addons.sln and actual addon sln are at paths

Code:
\project\cmake\addons\kodi-addons.sln
\project\cmake\addons\pvr.demo-prefix\src\pvr.demo-build\pvr.demo.sln

However at least on my system the paths are (note the \build\ folder)
Code:
\project\cmake\addons\build\kodi-addons.sln
\project\cmake\addons\build\pvr.demo-prefix\src\pvr.demo-build

Note that I used the referenced batch file to do the cmake stuff and didnt strictly follow your commands in post #1 so perhaps that is why mine are in a \build\ folder?


Thanks for the help!
pvr.wmc TV addon and ServerWMC Backend Development Team
http://bit.ly/ServerWMC
Reply
#55
(2015-03-22, 05:10)scarecrow420 Wrote: Also a question on paths - post #1 mentions that the kodi-addons.sln and actual addon sln are at paths

Code:
\project\cmake\addons\kodi-addons.sln
\project\cmake\addons\pvr.demo-prefix\src\pvr.demo-build\pvr.demo.sln

However at least on my system the paths are (note the \build\ folder)
Code:
\project\cmake\addons\build\kodi-addons.sln
\project\cmake\addons\build\pvr.demo-prefix\src\pvr.demo-build

Note that I used the referenced batch file to do the cmake stuff and didnt strictly follow your commands in post #1 so perhaps that is why mine are in a \build\ folder?


Thanks for the help!

Yup the paths you see in your build system are correct.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#56
Cool, perhaps fernetmenta can update the paths in post #1
pvr.wmc TV addon and ServerWMC Backend Development Team
http://bit.ly/ServerWMC
Reply
#57
(2015-03-22, 12:41)scarecrow420 Wrote: Cool, perhaps fernetmenta can update the paths in post #1

post #1 is correct. Montellese sets a build folder in his script which results in this different path.

EDIT: i will set this folder too and update post #1
Reply
#58
(2015-03-20, 16:22)wsnipex Wrote: doh, forgot to add, the same goes for ADDONS_TO_BUILD. In standalone mode, there is only 1 addon.

this doesn't seem to be correct. if I omit ADDONS_TO_BUILD, *all* add-ons are fetched (not sure if they're built tho, didn't wait that long)
Reply
#59
*standalone build*
Reply
#60
right,

Code:
git clone ...game.libretro.git
cd game.libretro
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug \
      -DCMAKE_INSTALL_PREFIX=$HOME/workspace/xbmc/addons \
      $HOME/workspace/xbmc/project/cmake/addons

without adding -DADDONS_TO_BUILD=game.libretro it downloads all add-ons
Reply
  • 1
  • 2
  • 3
  • 4(current)
  • 5
  • 6
  • 13

Logout Mark Read Team Forum Stats Members Help
Develop PVR addons with new cmake build system0