From 683e36e73c776cc8ce7653c1ba5abebe731aa9a9 Mon Sep 17 00:00:00 2001 From: montellese Date: Sat, 1 Nov 2014 00:02:56 +0100 Subject: cmake: rebrand from xbmc to kodi with backwards compatibility --- .gitignore | 1 + configure.in | 1 + project/cmake/addons/CMakeLists.txt | 14 +-- project/cmake/addons/README | 10 +-- project/cmake/addons/depends/CMakeLists.txt | 2 +- project/cmake/addons/depends/README | 6 +- .../cmake/addons/depends/windows/CMakeLists.txt | 2 +- project/cmake/addons/depends/windows/README | 2 +- .../depends/windows/cmake/kodi/CMakeLists.txt | 31 +++++++ .../addons/depends/windows/cmake/kodi/kodi.txt | 1 + .../depends/windows/cmake/kodi/noinstall.txt | 0 .../depends/windows/cmake/xbmc/CMakeLists.txt | 31 ------- .../depends/windows/cmake/xbmc/noinstall.txt | 0 .../addons/depends/windows/cmake/xbmc/xbmc.txt | 1 - .../cmake/addons/depends/windows/prebuilt/README | 2 +- project/cmake/kodi-config.cmake.in | 8 ++ project/cmake/scripts/common/addon-helpers.cmake | 99 ++++++++++++++++++++++ project/cmake/scripts/common/prepare-env.cmake | 71 ++++++++++++++++ .../cmake/scripts/common/xbmc-addon-helpers.cmake | 99 ---------------------- .../cmake/scripts/common/xbmc-prepare-env.cmake | 46 ---------- .../cmake/scripts/windows/c-flag-overrides.cmake | 5 ++ .../cmake/scripts/windows/cxx-flag-overrides.cmake | 5 ++ .../scripts/windows/xbmc-c-flag-overrides.cmake | 5 -- .../scripts/windows/xbmc-cxx-flag-overrides.cmake | 5 -- project/cmake/xbmc-config.cmake.in | 10 +-- tools/buildsteps/win32/make-addon-depends.bat | 4 +- tools/buildsteps/win32/make-addons.bat | 4 +- 27 files changed, 248 insertions(+), 217 deletions(-) create mode 100644 project/cmake/addons/depends/windows/cmake/kodi/CMakeLists.txt create mode 100644 project/cmake/addons/depends/windows/cmake/kodi/kodi.txt create mode 100644 project/cmake/addons/depends/windows/cmake/kodi/noinstall.txt delete mode 100644 project/cmake/addons/depends/windows/cmake/xbmc/CMakeLists.txt delete mode 100644 project/cmake/addons/depends/windows/cmake/xbmc/noinstall.txt delete mode 100644 project/cmake/addons/depends/windows/cmake/xbmc/xbmc.txt create mode 100644 project/cmake/kodi-config.cmake.in create mode 100644 project/cmake/scripts/common/addon-helpers.cmake create mode 100644 project/cmake/scripts/common/prepare-env.cmake delete mode 100644 project/cmake/scripts/common/xbmc-addon-helpers.cmake delete mode 100644 project/cmake/scripts/common/xbmc-prepare-env.cmake create mode 100644 project/cmake/scripts/windows/c-flag-overrides.cmake create mode 100644 project/cmake/scripts/windows/cxx-flag-overrides.cmake delete mode 100644 project/cmake/scripts/windows/xbmc-c-flag-overrides.cmake delete mode 100644 project/cmake/scripts/windows/xbmc-cxx-flag-overrides.cmake diff --git a/.gitignore b/.gitignore index 124a1a4d26..88753aaea0 100644 --- a/.gitignore +++ b/.gitignore @@ -339,6 +339,7 @@ lib/cpluff/stamp-h1 /project/output # /project/cmake +/project/cmake/kodi-config.cmake /project/cmake/xbmc-config.cmake /project/cmake/*.error /project/cmake/addons/build diff --git a/configure.in b/configure.in index f72ea4d15d..1c6746890d 100644 --- a/configure.in +++ b/configure.in @@ -2506,6 +2506,7 @@ OUTPUT_FILES="Makefile \ xbmc/osx/Info.plist \ xbmc/osx/ios/XBMCIOS-Info.plist \ xbmc/osx/atv2/XBMCATV2-Info.plist \ + project/cmake/kodi-config.cmake \ project/cmake/xbmc-config.cmake \ tools/android/packaging/xbmc/AndroidManifest.xml \ tools/android/packaging/Makefile \ diff --git a/project/cmake/addons/CMakeLists.txt b/project/cmake/addons/CMakeLists.txt index d62643d4f7..755ba9e733 100644 --- a/project/cmake/addons/CMakeLists.txt +++ b/project/cmake/addons/CMakeLists.txt @@ -1,4 +1,4 @@ -project(xbmc-addons) +project(kodi-addons) cmake_minimum_required(VERSION 2.8) @@ -70,14 +70,14 @@ else() endif() if(NOT WIN32) - # copy the xbmc-prepare-env.cmake script to the depends path so that we can include it - file(COPY ${XBMCROOT}/project/cmake/scripts/common/xbmc-prepare-env.cmake DESTINATION ${DEPENDS_PATH}/lib/xbmc) + # copy the prepare-env.cmake script to the depends path so that we can include it + file(COPY ${XBMCROOT}/project/cmake/scripts/common/prepare-env.cmake DESTINATION ${DEPENDS_PATH}/lib/kodi) - # add the location of xbmc-prepare-env.cmake to CMAKE_MODULE_PATH so that it is found - list(APPEND CMAKE_MODULE_PATH ${DEPENDS_PATH}/lib/xbmc) + # add the location of prepare-env.cmake to CMAKE_MODULE_PATH so that it is found + list(APPEND CMAKE_MODULE_PATH ${DEPENDS_PATH}/lib/kodi) - # include xbmc-prepare-env.cmake which contains the logic to install the addon header bindings etc - include(xbmc-prepare-env) + # include prepare-env.cmake which contains the logic to install the addon header bindings etc + include(prepare-env) endif() ### get and build all the binary addons diff --git a/project/cmake/addons/README b/project/cmake/addons/README index 2af5f0f826..93f2f8e607 100644 --- a/project/cmake/addons/README +++ b/project/cmake/addons/README @@ -1,4 +1,4 @@ -XBMC ADDONS +KODI ADDONS =========== This directory contains the cmake-based buildsystem for addons. It looks into the "addons" sub-directory and parses all *.txt files recursively. Each addon @@ -30,11 +30,11 @@ specific paths: builds. * DEPENDS_PATH points to the directory containing the "include" and "lib" directories of the addons' dependencies. - * XBMCROOT points to the root directory of the xbmc project (default is the + * XBMCROOT points to the root directory of the project (default is the absolute representation of ../../.. starting from this directory). * PACKAGE_ZIP=1 will mean the add-ons will be 'packaged' into a common folder, - rather than being placed in /lib/xbmc/addons and - /share/xbmc/addons. + rather than being placed in /lib/kodi/addons and + /share/kodi/addons. * ARCH_DEFINES specifies the platform-specific C/C++ preprocessor defines (defaults to empty). @@ -57,7 +57,7 @@ In case of additional options the call might look like this cmake [-G ] \ -DCMAKE_BUILD_TYPE=Release \ - -DXBMCROOT="" \ + -DXBMCROOT="" \ -DARCH_DEFINES="-DTARGET_LINUX" \ -DDEPENDS_PATH="" \ -DCMAKE_INSTALL_PREFIX="/cmake" sub-directories and parses @@ -36,7 +36,7 @@ specific paths: builds. * CORE_SYSTEM_NAME is the name of the platform (e.g. "linux" or "android") in lower-case (defaults to lowercase(CMAKE_SYSTEM_NAME)). - * XBMCROOT points to the root directory of the xbmc project (default is the + * XBMCROOT points to the root directory of the project (default is the absolute representation of ../../.. starting from this directory). * ARCH_DEFINES specifies the platform-specific C/C++ preprocessor defines (defaults to empty). @@ -56,6 +56,6 @@ In case of additional options the call might look like this cmake [-G ] \ -DCMAKE_BUILD_TYPE=Release \ - -DXBMCROOT="" \ + -DXBMCROOT="" \ -DARCH_DEFINES="-DTARGET_LINUX" \ -DCMAKE_INSTALL_PREFIX="]*version.?=.?.[0-9\\.]+" VERSION_STRING ${ADDONXML}) + STRING(REGEX REPLACE ".*version=.([0-9\\.]+).*" "\\1" ${prefix}_VERSION ${VERSION_STRING}) + message(STATUS ${prefix}_VERSION=${${prefix}_VERSION}) +endmacro() + +# Build, link and optionally package an add-on +macro (build_addon target prefix libs) + ADD_LIBRARY(${target} ${${prefix}_SOURCES}) + TARGET_LINK_LIBRARIES(${target} ${${libs}}) + addon_version(${target} ${prefix}) + SET_TARGET_PROPERTIES(${target} PROPERTIES VERSION ${${prefix}_VERSION} + SOVERSION ${APP_VERSION_MAJOR}.${APP_VERSION_MINOR} + PREFIX "") + IF(OS STREQUAL "android") + SET_TARGET_PROPERTIES(${target} PROPERTIES PREFIX "lib") + ENDIF(OS STREQUAL "android") + + # set zip as default if addon-package is called without PACKAGE_XXX + SET(CPACK_GENERATOR "ZIP") + SET(ext "zip") + IF(PACKAGE_ZIP OR PACKAGE_TGZ) + IF(PACKAGE_TGZ) + SET(CPACK_GENERATOR "TGZ") + SET(ext "tar.gz") + ENDIF(PACKAGE_TGZ) + SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF) + set(CPACK_PACKAGE_FILE_NAME addon) + IF(CMAKE_BUILD_TYPE STREQUAL "Release") + SET(CPACK_STRIP_FILES TRUE) + ENDIF(CMAKE_BUILD_TYPE STREQUAL "Release") + set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) + set(CPACK_COMPONENTS_IGNORE_GROUPS 1) + list(APPEND CPACK_COMPONENTS_ALL ${target}-${${prefix}_VERSION}) + # Pack files together to create an archive + INSTALL(DIRECTORY ${target} DESTINATION ./ COMPONENT ${target}-${${prefix}_VERSION}) + IF(WIN32) + INSTALL(PROGRAMS ${CMAKE_BINARY_DIR}/${target}.dll + DESTINATION ${target} + COMPONENT ${target}-${${prefix}_VERSION}) + ELSE(WIN32) + INSTALL(TARGETS ${target} DESTINATION ${target} + COMPONENT ${target}-${${prefix}_VERSION}) + ENDIF(WIN32) + add_cpack_workaround(${target} ${${prefix}_VERSION} ${ext}) + ELSE(PACKAGE_ZIP OR PACKAGE_TGZ) + INSTALL(TARGETS ${target} DESTINATION lib/kodi/addons/${target}) + INSTALL(DIRECTORY ${target} DESTINATION share/kodi/addons) + ENDIF(PACKAGE_ZIP OR PACKAGE_TGZ) +endmacro() + +# finds a path to a given file (recursive) +function (kodi_find_path var_name filename search_path strip_file) + file(GLOB_RECURSE PATH_TO_FILE ${search_path} ${filename}) + if(strip_file) + string(REPLACE ${filename} "" PATH_TO_FILE ${PATH_TO_FILE}) + endif(strip_file) + set (${var_name} ${PATH_TO_FILE} PARENT_SCOPE) +endfunction() + +# Cmake build options +include(addoptions) +include(TestCXXAcceptsFlag) +OPTION(PACKAGE_ZIP "Package Zip file?" OFF) +OPTION(PACKAGE_TGZ "Package TGZ file?" OFF) +OPTION(BUILD_SHARED_LIBS "Build shared libs?" ON) + +# LTO support? +CHECK_CXX_ACCEPTS_FLAG("-flto" HAVE_LTO) +IF(HAVE_LTO) + OPTION(USE_LTO "use link time optimization" OFF) + IF(USE_LTO) + add_options(ALL_LANGUAGES ALL_BUILDS "-flto") + ENDIF(USE_LTO) +ENDIF(HAVE_LTO) + +# set this to try linking dependencies as static as possible +IF(ADDONS_PREFER_STATIC_LIBS) + SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) +ENDIF(ADDONS_PREFER_STATIC_LIBS) + diff --git a/project/cmake/scripts/common/prepare-env.cmake b/project/cmake/scripts/common/prepare-env.cmake new file mode 100644 index 0000000000..6885f4347e --- /dev/null +++ b/project/cmake/scripts/common/prepare-env.cmake @@ -0,0 +1,71 @@ +# parse version.txt to get the version info +if(EXISTS "${XBMCROOT}/version.txt") + file(STRINGS "${XBMCROOT}/version.txt" versions) + foreach (version ${versions}) + string(REGEX MATCH "^[^ ]+" version_name ${version}) + string(REPLACE "${version_name} " "" version_value ${version}) + set(APP_${version_name} "${version_value}") + endforeach() +endif() + +# bail if we can't parse versions +if(NOT DEFINED APP_VERSION_MAJOR OR NOT DEFINED APP_VERSION_MINOR) + message(FATAL_ERROR "Could not determine app version! make sure that ${XBMCROOT}/version.txt exists") +endif() + +### copy all the addon binding header files to include/kodi +# make sure include/kodi exists and is empty +set(KODI_LIB_DIR ${DEPENDS_PATH}/lib/kodi) +if(NOT EXISTS "${KODI_LIB_DIR}/") + file(MAKE_DIRECTORY ${KODI_LIB_DIR}) +endif() + +set(KODI_INCLUDE_DIR ${DEPENDS_PATH}/include/kodi) +if(NOT EXISTS "${KODI_INCLUDE_DIR}/") + file(MAKE_DIRECTORY ${KODI_INCLUDE_DIR}) +endif() + +# we still need XBMC_INCLUDE_DIR and XBMC_LIB_DIR for backwards compatibility to xbmc +set(XBMC_LIB_DIR ${DEPENDS_PATH}/lib/xbmc) +if(NOT EXISTS "${XBMC_LIB_DIR}/") + file(MAKE_DIRECTORY ${XBMC_LIB_DIR}) +endif() +set(XBMC_INCLUDE_DIR ${DEPENDS_PATH}/include/xbmc) +if(NOT EXISTS "${XBMC_INCLUDE_DIR}/") + file(MAKE_DIRECTORY ${XBMC_INCLUDE_DIR}) +endif() + +# kodi-config.cmake.in (further down) expects a "prefix" variable +get_filename_component(prefix "${DEPENDS_PATH}" ABSOLUTE) + +# generate the proper kodi-config.cmake file +configure_file(${XBMCROOT}/project/cmake/kodi-config.cmake.in ${KODI_LIB_DIR}/kodi-config.cmake @ONLY) +# copy cmake helpers to lib/kodi +file(COPY ${XBMCROOT}/project/cmake/scripts/common/addon-helpers.cmake ${XBMCROOT}/project/cmake/scripts/common/addoptions.cmake DESTINATION ${KODI_LIB_DIR}) + +# generate xbmc-config.cmake for backwards compatibility to xbmc +configure_file(${XBMCROOT}/project/cmake/xbmc-config.cmake.in ${XBMC_LIB_DIR}/xbmc-config.cmake @ONLY) + +### copy all the addon binding header files to include/kodi +# parse addon-bindings.mk to get the list of header files to copy +file(STRINGS ${XBMCROOT}/xbmc/addons/addon-bindings.mk bindings) +string(REPLACE "\n" ";" bindings "${bindings}") +foreach(binding ${bindings}) + string(REPLACE " =" ";" binding "${binding}") + string(REPLACE "+=" ";" binding "${binding}") + list(GET binding 1 header) + # copy the header file to include/kodi + file(COPY ${XBMCROOT}/${header} DESTINATION ${KODI_INCLUDE_DIR}) + + # auto-generate header files for backwards comaptibility to xbmc with deprecation warning + get_filename_component(headerfile ${header} NAME) + file(WRITE ${XBMC_INCLUDE_DIR}/${headerfile} +"#pragma once +#define DEPRECATION_WARNING \"Including xbmc/${headerfile} has been deprecated, please use kodi/${headerfile}\" +#ifdef _MSC_VER + #pragma message(\"WARNING: \" DEPRECATION_WARNING) +#else + #warning DEPRECATION_WARNING +#endif +#include \"kodi/${headerfile}\"") +endforeach() \ No newline at end of file diff --git a/project/cmake/scripts/common/xbmc-addon-helpers.cmake b/project/cmake/scripts/common/xbmc-addon-helpers.cmake deleted file mode 100644 index c882cfcd02..0000000000 --- a/project/cmake/scripts/common/xbmc-addon-helpers.cmake +++ /dev/null @@ -1,99 +0,0 @@ -# Workaround for the fact that cpack's filenames are not customizable. -# Each add-on is added as a separate component to facilitate zip/tgz packaging. -# The filenames are always of the form basename-component, which is -# incompatible with the addonid-version scheme we want. This hack renames -# the files from the file names generated by the 'package' target. -# Sadly we cannot extend the 'package' target, as it is a builtin target, see -# http://public.kitware.com/Bug/view.php?id=8438 -# Thus, we have to add an 'addon-package' target. -add_custom_target(addon-package - COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target package) - -macro(add_cpack_workaround target version ext) - add_custom_command(TARGET addon-package PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E rename addon-${target}-${version}.${ext} ${target}-${version}.${ext}) -endmacro() - -# Grab the version from a given add-on's addon.xml -macro (addon_version dir prefix) - FILE(READ ${dir}/addon.xml ADDONXML) - STRING(REGEX MATCH "]*version.?=.?.[0-9\\.]+" VERSION_STRING ${ADDONXML}) - STRING(REGEX REPLACE ".*version=.([0-9\\.]+).*" "\\1" ${prefix}_VERSION ${VERSION_STRING}) - message(STATUS ${prefix}_VERSION=${${prefix}_VERSION}) -endmacro() - -# Build, link and optionally package an add-on -macro (build_addon target prefix libs) - ADD_LIBRARY(${target} ${${prefix}_SOURCES}) - TARGET_LINK_LIBRARIES(${target} ${${libs}}) - addon_version(${target} ${prefix}) - SET_TARGET_PROPERTIES(${target} PROPERTIES VERSION ${${prefix}_VERSION} - SOVERSION ${APP_VERSION_MAJOR}.${APP_VERSION_MINOR} - PREFIX "") - IF(OS STREQUAL "android") - SET_TARGET_PROPERTIES(${target} PROPERTIES PREFIX "lib") - ENDIF(OS STREQUAL "android") - - # set zip as default if addon-package is called without PACKAGE_XXX - SET(CPACK_GENERATOR "ZIP") - SET(ext "zip") - IF(PACKAGE_ZIP OR PACKAGE_TGZ) - IF(PACKAGE_TGZ) - SET(CPACK_GENERATOR "TGZ") - SET(ext "tar.gz") - ENDIF(PACKAGE_TGZ) - SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF) - set(CPACK_PACKAGE_FILE_NAME addon) - IF(CMAKE_BUILD_TYPE STREQUAL "Release") - SET(CPACK_STRIP_FILES TRUE) - ENDIF(CMAKE_BUILD_TYPE STREQUAL "Release") - set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) - set(CPACK_COMPONENTS_IGNORE_GROUPS 1) - list(APPEND CPACK_COMPONENTS_ALL ${target}-${${prefix}_VERSION}) - # Pack files together to create an archive - INSTALL(DIRECTORY ${target} DESTINATION ./ COMPONENT ${target}-${${prefix}_VERSION}) - IF(WIN32) - INSTALL(PROGRAMS ${CMAKE_BINARY_DIR}/${target}.dll - DESTINATION ${target} - COMPONENT ${target}-${${prefix}_VERSION}) - ELSE(WIN32) - INSTALL(TARGETS ${target} DESTINATION ${target} - COMPONENT ${target}-${${prefix}_VERSION}) - ENDIF(WIN32) - add_cpack_workaround(${target} ${${prefix}_VERSION} ${ext}) - ELSE(PACKAGE_ZIP OR PACKAGE_TGZ) - INSTALL(TARGETS ${target} DESTINATION lib/xbmc/addons/${target}) - INSTALL(DIRECTORY ${target} DESTINATION share/xbmc/addons) - ENDIF(PACKAGE_ZIP OR PACKAGE_TGZ) -endmacro() - -# finds a path to a given file (recursive) -function (xbmc_find_path var_name filename search_path strip_file) - file(GLOB_RECURSE PATH_TO_FILE ${search_path} ${filename}) - if(strip_file) - string(REPLACE ${filename} "" PATH_TO_FILE ${PATH_TO_FILE}) - endif(strip_file) - set (${var_name} ${PATH_TO_FILE} PARENT_SCOPE) -endfunction() - -# Cmake build options -include(addoptions) -include(TestCXXAcceptsFlag) -OPTION(PACKAGE_ZIP "Package Zip file?" OFF) -OPTION(PACKAGE_TGZ "Package TGZ file?" OFF) -OPTION(BUILD_SHARED_LIBS "Build shared libs?" ON) - -# LTO support? -CHECK_CXX_ACCEPTS_FLAG("-flto" HAVE_LTO) -IF(HAVE_LTO) - OPTION(USE_LTO "use link time optimization" OFF) - IF(USE_LTO) - add_options(ALL_LANGUAGES ALL_BUILDS "-flto") - ENDIF(USE_LTO) -ENDIF(HAVE_LTO) - -# set this to try linking dependencies as static as possible -IF(ADDONS_PREFER_STATIC_LIBS) - SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) -ENDIF(ADDONS_PREFER_STATIC_LIBS) - diff --git a/project/cmake/scripts/common/xbmc-prepare-env.cmake b/project/cmake/scripts/common/xbmc-prepare-env.cmake deleted file mode 100644 index ae3b9f28b8..0000000000 --- a/project/cmake/scripts/common/xbmc-prepare-env.cmake +++ /dev/null @@ -1,46 +0,0 @@ -# parse version.txt to get the version info -if(EXISTS "${XBMCROOT}/version.txt") - file(STRINGS "${XBMCROOT}/version.txt" versions) - foreach (version ${versions}) - string(REGEX MATCH "^[^ ]+" version_name ${version}) - string(REPLACE "${version_name} " "" version_value ${version}) - set(APP_${version_name} "${version_value}") - endforeach() -endif() - -# bail if we can't parse versions -if(NOT DEFINED APP_VERSION_MAJOR OR NOT DEFINED APP_VERSION_MINOR) - message(FATAL_ERROR "Could not determine app version! make sure that ${XBMCROOT}/version.txt exists") -endif() - -### copy all the addon binding header files to include/xbmc -# make sure include/xbmc exists and is empty -set(XBMC_LIB_DIR ${DEPENDS_PATH}/lib/xbmc) -if(NOT EXISTS "${XBMC_LIB_DIR}/") - file(MAKE_DIRECTORY ${XBMC_LIB_DIR}) -endif() - -set(XBMC_INCLUDE_DIR ${DEPENDS_PATH}/include/xbmc) -if(NOT EXISTS "${XBMC_INCLUDE_DIR}/") - file(MAKE_DIRECTORY ${XBMC_INCLUDE_DIR}) -endif() - -# xbmc-config.cmake.in (further down) expects a "prefix" variable -get_filename_component(prefix "${DEPENDS_PATH}" ABSOLUTE) - -# generate the proper xbmc-config.cmake file -configure_file(${XBMCROOT}/project/cmake/xbmc-config.cmake.in ${XBMC_LIB_DIR}/xbmc-config.cmake @ONLY) -# copy cmake helpers to lib/xbmc -file(COPY ${XBMCROOT}/project/cmake/scripts/common/xbmc-addon-helpers.cmake ${XBMCROOT}/project/cmake/scripts/common/addoptions.cmake DESTINATION ${XBMC_LIB_DIR}) - -### copy all the addon binding header files to include/xbmc -# parse addon-bindings.mk to get the list of header files to copy -file(STRINGS ${XBMCROOT}/xbmc/addons/addon-bindings.mk bindings) -string(REPLACE "\n" ";" bindings "${bindings}") -foreach(binding ${bindings}) - string(REPLACE " =" ";" binding "${binding}") - string(REPLACE "+=" ";" binding "${binding}") - list(GET binding 1 header) - # copy the header file to include/xbmc - file(COPY ${XBMCROOT}/${header} DESTINATION ${XBMC_INCLUDE_DIR}) -endforeach() \ No newline at end of file diff --git a/project/cmake/scripts/windows/c-flag-overrides.cmake b/project/cmake/scripts/windows/c-flag-overrides.cmake new file mode 100644 index 0000000000..ab19701707 --- /dev/null +++ b/project/cmake/scripts/windows/c-flag-overrides.cmake @@ -0,0 +1,5 @@ +if(MSVC) + set(CMAKE_C_FLAGS "/MP /DWIN32 /D_WINDOWS /W3 /Zi /arch:SSE2") + set(CMAKE_C_FLAGS_DEBUG "/D_DEBUG /MDd /Ob0 /Od /RTC1 /D_HAS_ITERATOR_DEBUGGING=0 /D_SECURE_SCL=0") + set(CMAKE_C_FLAGS_RELEASE "/MD /Ox /Ob2 /Oi /Ot /Oy /GL /DNDEBUG") +endif(MSVC) \ No newline at end of file diff --git a/project/cmake/scripts/windows/cxx-flag-overrides.cmake b/project/cmake/scripts/windows/cxx-flag-overrides.cmake new file mode 100644 index 0000000000..ad3a0908ef --- /dev/null +++ b/project/cmake/scripts/windows/cxx-flag-overrides.cmake @@ -0,0 +1,5 @@ +if(MSVC) + set(CMAKE_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /W3 /GR /Zi /EHsc /arch:SSE2") + set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /MDd /Ob0 /Od /RTC1 /D_HAS_ITERATOR_DEBUGGING=0 /D_SECURE_SCL=0") + set(CMAKE_CXX_FLAGS_RELEASE "/MD /Ox /Ob2 /Oi /Ot /Oy /GL /DNDEBUG") +endif(MSVC) \ No newline at end of file diff --git a/project/cmake/scripts/windows/xbmc-c-flag-overrides.cmake b/project/cmake/scripts/windows/xbmc-c-flag-overrides.cmake deleted file mode 100644 index ab19701707..0000000000 --- a/project/cmake/scripts/windows/xbmc-c-flag-overrides.cmake +++ /dev/null @@ -1,5 +0,0 @@ -if(MSVC) - set(CMAKE_C_FLAGS "/MP /DWIN32 /D_WINDOWS /W3 /Zi /arch:SSE2") - set(CMAKE_C_FLAGS_DEBUG "/D_DEBUG /MDd /Ob0 /Od /RTC1 /D_HAS_ITERATOR_DEBUGGING=0 /D_SECURE_SCL=0") - set(CMAKE_C_FLAGS_RELEASE "/MD /Ox /Ob2 /Oi /Ot /Oy /GL /DNDEBUG") -endif(MSVC) \ No newline at end of file diff --git a/project/cmake/scripts/windows/xbmc-cxx-flag-overrides.cmake b/project/cmake/scripts/windows/xbmc-cxx-flag-overrides.cmake deleted file mode 100644 index ad3a0908ef..0000000000 --- a/project/cmake/scripts/windows/xbmc-cxx-flag-overrides.cmake +++ /dev/null @@ -1,5 +0,0 @@ -if(MSVC) - set(CMAKE_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /W3 /GR /Zi /EHsc /arch:SSE2") - set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /MDd /Ob0 /Od /RTC1 /D_HAS_ITERATOR_DEBUGGING=0 /D_SECURE_SCL=0") - set(CMAKE_CXX_FLAGS_RELEASE "/MD /Ox /Ob2 /Oi /Ot /Oy /GL /DNDEBUG") -endif(MSVC) \ No newline at end of file diff --git a/project/cmake/xbmc-config.cmake.in b/project/cmake/xbmc-config.cmake.in index ba271f3a6e..73d1c9c3a5 100644 --- a/project/cmake/xbmc-config.cmake.in +++ b/project/cmake/xbmc-config.cmake.in @@ -1,8 +1,4 @@ -SET(XBMC_INCLUDE_DIR @prefix@/include) -SET(APP_NAME @APP_NAME@) -SET(APP_VERSION_MAJOR @APP_VERSION_MAJOR@) -SET(APP_VERSION_MINOR @APP_VERSION_MINOR@) -LIST(APPEND CMAKE_MODULE_PATH @prefix@/lib/xbmc) -ADD_DEFINITIONS(@ARCH_DEFINES@) +message(WARNING "find_package(xbmc) has been deprecated, please use find_package(kodi)") -include(xbmc-addon-helpers) +find_package(kodi REQUIRED) +set(XBMC_INCLUDE_DIR ${KODI_INCLUDE_DIR}) \ No newline at end of file diff --git a/tools/buildsteps/win32/make-addon-depends.bat b/tools/buildsteps/win32/make-addon-depends.bat index d649445a37..fd4ac3ce4a 100644 --- a/tools/buildsteps/win32/make-addon-depends.bat +++ b/tools/buildsteps/win32/make-addon-depends.bat @@ -66,8 +66,8 @@ IF "%dependency%" NEQ "" ( rem execute cmake to generate makefiles processable by nmake cmake "%ADDON_DEPENDS_PATH%" -G "NMake Makefiles" ^ -DCMAKE_BUILD_TYPE=Release ^ - -DCMAKE_USER_MAKE_RULES_OVERRIDE="%SCRIPTS_PATH%/xbmc-c-flag-overrides.cmake" ^ - -DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX="%SCRIPTS_PATH%/xbmc-cxx-flag-overrides.cmake" ^ ^ + -DCMAKE_USER_MAKE_RULES_OVERRIDE="%SCRIPTS_PATH%/c-flag-overrides.cmake" ^ + -DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX="%SCRIPTS_PATH%/cxx-flag-overrides.cmake" ^ ^ -DCMAKE_INSTALL_PREFIX=%ADDONS_OUTPUT_PATH% ^ -DARCH_DEFINES="-DTARGET_WINDOWS -DNOMINMAX -D_CRT_SECURE_NO_WARNINGS -D_USE_32BIT_TIME_T -D_WINSOCKAPI_" ^ -DDEPENDS_TO_BUILD="%DEPENDS_TO_BUILD%" diff --git a/tools/buildsteps/win32/make-addons.bat b/tools/buildsteps/win32/make-addons.bat index c10b340396..45764791a8 100644 --- a/tools/buildsteps/win32/make-addons.bat +++ b/tools/buildsteps/win32/make-addons.bat @@ -93,8 +93,8 @@ IF "%addon%" NEQ "" ( rem execute cmake to generate makefiles processable by nmake cmake "%ADDONS_PATH%" -G "NMake Makefiles" ^ -DCMAKE_BUILD_TYPE=Release ^ - -DCMAKE_USER_MAKE_RULES_OVERRIDE="%SCRIPTS_PATH%/xbmc-c-flag-overrides.cmake" ^ - -DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX="%SCRIPTS_PATH%/xbmc-cxx-flag-overrides.cmake" ^ + -DCMAKE_USER_MAKE_RULES_OVERRIDE="%SCRIPTS_PATH%/c-flag-overrides.cmake" ^ + -DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX="%SCRIPTS_PATH%/cxx-flag-overrides.cmake" ^ -DCMAKE_INSTALL_PREFIX=%ADDONS_INSTALL_PATH% ^ -DXBMCROOT=%WORKDIR% ^ -DCMAKE_PREFIX_PATH=%ADDON_DEPENDS_PATH% ^ -- cgit v1.2.3