Develop PVR addons with new cmake build system
#1
Information 
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.

Linux:

Although in-tree buildings works well, it is recommended to build an addon outside Kodi's tree. I have created a folder "build" in the source tree of the addon.

Change to addon's build folder:
Code:
cd /home/xbmc/progs/src/pvr.demo/build

generate build environment with config for debugging
Code:
cmake -DADDONS_TO_BUILD=pvr.demo -DADDON_SRC_PREFIX=/home/xbmc/progs/src -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/home/xbmc/progs/src/xbmc/addons -DPACKAGE_ZIP=1 /home/xbmc/progs/src/xbmc/project/cmake/addons

Setup Development Environment.

Setup your IDE. I use Eclipse and just need to load the sources into my Kodi workspace.
This is done by creating a new project form an existing makefile project.

Now the addon can be built by this command. I have added it to the project settings of my Eclipse project
Code:
make -C /home/xbmc/progs/src/pvr.demo/build


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.
Reply


Messages In This Thread
Develop PVR addons with new cmake build system - by FernetMenta - 2015-02-21, 22:58
Logout Mark Read Team Forum Stats Members Help
Develop PVR addons with new cmake build system0