diff options
Diffstat (limited to 'project/cmake/scripts/common/macros.cmake')
| -rw-r--r-- | project/cmake/scripts/common/macros.cmake | 383 |
1 files changed, 0 insertions, 383 deletions
diff --git a/project/cmake/scripts/common/macros.cmake b/project/cmake/scripts/common/macros.cmake deleted file mode 100644 index 0900740..0000000 --- a/project/cmake/scripts/common/macros.cmake +++ /dev/null | |||
| @@ -1,383 +0,0 @@ | |||
| 1 | # This script holds the main functions used to construct the build system | ||
| 2 | |||
| 3 | # include system specific macros | ||
| 4 | include(${CORE_SOURCE_DIR}/project/cmake/scripts/${CORE_SYSTEM_NAME}/macros.cmake) | ||
| 5 | |||
| 6 | # Add a library, optionally as a dependency of the main application | ||
| 7 | # Arguments: | ||
| 8 | # name name of the library to add | ||
| 9 | # Optional Arguments: | ||
| 10 | # NO_MAIN_DEPENDS if specified, the library is not added to main depends | ||
| 11 | # Implicit arguments: | ||
| 12 | # SOURCES the sources of the library | ||
| 13 | # HEADERS the headers of the library (only for IDE support) | ||
| 14 | # OTHERS other library related files (only for IDE support) | ||
| 15 | # On return: | ||
| 16 | # Library will be built, optionally added to ${core_DEPENDS} | ||
| 17 | function(core_add_library name) | ||
| 18 | cmake_parse_arguments(arg "NO_MAIN_DEPENDS" "" "" ${ARGN}) | ||
| 19 | |||
| 20 | if(NOT SOURCES) | ||
| 21 | message(STATUS "No sources added to ${name} skipping") | ||
| 22 | return() | ||
| 23 | endif() | ||
| 24 | |||
| 25 | add_library(${name} STATIC ${SOURCES} ${HEADERS} ${OTHERS}) | ||
| 26 | set_target_properties(${name} PROPERTIES PREFIX "") | ||
| 27 | if(NOT arg_NO_MAIN_DEPENDS) | ||
| 28 | set(core_DEPENDS ${name} ${core_DEPENDS} CACHE STRING "" FORCE) | ||
| 29 | endif() | ||
| 30 | |||
| 31 | # Add precompiled headers to Kodi main libraries | ||
| 32 | if(WIN32 AND "${CMAKE_CURRENT_LIST_DIR}" MATCHES "^${CORE_SOURCE_DIR}/xbmc") | ||
| 33 | add_precompiled_header(${name} pch.h ${CORE_SOURCE_DIR}/xbmc/win32/pch.cpp | ||
| 34 | PCH_TARGET kodi) | ||
| 35 | endif() | ||
| 36 | |||
| 37 | # IDE support | ||
| 38 | if(CMAKE_GENERATOR MATCHES "Xcode") | ||
| 39 | file(RELATIVE_PATH parentfolder ${CORE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/..) | ||
| 40 | set_target_properties(${name} PROPERTIES FOLDER "${parentfolder}") | ||
| 41 | elseif(CMAKE_GENERATOR MATCHES "Visual Studio") | ||
| 42 | file(RELATIVE_PATH foldername ${CORE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) | ||
| 43 | set_target_properties(${name} PROPERTIES FOLDER "${foldername}") | ||
| 44 | source_group(" " REGULAR_EXPRESSION ".*") | ||
| 45 | endif() | ||
| 46 | endfunction() | ||
| 47 | |||
| 48 | # Add a test library, and add sources to list for gtest integration macros | ||
| 49 | function(core_add_test_library name) | ||
| 50 | core_add_library(${name} NO_MAIN_DEPENDS) | ||
| 51 | set_target_properties(${name} PROPERTIES EXCLUDE_FROM_ALL 1) | ||
| 52 | foreach(src ${SOURCES}) | ||
| 53 | set(test_sources ${CMAKE_CURRENT_SOURCE_DIR}/${src} ${test_sources} CACHE STRING "" FORCE) | ||
| 54 | endforeach() | ||
| 55 | set(test_archives ${test_archives} ${name} CACHE STRING "" FORCE) | ||
| 56 | endfunction() | ||
| 57 | |||
| 58 | # Add a data file to installation list with a mirror in build tree | ||
| 59 | # Arguments: | ||
| 60 | # file full path to file to mirror | ||
| 61 | # relative the relative base of file path in the build/install tree | ||
| 62 | # Optional Arguments: | ||
| 63 | # NO_INSTALL: exclude file from installation target | ||
| 64 | # Implicit arguments: | ||
| 65 | # CORE_SOURCE_DIR - root of source tree | ||
| 66 | # On return: | ||
| 67 | # Files is mirrored to the build tree and added to ${install_data} | ||
| 68 | # (if NO_INSTALL is not given). | ||
| 69 | function(copy_file_to_buildtree file relative) | ||
| 70 | cmake_parse_arguments(arg "NO_INSTALL" "" "" ${ARGN}) | ||
| 71 | string(REPLACE "${relative}/" "" outfile ${file}) | ||
| 72 | get_filename_component(outdir ${outfile} DIRECTORY) | ||
| 73 | |||
| 74 | if(NOT TARGET export-files) | ||
| 75 | file(REMOVE ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake) | ||
| 76 | add_custom_target(export-files ALL COMMENT "Copying files into build tree" | ||
| 77 | COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake) | ||
| 78 | endif() | ||
| 79 | if(NOT ${CORE_SOURCE_DIR} MATCHES ${CMAKE_BINARY_DIR}) | ||
| 80 | if(VERBOSE) | ||
| 81 | message(STATUS "copy_file_to_buildtree - copying file: ${file} -> ${CMAKE_BINARY_DIR}/${outfile}") | ||
| 82 | endif() | ||
| 83 | file(APPEND ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake | ||
| 84 | "file(COPY \"${file}\" DESTINATION \"${CMAKE_BINARY_DIR}/${outdir}\")\n") | ||
| 85 | endif() | ||
| 86 | if(NOT arg_NO_INSTALL) | ||
| 87 | list(APPEND install_data ${outfile}) | ||
| 88 | set(install_data ${install_data} PARENT_SCOPE) | ||
| 89 | endif() | ||
| 90 | endfunction() | ||
| 91 | |||
| 92 | # Add data files to installation list with a mirror in build tree. | ||
| 93 | # reads list of files to install from a given list of text files. | ||
| 94 | # Arguments: | ||
| 95 | # pattern globbing pattern for text files to read | ||
| 96 | # Optional Arguments: | ||
| 97 | # NO_INSTALL: exclude files from installation target | ||
| 98 | # Implicit arguments: | ||
| 99 | # CORE_SOURCE_DIR - root of source tree | ||
| 100 | # On return: | ||
| 101 | # Files are mirrored to the build tree and added to ${install_data} | ||
| 102 | # (if NO_INSTALL is not given). | ||
| 103 | function(copy_files_from_filelist_to_buildtree pattern) | ||
| 104 | # copies files listed in text files to the buildtree | ||
| 105 | # Input: [glob pattern: filepattern] | ||
| 106 | cmake_parse_arguments(arg "NO_INSTALL" "" "" ${ARGN}) | ||
| 107 | list(APPEND pattern ${ARGN}) | ||
| 108 | list(SORT pattern) | ||
| 109 | if(VERBOSE) | ||
| 110 | message(STATUS "copy_files_from_filelist_to_buildtree - got pattern: ${pattern}") | ||
| 111 | endif() | ||
| 112 | foreach(pat ${pattern}) | ||
| 113 | file(GLOB filenames ${pat}) | ||
| 114 | foreach(filename ${filenames}) | ||
| 115 | string(STRIP ${filename} filename) | ||
| 116 | core_file_read_filtered(fstrings ${filename}) | ||
| 117 | foreach(dir ${fstrings}) | ||
| 118 | file(GLOB_RECURSE files RELATIVE ${CORE_SOURCE_DIR} ${CORE_SOURCE_DIR}/${dir}) | ||
| 119 | foreach(file ${files}) | ||
| 120 | if(arg_NO_INSTALL) | ||
| 121 | copy_file_to_buildtree(${CORE_SOURCE_DIR}/${file} ${CORE_SOURCE_DIR} NO_INSTALL) | ||
| 122 | else() | ||
| 123 | copy_file_to_buildtree(${CORE_SOURCE_DIR}/${file} ${CORE_SOURCE_DIR}) | ||
| 124 | endif() | ||
| 125 | endforeach() | ||
| 126 | endforeach() | ||
| 127 | endforeach() | ||
| 128 | endforeach() | ||
| 129 | set(install_data ${install_data} PARENT_SCOPE) | ||
| 130 | endfunction() | ||
| 131 | |||
| 132 | # helper macro to set modified variables in parent scope | ||
| 133 | macro(export_dep) | ||
| 134 | set(SYSTEM_INCLUDES ${SYSTEM_INCLUDES} PARENT_SCOPE) | ||
| 135 | set(DEPLIBS ${DEPLIBS} PARENT_SCOPE) | ||
| 136 | set(DEP_DEFINES ${DEP_DEFINES} PARENT_SCOPE) | ||
| 137 | set(${depup}_FOUND ${${depup}_FOUND} PARENT_SCOPE) | ||
| 138 | mark_as_advanced(${depup}_LIBRARIES) | ||
| 139 | endmacro() | ||
| 140 | |||
| 141 | # add a required dependency of main application | ||
| 142 | # Arguments: | ||
| 143 | # dep name of find rule for dependency, used uppercased for variable prefix | ||
| 144 | # On return: | ||
| 145 | # dependency added to ${SYSTEM_INCLUDES}, ${DEPLIBS} and ${DEP_DEFINES} | ||
| 146 | function(core_require_dep dep) | ||
| 147 | find_package(${dep} REQUIRED) | ||
| 148 | string(TOUPPER ${dep} depup) | ||
| 149 | list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS}) | ||
| 150 | list(APPEND DEPLIBS ${${depup}_LIBRARIES}) | ||
| 151 | list(APPEND DEP_DEFINES ${${depup}_DEFINITIONS}) | ||
| 152 | export_dep() | ||
| 153 | endfunction() | ||
| 154 | |||
| 155 | # add a required dyloaded dependency of main application | ||
| 156 | # Arguments: | ||
| 157 | # dep name of find rule for dependency, used uppercased for variable prefix | ||
| 158 | # On return: | ||
| 159 | # dependency added to ${SYSTEM_INCLUDES}, ${dep}_SONAME is set up | ||
| 160 | function(core_require_dyload_dep dep) | ||
| 161 | find_package(${dep} REQUIRED) | ||
| 162 | string(TOUPPER ${dep} depup) | ||
| 163 | list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS}) | ||
| 164 | list(APPEND DEP_DEFINES ${${depup}_DEFINITIONS}) | ||
| 165 | find_soname(${depup} REQUIRED) | ||
| 166 | export_dep() | ||
| 167 | set(${depup}_SONAME ${${depup}_SONAME} PARENT_SCOPE) | ||
| 168 | endfunction() | ||
| 169 | |||
| 170 | # helper macro for optional deps | ||
| 171 | macro(setup_enable_switch) | ||
| 172 | string(TOUPPER ${dep} depup) | ||
| 173 | if (ARGV1) | ||
| 174 | set(enable_switch ${ARGV1}) | ||
| 175 | else() | ||
| 176 | set(enable_switch ENABLE_${depup}) | ||
| 177 | endif() | ||
| 178 | endmacro() | ||
| 179 | |||
| 180 | # add an optional dependency of main application | ||
| 181 | # Arguments: | ||
| 182 | # dep name of find rule for dependency, used uppercased for variable prefix | ||
| 183 | # On return: | ||
| 184 | # dependency optionally added to ${SYSTEM_INCLUDES}, ${DEPLIBS} and ${DEP_DEFINES} | ||
| 185 | function(core_optional_dep dep) | ||
| 186 | setup_enable_switch() | ||
| 187 | if(${enable_switch}) | ||
| 188 | find_package(${dep}) | ||
| 189 | if(${depup}_FOUND) | ||
| 190 | list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS}) | ||
| 191 | list(APPEND DEPLIBS ${${depup}_LIBRARIES}) | ||
| 192 | list(APPEND DEP_DEFINES ${${depup}_DEFINITIONS}) | ||
| 193 | set(final_message ${final_message} "${depup} enabled: Yes" PARENT_SCOPE) | ||
| 194 | export_dep() | ||
| 195 | else() | ||
| 196 | set(final_message ${final_message} "${depup} enabled: No" PARENT_SCOPE) | ||
| 197 | endif() | ||
| 198 | endif() | ||
| 199 | endfunction() | ||
| 200 | |||
| 201 | # add an optional dyloaded dependency of main application | ||
| 202 | # Arguments: | ||
| 203 | # dep name of find rule for dependency, used uppercased for variable prefix | ||
| 204 | # On return: | ||
| 205 | # dependency optionally added to ${SYSTEM_INCLUDES}, ${DEP_DEFINES}, ${dep}_SONAME is set up | ||
| 206 | function(core_optional_dyload_dep dep) | ||
| 207 | setup_enable_switch() | ||
| 208 | if(${enable_switch}) | ||
| 209 | find_package(${dep}) | ||
| 210 | if(${depup}_FOUND) | ||
| 211 | list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS}) | ||
| 212 | find_soname(${depup} REQUIRED) | ||
| 213 | list(APPEND DEP_DEFINES ${${depup}_DEFINITIONS}) | ||
| 214 | set(final_message ${final_message} "${depup} enabled: Yes" PARENT_SCOPE) | ||
| 215 | export_dep() | ||
| 216 | set(${depup}_SONAME ${${depup}_SONAME} PARENT_SCOPE) | ||
| 217 | endif() | ||
| 218 | endif() | ||
| 219 | endfunction() | ||
| 220 | |||
| 221 | function(core_file_read_filtered result filepattern) | ||
| 222 | # Reads STRINGS from text files | ||
| 223 | # with comments filtered out | ||
| 224 | # Result: [list: result] | ||
| 225 | # Input: [glob pattern: filepattern] | ||
| 226 | file(GLOB filenames ${filepattern}) | ||
| 227 | list(SORT filenames) | ||
| 228 | foreach(filename ${filenames}) | ||
| 229 | if(VERBOSE) | ||
| 230 | message(STATUS "core_file_read_filtered - filename: ${filename}") | ||
| 231 | endif() | ||
| 232 | file(STRINGS ${filename} fstrings REGEX "^[^#//]") | ||
| 233 | foreach(fstring ${fstrings}) | ||
| 234 | string(REGEX REPLACE "^(.*)#(.*)" "\\1" fstring ${fstring}) | ||
| 235 | string(REGEX REPLACE "//.*" "" fstring ${fstring}) | ||
| 236 | string(STRIP ${fstring} fstring) | ||
| 237 | list(APPEND filename_strings ${fstring}) | ||
| 238 | endforeach() | ||
| 239 | endforeach() | ||
| 240 | set(${result} ${filename_strings} PARENT_SCOPE) | ||
| 241 | endfunction() | ||
| 242 | |||
| 243 | function(core_add_subdirs_from_filelist files) | ||
| 244 | # Adds subdirectories from a sorted list of files | ||
| 245 | # Input: [list: filenames] [bool: sort] | ||
| 246 | foreach(arg ${ARGN}) | ||
| 247 | list(APPEND files ${arg}) | ||
| 248 | endforeach() | ||
| 249 | list(SORT files) | ||
| 250 | if(VERBOSE) | ||
| 251 | message(STATUS "core_add_subdirs_from_filelist - got pattern: ${files}") | ||
| 252 | endif() | ||
| 253 | foreach(filename ${files}) | ||
| 254 | string(STRIP ${filename} filename) | ||
| 255 | core_file_read_filtered(fstrings ${filename}) | ||
| 256 | foreach(subdir ${fstrings}) | ||
| 257 | STRING_SPLIT(subdir " " ${subdir}) | ||
| 258 | list(GET subdir 0 subdir_src) | ||
| 259 | list(GET subdir -1 subdir_dest) | ||
| 260 | if(VERBOSE) | ||
| 261 | message(STATUS " core_add_subdirs_from_filelist - adding subdir: ${CORE_SOURCE_DIR}${subdir_src} -> ${CORE_BUILD_DIR}/${subdir_dest}") | ||
| 262 | endif() | ||
| 263 | add_subdirectory(${CORE_SOURCE_DIR}/${subdir_src} ${CORE_BUILD_DIR}/${subdir_dest}) | ||
| 264 | endforeach() | ||
| 265 | endforeach() | ||
| 266 | endfunction() | ||
| 267 | |||
| 268 | macro(core_add_optional_subdirs_from_filelist pattern) | ||
| 269 | # Adds subdirectories from text files | ||
| 270 | # if the option(s) in the 3rd field are enabled | ||
| 271 | # Input: [glob pattern: filepattern] | ||
| 272 | foreach(arg ${ARGN}) | ||
| 273 | list(APPEND pattern ${arg}) | ||
| 274 | endforeach() | ||
| 275 | foreach(elem ${pattern}) | ||
| 276 | string(STRIP ${elem} elem) | ||
| 277 | list(APPEND filepattern ${elem}) | ||
| 278 | endforeach() | ||
| 279 | |||
| 280 | file(GLOB filenames ${filepattern}) | ||
| 281 | list(SORT filenames) | ||
| 282 | if(VERBOSE) | ||
| 283 | message(STATUS "core_add_optional_subdirs_from_filelist - got pattern: ${filenames}") | ||
| 284 | endif() | ||
| 285 | |||
| 286 | foreach(filename ${filenames}) | ||
| 287 | if(VERBOSE) | ||
| 288 | message(STATUS "core_add_optional_subdirs_from_filelist - reading file: ${filename}") | ||
| 289 | endif() | ||
| 290 | file(STRINGS ${filename} fstrings REGEX "^[^#//]") | ||
| 291 | foreach(line ${fstrings}) | ||
| 292 | string(REPLACE " " ";" line "${line}") | ||
| 293 | list(GET line 0 subdir_src) | ||
| 294 | list(GET line 1 subdir_dest) | ||
| 295 | list(GET line 3 opts) | ||
| 296 | foreach(opt ${opts}) | ||
| 297 | if(ENABLE_${opt}) | ||
| 298 | if(VERBOSE) | ||
| 299 | message(STATUS " core_add_optional_subdirs_from_filelist - adding subdir: ${CORE_SOURCE_DIR}${subdir_src} -> ${CORE_BUILD_DIR}/${subdir_dest}") | ||
| 300 | endif() | ||
| 301 | add_subdirectory(${CORE_SOURCE_DIR}/${subdir_src} ${CORE_BUILD_DIR}/${subdir_dest}) | ||
| 302 | else() | ||
| 303 | if(VERBOSE) | ||
| 304 | message(STATUS " core_add_optional_subdirs_from_filelist: OPTION ${opt} not enabled for ${subdir_src}, skipping subdir") | ||
| 305 | endif() | ||
| 306 | endif() | ||
| 307 | endforeach() | ||
| 308 | endforeach() | ||
| 309 | endforeach() | ||
| 310 | endmacro() | ||
| 311 | |||
| 312 | macro(today RESULT) | ||
| 313 | if (WIN32) | ||
| 314 | execute_process(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT}) | ||
| 315 | string(REGEX REPLACE "(..)/(..)/..(..).*" "\\1/\\2/\\3" ${RESULT} ${${RESULT}}) | ||
| 316 | elseif(UNIX) | ||
| 317 | execute_process(COMMAND date -u +%F | ||
| 318 | OUTPUT_VARIABLE ${RESULT}) | ||
| 319 | string(REGEX REPLACE "(..)/(..)/..(..).*" "\\1/\\2/\\3" ${RESULT} ${${RESULT}}) | ||
| 320 | else() | ||
| 321 | message(SEND_ERROR "date not implemented") | ||
| 322 | set(${RESULT} 000000) | ||
| 323 | endif() | ||
| 324 | string(REGEX REPLACE "(\r?\n)+$" "" ${RESULT} "${${RESULT}}") | ||
| 325 | endmacro() | ||
| 326 | |||
| 327 | function(core_find_git_rev) | ||
| 328 | find_package(Git) | ||
| 329 | if(GIT_FOUND AND EXISTS ${CORE_SOURCE_DIR}/.git) | ||
| 330 | execute_process(COMMAND ${GIT_EXECUTABLE} diff-files --ignore-submodules --quiet -- | ||
| 331 | RESULT_VARIABLE status_code | ||
| 332 | WORKING_DIRECTORY ${CORE_SOURCE_DIR}) | ||
| 333 | if (NOT status_code) | ||
| 334 | execute_process(COMMAND ${GIT_EXECUTABLE} diff-index --ignore-submodules --quiet HEAD -- | ||
| 335 | RESULT_VARIABLE status_code | ||
| 336 | WORKING_DIRECTORY ${CORE_SOURCE_DIR}) | ||
| 337 | endif() | ||
| 338 | if (status_code) | ||
| 339 | execute_process(COMMAND ${GIT_EXECUTABLE} log -n 1 --pretty=format:"%h-dirty" HEAD | ||
| 340 | OUTPUT_VARIABLE HASH | ||
| 341 | WORKING_DIRECTORY ${CORE_SOURCE_DIR}) | ||
| 342 | string(SUBSTRING ${HASH} 1 13 HASH) | ||
| 343 | else() | ||
| 344 | execute_process(COMMAND ${GIT_EXECUTABLE} log -n 1 --pretty=format:"%h" HEAD | ||
| 345 | OUTPUT_VARIABLE HASH | ||
| 346 | WORKING_DIRECTORY ${CORE_SOURCE_DIR}) | ||
| 347 | string(SUBSTRING ${HASH} 1 7 HASH) | ||
| 348 | endif() | ||
| 349 | execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --pretty=format:"%cd" --date=short HEAD | ||
| 350 | OUTPUT_VARIABLE DATE | ||
| 351 | WORKING_DIRECTORY ${CORE_SOURCE_DIR}) | ||
| 352 | string(SUBSTRING ${DATE} 1 10 DATE) | ||
| 353 | else() | ||
| 354 | today(DATE) | ||
| 355 | set(HASH "nogitfound") | ||
| 356 | endif() | ||
| 357 | string(REPLACE "-" "" DATE ${DATE}) | ||
| 358 | set(GIT_REV "${DATE}-${HASH}") | ||
| 359 | if(GIT_REV) | ||
| 360 | set(APP_SCMID ${GIT_REV} PARENT_SCOPE) | ||
| 361 | endif() | ||
| 362 | endfunction() | ||
| 363 | |||
| 364 | macro(core_find_versions) | ||
| 365 | include(CMakeParseArguments) | ||
| 366 | core_file_read_filtered(version_list ${CORE_SOURCE_DIR}/version.txt) | ||
| 367 | string(REPLACE " " ";" version_list "${version_list}") | ||
| 368 | cmake_parse_arguments(APP "" "VERSION_MAJOR;VERSION_MINOR;VERSION_TAG;VERSION_CODE;ADDON_API;APP_NAME;COMPANY_NAME" "" ${version_list}) | ||
| 369 | |||
| 370 | set(APP_NAME ${APP_APP_NAME}) # inconsistency in upstream | ||
| 371 | string(TOLOWER ${APP_APP_NAME} APP_NAME_LC) | ||
| 372 | set(COMPANY_NAME ${APP_COMPANY_NAME}) | ||
| 373 | set(APP_VERSION ${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}) | ||
| 374 | if(APP_VERSION_TAG) | ||
| 375 | set(APP_VERSION ${APP_VERSION}-${APP_VERSION_TAG}) | ||
| 376 | endif() | ||
| 377 | string(REPLACE "." "," FILE_VERSION ${APP_ADDON_API}.0) | ||
| 378 | string(TOLOWER ${APP_VERSION_TAG} APP_VERSION_TAG_LC) | ||
| 379 | file(STRINGS ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h guilib_version REGEX "^.*GUILIB_API_VERSION (.*)$") | ||
| 380 | string(REGEX REPLACE ".*\"(.*)\"" "\\1" guilib_version ${guilib_version}) | ||
| 381 | file(STRINGS ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h guilib_version_min REGEX "^.*GUILIB_MIN_API_VERSION (.*)$") | ||
| 382 | string(REGEX REPLACE ".*\"(.*)\"" "\\1" guilib_version_min ${guilib_version_min}) | ||
| 383 | endmacro() | ||
