Skip to content

Commit

Permalink
[deps] add RapidJSON dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
CastagnaIT committed Nov 5, 2023
1 parent f30c7b4 commit 91ac8fa
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ set(DECRYPTERPATH "special://home/cdm")
find_package(Kodi REQUIRED)
find_package(pugixml REQUIRED)
find_package(Bento4 REQUIRED)
find_package(RAPIDJSON REQUIRED)

if(WIN32)
if(MSVC)
Expand Down Expand Up @@ -59,6 +60,7 @@ endif()

list(APPEND DEPLIBS ${PUGIXML_LIBRARIES}
${BENTO4_LIBRARIES}
${RAPIDJSON_LIBRARIES}
mpegts
webm_parser
)
Expand Down
37 changes: 37 additions & 0 deletions FindRAPIDJSON.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Try find RapidJSON
#
# The following variables are set when RapidJSON is found:
# RAPIDJSON_FOUND = Set to true, if all components of RapidJSON have been found.
# RAPIDJSON_INCLUDES = Include path for the header files of RapidJSON
# RAPIDJSON_LIBRARIES = Link these to use RapidJSON

if (NOT RAPIDJSON_FOUND)
if (NOT RAPIDJSON_ROOT_DIR)
set (RAPIDJSON_ROOT_DIR ${CMAKE_INSTALL_PREFIX})
endif (NOT RAPIDJSON_ROOT_DIR)

find_path (RAPIDJSON_INCLUDES
NAMES rapidjson/rapidjson.h rapidjson/reader.h rapidjson/writer.h
HINTS ${RAPIDJSON_ROOT_DIR} ${CMAKE_INSTALL_PREFIX}
PATH_SUFFIXES include
)

find_package_handle_standard_args (RAPIDJSON DEFAULT_MSG RAPIDJSON_INCLUDES)

if (RAPIDJSON_FOUND)
get_filename_component (RAPIDJSON_ROOT_DIR ${RAPIDJSON_INCLUDES} PATH)

if (NOT RAPIDJSON_FIND_QUIETLY)
message (STATUS "Found components for RapidJSON")
message (STATUS "RAPIDJSON_ROOT_DIR = ${RAPIDJSON_ROOT_DIR}")
message (STATUS "RAPIDJSON_INCLUDES = ${RAPIDJSON_INCLUDES}")
endif (NOT RAPIDJSON_FIND_QUIETLY)
else (RAPIDJSON_FOUND)
if (RAPIDJSON_FIND_REQUIRED)
message (FATAL_ERROR "Could not find RapidJSON!")
endif (RAPIDJSON_FIND_REQUIRED)
endif (RAPIDJSON_FOUND)

mark_as_advanced(RAPIDJSON_ROOT_DIR RAPIDJSON_INCLUDES)

endif (NOT RAPIDJSON_FOUND)
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Source: kodi-inputstream-adaptive
Priority: extra
Maintainer: Team Kodi <dummy@kodi.tv>
Build-Depends: debhelper (>= 9.0.0), cmake, libgtest-dev,
kodi-addon-dev, pkg-config, libpugixml-dev
kodi-addon-dev, pkg-config, libpugixml-dev, rapidjson-dev
Standards-Version: 3.9.8
Section: libs
Homepage: https://kodi.tv
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -151,11 +151,7 @@ SET(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "The direct
SET(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE STRING "Directory where lib will install")
SET(DOC_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/doc/${PROJECT_NAME}" CACHE PATH "Path to the documentation")

-IF(UNIX OR CYGWIN)
- SET(_CMAKE_INSTALL_DIR "${LIB_INSTALL_DIR}/cmake/${PROJECT_NAME}")
-ELSEIF(WIN32)
- SET(_CMAKE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/cmake")
-ENDIF()
+SET(_CMAKE_INSTALL_DIR "${LIB_INSTALL_DIR}/cmake/${PROJECT_NAME}")
SET(CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" CACHE PATH "The directory cmake files are installed in")

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
1 change: 1 addition & 0 deletions depends/common/rapidjson/flags.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-DRAPIDJSON_BUILD_DOC=OFF -DRAPIDJSON_BUILD_EXAMPLES=OFF -DRAPIDJSON_BUILD_TESTS=OFF -DRAPIDJSON_BUILD_CXX17=ON -DRAPIDJSON_HAS_STDSTRING=ON
1 change: 1 addition & 0 deletions depends/common/rapidjson/rapidjson.sha256
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2b521dba5c22eaae6e6e7d4d304cb317e2cf8c687c70046b02792c02f78c127e
1 change: 1 addition & 0 deletions depends/common/rapidjson/rapidjson.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rapidjson https://github.com/Tencent/rapidjson/archive/f9d53419e912910fd8fa57d5705fa41425428c35.tar.gz

0 comments on commit 91ac8fa

Please sign in to comment.