diff options
Diffstat (limited to 'cmake/scripts/common')
| -rw-r--r-- | cmake/scripts/common/AddonHelpers.cmake | 19 | ||||
| -rw-r--r-- | cmake/scripts/common/ArchSetup.cmake | 3 | ||||
| -rw-r--r-- | cmake/scripts/common/GenerateVersionedFiles.cmake | 10 | ||||
| -rw-r--r-- | cmake/scripts/common/HandleDepends.cmake | 13 | ||||
| -rw-r--r-- | cmake/scripts/common/Macros.cmake | 54 | ||||
| -rw-r--r-- | cmake/scripts/common/Platform.cmake | 9 | ||||
| -rw-r--r-- | cmake/scripts/common/PrepareEnv.cmake | 14 |
7 files changed, 93 insertions, 29 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() |
| 352 | endmacro() | 363 | endmacro() |
| 353 | 364 | ||
diff --git a/cmake/scripts/common/ArchSetup.cmake b/cmake/scripts/common/ArchSetup.cmake index 357c14c..3b81533 100644 --- a/cmake/scripts/common/ArchSetup.cmake +++ b/cmake/scripts/common/ArchSetup.cmake | |||
| @@ -11,6 +11,9 @@ | |||
| 11 | # DEP_DEFINES - compiler definitions for system dependencies (e.g. LIRC) | 11 | # DEP_DEFINES - compiler definitions for system dependencies (e.g. LIRC) |
| 12 | # + the results of compiler tests etc. | 12 | # + the results of compiler tests etc. |
| 13 | 13 | ||
| 14 | # workaround a bug in older cmake, where binutils wouldn't be set after deleting CMakeCache.txt | ||
| 15 | include(CMakeFindBinUtils) | ||
| 16 | |||
| 14 | include(CheckCXXSourceCompiles) | 17 | include(CheckCXXSourceCompiles) |
| 15 | include(CheckSymbolExists) | 18 | include(CheckSymbolExists) |
| 16 | include(CheckFunctionExists) | 19 | include(CheckFunctionExists) |
diff --git a/cmake/scripts/common/GenerateVersionedFiles.cmake b/cmake/scripts/common/GenerateVersionedFiles.cmake index 90b2173..011f495 100644 --- a/cmake/scripts/common/GenerateVersionedFiles.cmake +++ b/cmake/scripts/common/GenerateVersionedFiles.cmake | |||
| @@ -13,12 +13,11 @@ endfunction() | |||
| 13 | 13 | ||
| 14 | # add-on xml's | 14 | # add-on xml's |
| 15 | file(GLOB ADDON_XML_IN_FILE ${CORE_SOURCE_DIR}/addons/*/addon.xml.in) | 15 | file(GLOB ADDON_XML_IN_FILE ${CORE_SOURCE_DIR}/addons/*/addon.xml.in) |
| 16 | foreach(loop_var ${ADDON_XML_IN_FILE}) | ||
| 17 | # prevent 'xbmc.json'; will be obtained from 'xbmc/interfaces/json-rpc/schema/CMakeLists.txt'. | ||
| 18 | if(loop_var MATCHES "xbmc.json") | ||
| 19 | continue() | ||
| 20 | endif() | ||
| 21 | 16 | ||
| 17 | # remove 'xbmc.json', will be created from 'xbmc/interfaces/json-rpc/schema/CMakeLists.txt' | ||
| 18 | list(REMOVE_ITEM ADDON_XML_IN_FILE xbmc.json) | ||
| 19 | |||
| 20 | foreach(loop_var ${ADDON_XML_IN_FILE}) | ||
| 22 | list(GET loop_var 0 xml_name) | 21 | list(GET loop_var 0 xml_name) |
| 23 | 22 | ||
| 24 | string(REPLACE "/addon.xml.in" "" source_dir ${xml_name}) | 23 | string(REPLACE "/addon.xml.in" "" source_dir ${xml_name}) |
| @@ -35,4 +34,5 @@ foreach(loop_var ${ADDON_XML_IN_FILE}) | |||
| 35 | unset(xml_name) | 34 | unset(xml_name) |
| 36 | endforeach() | 35 | endforeach() |
| 37 | 36 | ||
| 37 | |||
| 38 | generate_versioned_file(xbmc/CompileInfo.cpp.in ${CORE_BUILD_DIR}/xbmc/CompileInfo.cpp) | 38 | generate_versioned_file(xbmc/CompileInfo.cpp.in ${CORE_BUILD_DIR}/xbmc/CompileInfo.cpp) |
diff --git a/cmake/scripts/common/HandleDepends.cmake b/cmake/scripts/common/HandleDepends.cmake index 85d2cf4..49e5ac8 100644 --- a/cmake/scripts/common/HandleDepends.cmake +++ b/cmake/scripts/common/HandleDepends.cmake | |||
| @@ -7,6 +7,10 @@ function(add_addon_depends addon searchpath) | |||
| 7 | set(OUTPUT_DIR ${ADDON_DEPENDS_PATH}) | 7 | set(OUTPUT_DIR ${ADDON_DEPENDS_PATH}) |
| 8 | # look for platform-specific dependencies | 8 | # look for platform-specific dependencies |
| 9 | file(GLOB_RECURSE cmake_input_files ${searchpath}/${CORE_SYSTEM_NAME}/*.txt) | 9 | file(GLOB_RECURSE cmake_input_files ${searchpath}/${CORE_SYSTEM_NAME}/*.txt) |
| 10 | # backward compatibility | ||
| 11 | if(NOT cmake_input_files AND CORE_SYSTEM_NAME STREQUAL windowsstore) | ||
| 12 | file(GLOB_RECURSE cmake_input_files ${searchpath}/windows/*.txt) | ||
| 13 | endif() | ||
| 10 | file(GLOB_RECURSE cmake_input_files2 ${searchpath}/common/*.txt) | 14 | file(GLOB_RECURSE cmake_input_files2 ${searchpath}/common/*.txt) |
| 11 | list(APPEND cmake_input_files ${cmake_input_files2}) | 15 | list(APPEND cmake_input_files ${cmake_input_files2}) |
| 12 | 16 | ||
| @@ -67,6 +71,11 @@ function(add_addon_depends addon searchpath) | |||
| 67 | -DCORE_SYSTEM_NAME=${CORE_SYSTEM_NAME} | 71 | -DCORE_SYSTEM_NAME=${CORE_SYSTEM_NAME} |
| 68 | -DENABLE_STATIC=1 | 72 | -DENABLE_STATIC=1 |
| 69 | -DBUILD_SHARED_LIBS=0) | 73 | -DBUILD_SHARED_LIBS=0) |
| 74 | # windows store args | ||
| 75 | if (CMAKE_SYSTEM_NAME STREQUAL WindowsStore) | ||
| 76 | list(APPEND BUILD_ARGS -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} | ||
| 77 | -DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION}) | ||
| 78 | endif() | ||
| 70 | # if there are no make rules override files available take care of manually passing on ARCH_DEFINES | 79 | # if there are no make rules override files available take care of manually passing on ARCH_DEFINES |
| 71 | if(NOT CMAKE_USER_MAKE_RULES_OVERRIDE AND NOT CMAKE_USER_MAKE_RULES_OVERRIDE_CXX) | 80 | if(NOT CMAKE_USER_MAKE_RULES_OVERRIDE AND NOT CMAKE_USER_MAKE_RULES_OVERRIDE_CXX) |
| 72 | # make sure we create strings, not lists | 81 | # make sure we create strings, not lists |
| @@ -147,6 +156,10 @@ function(add_addon_depends addon searchpath) | |||
| 147 | if(EXISTS ${dir}/${CORE_SYSTEM_NAME}-deps.txt) | 156 | if(EXISTS ${dir}/${CORE_SYSTEM_NAME}-deps.txt) |
| 148 | file(STRINGS ${dir}/${CORE_SYSTEM_NAME}-deps.txt deps) | 157 | file(STRINGS ${dir}/${CORE_SYSTEM_NAME}-deps.txt deps) |
| 149 | message(STATUS "${id} depends: ${deps}") | 158 | message(STATUS "${id} depends: ${deps}") |
| 159 | # backward compatibility | ||
| 160 | elseif(CORE_SYSTEM_NAME STREQUAL windowsstore AND EXISTS ${dir}/windows-deps.txt) | ||
| 161 | file(STRINGS ${dir}/windows-deps.txt deps) | ||
| 162 | message(STATUS "${id} depends: ${deps}") | ||
| 150 | elseif(EXISTS ${dir}/deps.txt) | 163 | elseif(EXISTS ${dir}/deps.txt) |
| 151 | set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/deps.txt) | 164 | set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/deps.txt) |
| 152 | file(STRINGS ${dir}/deps.txt deps) | 165 | file(STRINGS ${dir}/deps.txt deps) |
diff --git a/cmake/scripts/common/Macros.cmake b/cmake/scripts/common/Macros.cmake index 9f00bb7..d508f87 100644 --- a/cmake/scripts/common/Macros.cmake +++ b/cmake/scripts/common/Macros.cmake | |||
| @@ -72,11 +72,15 @@ function(core_add_library name) | |||
| 72 | add_library(${name} STATIC ${SOURCES} ${HEADERS} ${OTHERS}) | 72 | add_library(${name} STATIC ${SOURCES} ${HEADERS} ${OTHERS}) |
| 73 | set_target_properties(${name} PROPERTIES PREFIX "") | 73 | set_target_properties(${name} PROPERTIES PREFIX "") |
| 74 | set(core_DEPENDS ${name} ${core_DEPENDS} CACHE STRING "" FORCE) | 74 | set(core_DEPENDS ${name} ${core_DEPENDS} CACHE STRING "" FORCE) |
| 75 | add_dependencies(${name} libcpluff ffmpeg dvdnav crossguid ${PLATFORM_GLOBAL_TARGET_DEPS}) | 75 | set(lib_DEPS libcpluff ffmpeg crossguid ${PLATFORM_GLOBAL_TARGET_DEPS}) |
| 76 | if(NOT CORE_SYSTEM_NAME STREQUAL windowsstore) | ||
| 77 | list(APPEND lib_DEPS dvdnav) | ||
| 78 | endif() | ||
| 79 | add_dependencies(${name} ${lib_DEPS}) | ||
| 76 | set(CORE_LIBRARY ${name} PARENT_SCOPE) | 80 | set(CORE_LIBRARY ${name} PARENT_SCOPE) |
| 77 | 81 | ||
| 78 | # Add precompiled headers to Kodi main libraries | 82 | # Add precompiled headers to Kodi main libraries |
| 79 | if(CORE_SYSTEM_NAME STREQUAL windows) | 83 | if(CORE_SYSTEM_NAME MATCHES windows) |
| 80 | add_precompiled_header(${name} pch.h ${CMAKE_SOURCE_DIR}/xbmc/platform/win32/pch.cpp PCH_TARGET kodi) | 84 | add_precompiled_header(${name} pch.h ${CMAKE_SOURCE_DIR}/xbmc/platform/win32/pch.cpp PCH_TARGET kodi) |
| 81 | set_language_cxx(${name}) | 85 | set_language_cxx(${name}) |
| 82 | target_link_libraries(${name} PUBLIC effects11) | 86 | target_link_libraries(${name} PUBLIC effects11) |
| @@ -102,7 +106,11 @@ function(core_add_test_library name) | |||
| 102 | set_target_properties(${name} PROPERTIES PREFIX "" | 106 | set_target_properties(${name} PROPERTIES PREFIX "" |
| 103 | EXCLUDE_FROM_ALL 1 | 107 | EXCLUDE_FROM_ALL 1 |
| 104 | FOLDER "Build Utilities/tests") | 108 | FOLDER "Build Utilities/tests") |
| 105 | add_dependencies(${name} libcpluff ffmpeg dvdnav crossguid) | 109 | set(lib_DEPS libcpluff ffmpeg crossguid ${PLATFORM_GLOBAL_TARGET_DEPS}) |
| 110 | if(NOT CORE_SYSTEM_NAME STREQUAL windowsstore) | ||
| 111 | list(APPEND lib_DEPS dvdnav) | ||
| 112 | endif() | ||
| 113 | add_dependencies(${name} ${lib_DEPS}) | ||
| 106 | set(test_archives ${test_archives} ${name} CACHE STRING "" FORCE) | 114 | set(test_archives ${test_archives} ${name} CACHE STRING "" FORCE) |
| 107 | endif() | 115 | endif() |
| 108 | foreach(src IN LISTS SOURCES SUPPORTED_SOURCES HEADERS OTHERS) | 116 | foreach(src IN LISTS SOURCES SUPPORTED_SOURCES HEADERS OTHERS) |
| @@ -314,6 +322,7 @@ function(copy_files_from_filelist_to_buildtree pattern) | |||
| 314 | copy_file_to_buildtree(${CMAKE_SOURCE_DIR}/${file} DIRECTORY ${dest} ${DIR_OPTION}) | 322 | copy_file_to_buildtree(${CMAKE_SOURCE_DIR}/${file} DIRECTORY ${dest} ${DIR_OPTION}) |
| 315 | endif() | 323 | endif() |
| 316 | endforeach() | 324 | endforeach() |
| 325 | set(DIR_OPTION) | ||
| 317 | endforeach() | 326 | endforeach() |
| 318 | endforeach() | 327 | endforeach() |
| 319 | endforeach() | 328 | endforeach() |
| @@ -583,7 +592,8 @@ function(core_find_git_rev stamp) | |||
| 583 | else() | 592 | else() |
| 584 | find_package(Git) | 593 | find_package(Git) |
| 585 | if(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git) | 594 | if(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git) |
| 586 | execute_process(COMMAND ${GIT_EXECUTABLE} update-index --ignore-submodules --refresh -q) | 595 | execute_process(COMMAND ${GIT_EXECUTABLE} update-index --ignore-submodules -q --refresh |
| 596 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
| 587 | execute_process(COMMAND ${GIT_EXECUTABLE} diff-files --ignore-submodules --quiet -- | 597 | execute_process(COMMAND ${GIT_EXECUTABLE} diff-files --ignore-submodules --quiet -- |
| 588 | RESULT_VARIABLE status_code | 598 | RESULT_VARIABLE status_code |
| 589 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | 599 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
| @@ -610,7 +620,11 @@ function(core_find_git_rev stamp) | |||
| 610 | string(REPLACE "-" "" DATE ${DATE}) | 620 | string(REPLACE "-" "" DATE ${DATE}) |
| 611 | else() | 621 | else() |
| 612 | string(TIMESTAMP DATE "%Y%m%d" UTC) | 622 | string(TIMESTAMP DATE "%Y%m%d" UTC) |
| 613 | set(HASH "nogitfound") | 623 | if(EXISTS ${CMAKE_SOURCE_DIR}/VERSION) |
| 624 | file(STRINGS ${CMAKE_SOURCE_DIR}/VERSION HASH LIMIT_INPUT 16) | ||
| 625 | else() | ||
| 626 | set(HASH "nogitfound") | ||
| 627 | endif() | ||
| 614 | endif() | 628 | endif() |
| 615 | cmake_parse_arguments(arg "FULL" "" "" ${ARGN}) | 629 | cmake_parse_arguments(arg "FULL" "" "" ${ARGN}) |
| 616 | if(arg_FULL) | 630 | if(arg_FULL) |
| @@ -637,6 +651,7 @@ endfunction() | |||
| 637 | # APP_VERSION - the app version (${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}-${APP_VERSION_TAG}) | 651 | # APP_VERSION - the app version (${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}-${APP_VERSION_TAG}) |
| 638 | # APP_ADDON_API - the addon API version in the form of 16.9.702 | 652 | # APP_ADDON_API - the addon API version in the form of 16.9.702 |
| 639 | # FILE_VERSION - file version in the form of 16,9,702,0 - Windows only | 653 | # FILE_VERSION - file version in the form of 16,9,702,0 - Windows only |
| 654 | # JSONRPC_VERSION - the json api version in the form of 8.3.0 | ||
| 640 | # | 655 | # |
| 641 | # Set various variables defined in "versions.h" | 656 | # Set various variables defined in "versions.h" |
| 642 | macro(core_find_versions) | 657 | macro(core_find_versions) |
| @@ -651,9 +666,28 @@ macro(core_find_versions) | |||
| 651 | 666 | ||
| 652 | include(CMakeParseArguments) | 667 | include(CMakeParseArguments) |
| 653 | core_file_read_filtered(version_list ${CORE_SOURCE_DIR}/version.txt) | 668 | core_file_read_filtered(version_list ${CORE_SOURCE_DIR}/version.txt) |
| 654 | string(REPLACE " " ";" version_list "${version_list}") | 669 | core_file_read_filtered(json_version ${CORE_SOURCE_DIR}/xbmc/interfaces/json-rpc/schema/version.txt) |
| 655 | cmake_parse_arguments(APP "" "APP_NAME;COMPANY_NAME;WEBSITE;VERSION_MAJOR;VERSION_MINOR;VERSION_TAG;VERSION_CODE;ADDON_API;APP_PACKAGE" "" ${version_list}) | 670 | string(REGEX REPLACE "([^ ;]*) ([^;]*)" "\\1;\\2" version_list "${version_list};${json_version}") |
| 656 | 671 | set(version_props | |
| 672 | ADDON_API | ||
| 673 | APP_NAME | ||
| 674 | APP_PACKAGE | ||
| 675 | COMPANY_NAME | ||
| 676 | JSONRPC_VERSION | ||
| 677 | PACKAGE_DESCRIPTION | ||
| 678 | PACKAGE_IDENTITY | ||
| 679 | PACKAGE_PUBLISHER | ||
| 680 | VERSION_MAJOR | ||
| 681 | VERSION_MINOR | ||
| 682 | VERSION_TAG | ||
| 683 | VERSION_CODE | ||
| 684 | WEBSITE | ||
| 685 | ) | ||
| 686 | cmake_parse_arguments(APP "" "${version_props}" "" ${version_list}) | ||
| 687 | |||
| 688 | if(NOT ${APP_VERSION_CODE} MATCHES "^[0-9]+\\.[0-9][0-9]?\\.[0-9][0-9]?[0-9]?$") | ||
| 689 | message(FATAL_ERROR "VERSION_CODE was set to ${APP_VERSION_CODE} in version.txt, but it has to match '^\\d+\\.\\d{1,2}\\.\\d{1,3}$'") | ||
| 690 | endif() | ||
| 657 | set(APP_NAME ${APP_APP_NAME}) # inconsistency but APP_APP_NAME looks weird | 691 | set(APP_NAME ${APP_APP_NAME}) # inconsistency but APP_APP_NAME looks weird |
| 658 | string(TOLOWER ${APP_APP_NAME} APP_NAME_LC) | 692 | string(TOLOWER ${APP_APP_NAME} APP_NAME_LC) |
| 659 | string(TOUPPER ${APP_APP_NAME} APP_NAME_UC) | 693 | string(TOUPPER ${APP_APP_NAME} APP_NAME_UC) |
| @@ -665,6 +699,7 @@ macro(core_find_versions) | |||
| 665 | string(TOLOWER ${APP_VERSION_TAG} APP_VERSION_TAG_LC) | 699 | string(TOLOWER ${APP_VERSION_TAG} APP_VERSION_TAG_LC) |
| 666 | endif() | 700 | endif() |
| 667 | string(REPLACE "." "," FILE_VERSION ${APP_ADDON_API}.0) | 701 | string(REPLACE "." "," FILE_VERSION ${APP_ADDON_API}.0) |
| 702 | set(JSONRPC_VERSION ${APP_JSONRPC_VERSION}) | ||
| 668 | 703 | ||
| 669 | # Set defines used in addon.xml.in and read from versions.h to set add-on | 704 | # Set defines used in addon.xml.in and read from versions.h to set add-on |
| 670 | # version parts automatically | 705 | # version parts automatically |
| @@ -689,6 +724,9 @@ macro(core_find_versions) | |||
| 689 | if(NOT DEFINED APP_VERSION_MAJOR OR NOT DEFINED APP_VERSION_MINOR) | 724 | if(NOT DEFINED APP_VERSION_MAJOR OR NOT DEFINED APP_VERSION_MINOR) |
| 690 | message(FATAL_ERROR "Could not determine app version! Make sure that ${CORE_SOURCE_DIR}/version.txt exists") | 725 | message(FATAL_ERROR "Could not determine app version! Make sure that ${CORE_SOURCE_DIR}/version.txt exists") |
| 691 | endif() | 726 | endif() |
| 727 | if(NOT DEFINED JSONRPC_VERSION) | ||
| 728 | message(FATAL_ERROR "Could not determine json-rpc version! Make sure that ${CORE_SOURCE_DIR}/xbmc/interfaces/json-rpc/schema/version.txt exists") | ||
| 729 | endif() | ||
| 692 | endmacro() | 730 | endmacro() |
| 693 | 731 | ||
| 694 | # add-on xml's | 732 | # add-on xml's |
diff --git a/cmake/scripts/common/Platform.cmake b/cmake/scripts/common/Platform.cmake index b19b7e5..5ac233a 100644 --- a/cmake/scripts/common/Platform.cmake +++ b/cmake/scripts/common/Platform.cmake | |||
| @@ -2,14 +2,17 @@ if(NOT CORE_SYSTEM_NAME) | |||
| 2 | string(TOLOWER ${CMAKE_SYSTEM_NAME} CORE_SYSTEM_NAME) | 2 | string(TOLOWER ${CMAKE_SYSTEM_NAME} CORE_SYSTEM_NAME) |
| 3 | endif() | 3 | endif() |
| 4 | 4 | ||
| 5 | if(CORE_SYSTEM_NAME STREQUAL linux) | 5 | if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL freebsd) |
| 6 | # Set default CORE_PLATFORM_NAME to X11 | 6 | # Set default CORE_PLATFORM_NAME to X11 |
| 7 | # This is overridden by user setting -DCORE_PLATFORM_NAME=<platform> | 7 | # This is overridden by user setting -DCORE_PLATFORM_NAME=<platform> |
| 8 | set(_DEFAULT_PLATFORM X11) | 8 | set(_DEFAULT_PLATFORM X11) |
| 9 | option(ENABLE_APP_AUTONAME "Enable renaming the binary according to windowing?" ON) | ||
| 9 | else() | 10 | else() |
| 10 | string(TOLOWER ${CORE_SYSTEM_NAME} _DEFAULT_PLATFORM) | 11 | string(TOLOWER ${CORE_SYSTEM_NAME} _DEFAULT_PLATFORM) |
| 11 | endif() | 12 | endif() |
| 12 | 13 | ||
| 14 | set(APP_BINARY_SUFFIX ".bin") | ||
| 15 | |||
| 13 | # | 16 | # |
| 14 | # Note: please do not use CORE_PLATFORM_NAME in any checks, | 17 | # Note: please do not use CORE_PLATFORM_NAME in any checks, |
| 15 | # use the normalized to lower case CORE_PLATFORM_NAME_LC (see below) instead | 18 | # use the normalized to lower case CORE_PLATFORM_NAME_LC (see below) instead |
| @@ -23,10 +26,12 @@ string(TOLOWER ${CORE_PLATFORM_NAME} CORE_PLATFORM_NAME_LC) | |||
| 23 | list(APPEND final_message "Platform: ${CORE_PLATFORM_NAME}") | 26 | list(APPEND final_message "Platform: ${CORE_PLATFORM_NAME}") |
| 24 | if(EXISTS ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_NAME_LC}.cmake) | 27 | if(EXISTS ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_NAME_LC}.cmake) |
| 25 | include(${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_NAME_LC}.cmake) | 28 | include(${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_NAME_LC}.cmake) |
| 29 | if(ENABLE_APP_AUTONAME) | ||
| 30 | set(APP_BINARY_SUFFIX "-${CORE_PLATFORM_NAME_LC}") | ||
| 31 | endif() | ||
| 26 | else() | 32 | else() |
| 27 | file(GLOB _platformnames RELATIVE ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/ | 33 | file(GLOB _platformnames RELATIVE ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/ |
| 28 | ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/*.cmake) | 34 | ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/*.cmake) |
| 29 | string(REPLACE ".cmake" " " _platformnames ${_platformnames}) | 35 | string(REPLACE ".cmake" " " _platformnames ${_platformnames}) |
| 30 | message(FATAL_ERROR "invalid CORE_PLATFORM_NAME: ${CORE_PLATFORM_NAME_LC}\nValid platforms: ${_platformnames}") | 36 | message(FATAL_ERROR "invalid CORE_PLATFORM_NAME: ${CORE_PLATFORM_NAME_LC}\nValid platforms: ${_platformnames}") |
| 31 | endif() | 37 | endif() |
| 32 | |||
diff --git a/cmake/scripts/common/PrepareEnv.cmake b/cmake/scripts/common/PrepareEnv.cmake index 5a6066b..1426148 100644 --- a/cmake/scripts/common/PrepareEnv.cmake +++ b/cmake/scripts/common/PrepareEnv.cmake | |||
| @@ -40,17 +40,11 @@ file(COPY ${CORE_SOURCE_DIR}/cmake/scripts/common/AddonHelpers.cmake | |||
| 40 | ${CORE_SOURCE_DIR}/cmake/scripts/common/AddOptions.cmake | 40 | ${CORE_SOURCE_DIR}/cmake/scripts/common/AddOptions.cmake |
| 41 | DESTINATION ${APP_LIB_DIR}) | 41 | DESTINATION ${APP_LIB_DIR}) |
| 42 | 42 | ||
| 43 | # copy standard add-on include files | ||
| 44 | file(COPY ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/ | ||
| 45 | DESTINATION ${APP_INCLUDE_DIR} REGEX ".txt" EXCLUDE) | ||
| 46 | |||
| 47 | ### copy all the addon binding header files to include/kodi | 43 | ### copy all the addon binding header files to include/kodi |
| 48 | # parse addon-bindings.mk to get the list of header files to copy | 44 | include(${CORE_SOURCE_DIR}/xbmc/addons/AddonBindings.cmake) |
| 49 | core_file_read_filtered(bindings ${CORE_SOURCE_DIR}/xbmc/addons/addon-bindings.mk) | 45 | file(COPY ${CORE_ADDON_BINDINGS_FILES} ${CORE_ADDON_BINDINGS_DIRS}/ |
| 50 | foreach(header ${bindings}) | 46 | DESTINATION ${APP_INCLUDE_DIR} |
| 51 | # copy the header file to include/kodi | 47 | REGEX ".txt" EXCLUDE) |
| 52 | configure_file(${CORE_SOURCE_DIR}/${header} ${APP_INCLUDE_DIR} COPYONLY) | ||
| 53 | endforeach() | ||
| 54 | 48 | ||
| 55 | ### processing additional tools required by the platform | 49 | ### processing additional tools required by the platform |
| 56 | if(EXISTS ${CORE_SOURCE_DIR}/cmake/scripts/${CORE_SYSTEM_NAME}/tools/) | 50 | if(EXISTS ${CORE_SOURCE_DIR}/cmake/scripts/${CORE_SYSTEM_NAME}/tools/) |
