aboutsummaryrefslogtreecommitdiff
path: root/project/cmake/scripts/common
diff options
context:
space:
mode:
Diffstat (limited to 'project/cmake/scripts/common')
-rw-r--r--project/cmake/scripts/common/addon-helpers.cmake (renamed from project/cmake/scripts/common/xbmc-addon-helpers.cmake)6
-rw-r--r--project/cmake/scripts/common/prepare-env.cmake71
-rw-r--r--project/cmake/scripts/common/xbmc-prepare-env.cmake46
3 files changed, 74 insertions, 49 deletions
diff --git a/project/cmake/scripts/common/xbmc-addon-helpers.cmake b/project/cmake/scripts/common/addon-helpers.cmake
index c882cfcd02..3f42ffa595 100644
--- a/project/cmake/scripts/common/xbmc-addon-helpers.cmake
+++ b/project/cmake/scripts/common/addon-helpers.cmake
@@ -62,13 +62,13 @@ macro (build_addon target prefix libs)
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)
+ 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 (xbmc_find_path var_name filename search_path strip_file)
+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})
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-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