Kodi Community Forum
Get Addon and Kod versions in PVR Addon - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+---- Forum: PVR (https://forum.kodi.tv/forumdisplay.php?fid=136)
+---- Thread: Get Addon and Kod versions in PVR Addon (/showthread.php?tid=339152)



Get Addon and Kod versions in PVR Addon - phunkyfish - 2019-01-08

I can't find an obvious way of doing this. I would like to perform some cleanup actions when the addon is updated which I can do if I store the addon version. As a last resort I could read it from addon.xml.

I can do something like this for addon name and path but it doesn't work for version:

Code:

char buffer[1024];
XBMC->GetSetting("__addonpath__", buffer);

Thanks in advnace


RE: Get Addon and Kod versions in PVR Addon - phunkyfish - 2019-01-17

Added the following to CMakeLists.txt

Code:
addon_version(pvr.vuplus VUPLUS)
add_definitions(-DVUPLUS_VERSION=${VUPLUS_VERSION})

Can then be accessed from source usingĀ 
Code:
STR(VUPLUS_VERSION)