summaryrefslogtreecommitdiffstats
path: root/cmake/scripts/common/AddonHelpers.cmake
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2018-01-01 13:40:09 +0100
committermanuel <manuel@mausz.at>2018-01-01 13:40:09 +0100
commit4830f27a40323fe859dc166337a2b861877b7121 (patch)
tree39e9f712a5415ec0026c3914f4bf600b2f679287 /cmake/scripts/common/AddonHelpers.cmake
parent0afb1d4d51973cf52973617c92236d851a039d31 (diff)
downloadkodi-pvr-build-4830f27a40323fe859dc166337a2b861877b7121.tar.gz
kodi-pvr-build-4830f27a40323fe859dc166337a2b861877b7121.tar.bz2
kodi-pvr-build-4830f27a40323fe859dc166337a2b861877b7121.zip
sync with upstream
Diffstat (limited to 'cmake/scripts/common/AddonHelpers.cmake')
-rw-r--r--cmake/scripts/common/AddonHelpers.cmake19
1 files changed, 15 insertions, 4 deletions
diff --git a/cmake/scripts/common/AddonHelpers.cmake b/cmake/scripts/common/AddonHelpers.cmake
index 2fafe79..c11923e 100644
--- a/cmake/scripts/common/AddonHelpers.cmake
+++ b/cmake/scripts/common/AddonHelpers.cmake
@@ -52,7 +52,8 @@ macro (build_addon target prefix libs)
52 # Read used headers from addon, needed to identitfy used kodi addon interface headers 52 # Read used headers from addon, needed to identitfy used kodi addon interface headers
53 if(${prefix}_HEADERS) 53 if(${prefix}_HEADERS)
54 # Add the used header files defined with CMakeLists.txt from addon itself 54 # Add the used header files defined with CMakeLists.txt from addon itself
55 if(${prefix}_HEADERS MATCHES ${PROJECT_SOURCE_DIR}) 55 string(FIND "${${prefix}_HEADERS}" "${PROJECT_SOURCE_DIR}" position)
56 if(position GREATER -1)
56 # include path name already complete 57 # include path name already complete
57 list(APPEND USED_SOURCES ${${prefix}_HEADERS}) 58 list(APPEND USED_SOURCES ${${prefix}_HEADERS})
58 else() 59 else()
@@ -75,7 +76,8 @@ macro (build_addon target prefix libs)
75 endif() 76 endif()
76 77
77 # Add the used source files defined with CMakeLists.txt from addon itself 78 # Add the used source files defined with CMakeLists.txt from addon itself
78 if(${prefix}_SOURCES MATCHES ${PROJECT_SOURCE_DIR}) 79 string(FIND "${${prefix}_SOURCES}" "${PROJECT_SOURCE_DIR}" position)
80 if(position GREATER -1)
79 # include path name already complete 81 # include path name already complete
80 list(APPEND USED_SOURCES ${${prefix}_SOURCES}) 82 list(APPEND USED_SOURCES ${${prefix}_SOURCES})
81 else() 83 else()
@@ -228,7 +230,9 @@ macro (build_addon target prefix libs)
228 set(CPACK_COMPONENTS_IGNORE_GROUPS 1) 230 set(CPACK_COMPONENTS_IGNORE_GROUPS 1)
229 list(APPEND CPACK_COMPONENTS_ALL ${target}-${${prefix}_VERSION}) 231 list(APPEND CPACK_COMPONENTS_ALL ${target}-${${prefix}_VERSION})
230 # Pack files together to create an archive 232 # Pack files together to create an archive
231 install(DIRECTORY ${target} DESTINATION ./ COMPONENT ${target}-${${prefix}_VERSION} PATTERN "*.xml.in" EXCLUDE) 233 install(DIRECTORY ${target} DESTINATION ./
234 COMPONENT ${target}-${${prefix}_VERSION}
235 REGEX ".+\\.xml\\.in(clude)?$" EXCLUDE)
232 if(WIN32) 236 if(WIN32)
233 if(NOT CPACK_PACKAGE_DIRECTORY) 237 if(NOT CPACK_PACKAGE_DIRECTORY)
234 # determine the temporary path 238 # determine the temporary path
@@ -321,7 +325,8 @@ macro (build_addon target prefix libs)
321 if (${prefix}_CUSTOM_BINARY) 325 if (${prefix}_CUSTOM_BINARY)
322 install(FILES ${LIBRARY_LOCATION} DESTINATION ${CMAKE_INSTALL_LIBDIR}/addons/${target} RENAME ${LIBRARY_FILENAME}) 326 install(FILES ${LIBRARY_LOCATION} DESTINATION ${CMAKE_INSTALL_LIBDIR}/addons/${target} RENAME ${LIBRARY_FILENAME})
323 endif() 327 endif()
324 install(DIRECTORY ${target} DESTINATION ${CMAKE_INSTALL_DATADIR}/addons PATTERN "*.xml.in" EXCLUDE) 328 install(DIRECTORY ${target} DESTINATION ${CMAKE_INSTALL_DATADIR}/addons
329 REGEX ".+\\.xml\\.in(clude)?$" EXCLUDE)
325 if(${prefix}_CUSTOM_DATA) 330 if(${prefix}_CUSTOM_DATA)
326 install(DIRECTORY ${${prefix}_CUSTOM_DATA} DESTINATION ${CMAKE_INSTALL_DATADIR}/addons/${target}/resources) 331 install(DIRECTORY ${${prefix}_CUSTOM_DATA} DESTINATION ${CMAKE_INSTALL_DATADIR}/addons/${target}/resources)
327 endif() 332 endif()
@@ -348,6 +353,12 @@ macro (build_addon target prefix libs)
348 COMMAND ${CMAKE_COMMAND} -E copy 353 COMMAND ${CMAKE_COMMAND} -E copy
349 ${LIBRARY_LOCATION} 354 ${LIBRARY_LOCATION}
350 ${${APP_NAME_UC}_BUILD_DIR}/addons/${target}/${LIBRARY_FILENAME}) 355 ${${APP_NAME_UC}_BUILD_DIR}/addons/${target}/${LIBRARY_FILENAME})
356 if(${prefix}_ADDITIONAL_BINARY)
357 add_custom_command(TARGET ${target} POST_BUILD
358 COMMAND ${CMAKE_COMMAND} -E copy
359 ${${prefix}_ADDITIONAL_BINARY}
360 ${${APP_NAME_UC}_BUILD_DIR}/addons/${target})
361 endif()
351 endif() 362 endif()
352endmacro() 363endmacro()
353 364