Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 5 additions & 3 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,16 @@ ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '(["/]PlatformDefs|"(system|system_gl))\.h"'
Priority: 5
- Regex: '"platform/[^/]+/'
Priority: 2
- Regex: '^<[a-z0-9_]+>$'
Priority: 3
- Regex: '^<(assert|complex|ctype|errno|fenv|float|inttypes|iso646|limits|locale|math|setjmp|signal|stdalign|stdarg|stdatomic|stdbool|stddef|stdint|stdio|stdlib|stdnoreturn|string|tgmath|threads|time|uchar|wchar|wctype)\.h>$'
Priority: 3
- Regex: '^<'
Priority: 3
- Regex: '^["<](kodi)\/.*\.h[">]$'
Priority: 2
Priority: 4
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
Expand Down
84 changes: 46 additions & 38 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,42 +1,50 @@
.build
.cproject
.deps
.libs
.project

.dummy
.dummy.in
.kdev4
# build artifacts
build/
web.*/addon.xml

# Debian build files
debian/changelog
debian/files
debian/*.log
debian/*.substvars
debian/.debhelper/
debian/tmp/
debian/kodi-web-*/
obj-x86_64-linux-gnu/

# commonly used editors
# vim
*.swp

# Eclipse
*.project
*.cproject
.classpath
*.sublime-*
.settings/

# KDevelop 4
*.kdev4

web.*/addon.xml
lib/cef/

*.o
*.a
*.P
*.lo
*.la
*.pvr
*.zip
*.patch
*.orig
*.diff

*.idb
*.tlog
*.lastbuildstate

# Windows specific generated files
*.exp
*.lib
*.pdb
*.ilk
*.suo
*.sdf
*.opensdf
*.vcxproj.user
# gedit
*~

build/
# CLion
/.idea

# clion
.idea/

# to prevent add after a "git format-patch VALUE" and "git add ." call
/*.patch

# Visual Studio Code
.vscode

# to prevent add if project code opened by Visual Studio over CMake file
.vs/
VS2013Kodi_AddonProject/

# General MacOS
.DS_Store
.AppleDouble
.LSOverride
87 changes: 51 additions & 36 deletions CMake/FindOpenGLES.cmake
Original file line number Diff line number Diff line change
@@ -1,54 +1,69 @@
#.rst:
# FindOpenGLES
# ------------
# Finds the OpenGLES2 library
# Finds the OpenGLES2 and OpenGLES3 library
#
# This will define the following variables::
# This will define the following variables:
#
# OPENGLES_FOUND - system has OpenGLES
# OPENGLES_INCLUDE_DIRS - the OpenGLES include directory
# OPENGLES_LIBRARIES - the OpenGLES libraries
# OPENGLES_DEFINITIONS - the OpenGLES definitions
#
# Note:
# On Windows with angle the *_INCLUDE_DIRS and
# *_DEFINITIONS are undefined, but are set
# global by the kodi-angle package.

if(CORE_PLATFORM_NAME_LC STREQUAL rbpi)
set(_brcmprefix brcm)
endif()
if(WIN32)
# defined here and not on addon to have it free of OS related 'if'
# and this file as standard for addons where need it
find_package(kodi-angle REQUIRED)
set(OPENGLES_LIBRARIES kodi::angle::libGLESv2 kodi::angle::libEGL)
set(OPENGLES_FOUND ${kodi-angle_FOUND})
set(OPENGLES_DEFINITIONS -DHAS_GLES=3)
else()
if(CORE_PLATFORM_NAME_LC STREQUAL rbpi)
set(_brcmprefix brcm)
endif()

if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_OPENGLES ${_brcmprefix}glesv2 QUIET)
endif()
if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_OPENGLES ${_brcmprefix}glesv2 QUIET)
endif()

if(NOT CORE_SYSTEM_NAME STREQUAL ios)
find_path(OPENGLES_INCLUDE_DIR GLES2/gl2.h
PATHS ${PC_OPENGLES_INCLUDEDIR})
find_library(OPENGLES_gl_LIBRARY NAMES ${_brcmprefix}GLESv2
PATHS ${PC_OPENGLES_LIBDIR})
else()
find_library(OPENGLES_gl_LIBRARY NAMES OpenGLES
PATHS ${CMAKE_OSX_SYSROOT}/System/Library
PATH_SUFFIXES Frameworks
NO_DEFAULT_PATH)
set(OPENGLES_INCLUDE_DIR ${OPENGLES_gl_LIBRARY}/Headers)
endif()
if(NOT CORE_SYSTEM_NAME STREQUAL ios AND
NOT CORE_SYSTEM_NAME STREQUAL darwin_embedded)
find_path(OPENGLES_INCLUDE_DIR GLES2/gl2.h
PATHS ${PC_OPENGLES_INCLUDEDIR})
find_library(OPENGLES_gl_LIBRARY NAMES ${_brcmprefix}GLESv2
PATHS ${PC_OPENGLES_LIBDIR})
else()
find_library(OPENGLES_gl_LIBRARY NAMES OpenGLES
PATHS ${CMAKE_OSX_SYSROOT}/System/Library
PATH_SUFFIXES Frameworks
NO_DEFAULT_PATH)
set(OPENGLES_INCLUDE_DIR ${OPENGLES_gl_LIBRARY}/Headers)
endif()

find_path(OPENGLES3_INCLUDE_DIR GLES3/gl3.h)
find_path(OPENGLES3_INCLUDE_DIR GLES3/gl3.h)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OpenGLES
REQUIRED_VARS OPENGLES_gl_LIBRARY OPENGLES_INCLUDE_DIR)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OpenGLES
REQUIRED_VARS OPENGLES_gl_LIBRARY OPENGLES_INCLUDE_DIR)

find_path(OPENGLES3_INCLUDE_DIR GLES3/gl3.h
PATHS ${PC_OPENGLES_INCLUDEDIR})
find_path(OPENGLES3_INCLUDE_DIR GLES3/gl3.h
PATHS ${PC_OPENGLES_INCLUDEDIR})

if(OPENGLES_FOUND)
set(OPENGLES_LIBRARIES ${OPENGLES_gl_LIBRARY})
if(OPENGLES3_INCLUDE_DIR)
set(OPENGLES_INCLUDE_DIRS ${OPENGLES_INCLUDE_DIR} ${OPENGLES3_INCLUDE_DIR})
set(OPENGLES_DEFINITIONS -DHAS_GLES=3)
mark_as_advanced(OPENGLES_INCLUDE_DIR OPENGLES3_INCLUDE_DIR OPENGLES_gl_LIBRARY)
else()
set(OPENGLES_INCLUDE_DIRS ${OPENGLES_INCLUDE_DIR})
set(OPENGLES_DEFINITIONS -DHAS_GLES=2)
mark_as_advanced(OPENGLES_INCLUDE_DIR OPENGLES_gl_LIBRARY)
if(OPENGLES_FOUND)
set(OPENGLES_LIBRARIES ${OPENGLES_gl_LIBRARY})
if(OPENGLES3_INCLUDE_DIR)
set(OPENGLES_INCLUDE_DIRS ${OPENGLES_INCLUDE_DIR} ${OPENGLES3_INCLUDE_DIR})
set(OPENGLES_DEFINITIONS -DHAS_GLES=3)
mark_as_advanced(OPENGLES_INCLUDE_DIR OPENGLES3_INCLUDE_DIR OPENGLES_gl_LIBRARY)
else()
set(OPENGLES_INCLUDE_DIRS ${OPENGLES_INCLUDE_DIR})
set(OPENGLES_DEFINITIONS -DHAS_GLES=2)
mark_as_advanced(OPENGLES_INCLUDE_DIR OPENGLES_gl_LIBRARY)
endif()
endif()
endif()
24 changes: 24 additions & 0 deletions CMake/FindTinyXML.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# - Find TinyXML
# Find the native TinyXML includes and library
#
# TINYXML_FOUND - True if TinyXML found.
# TINYXML_INCLUDE_DIRS - where to find tinyxml.h, etc.
# TINYXML_LIBRARIES - List of libraries when using TinyXML.
#

find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_TINYXML tinyxml QUIET)
endif()

find_path(TINYXML_INCLUDE_DIRS NAMES tinyxml.h
PATHS ${PC_TINYXML_INCLUDEDIR}
PATH_SUFFIXES tinyxml)
find_library(TINYXML_LIBRARIES NAMES tinyxml
PATHS ${PC_TINYXML_LIBDIR}
PATH_SUFFIXES tinyxml)

include("FindPackageHandleStandardArgs")
find_package_handle_standard_args(TinyXML REQUIRED_VARS TINYXML_INCLUDE_DIRS TINYXML_LIBRARIES)

mark_as_advanced(TINYXML_INCLUDE_DIRS TINYXML_LIBRARIES)
25 changes: 25 additions & 0 deletions CMake/Findglm.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#.rst:
# Findglm
# ------------
# Finds the OpenGL Mathematics (GLM) as a header only C++ mathematics library.
#
# This will define the following variables:
#
# GLM_FOUND - system has OpenGLES
# GLM_INCLUDE_DIR - the OpenGLES include directory
#
# Note: Install was removed from GLM on version 0.9.9.6.

find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_GLM glm QUIET)
endif()

find_path(GLM_INCLUDE_DIR glm.hpp
PATHS ${PC_GLM_INCLUDEDIR}
PATH_SUFFIXES glm)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(glm REQUIRED_VARS GLM_INCLUDE_DIR)

mark_as_advanced(GLM_INCLUDE_DIR)
4 changes: 4 additions & 0 deletions CMake/Macros.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
macro(core_add_library name)
add_library(${name} STATIC ${SOURCES} ${HEADERS})
set(CORE_LIBRARY ${name} ${CORE_LIBRARY} PARENT_SCOPE)
endmacro()
Loading