diff options
author | montellese <montellese@xbmc.org> | 2014-11-01 00:10:32 +0100 |
---|---|---|
committer | montellese <montellese@xbmc.org> | 2014-11-01 00:19:58 +0100 |
commit | a0c76f05581f5d49f56cd4ba7e34c62e1cf788b6 (patch) | |
tree | 5f605b874fee17e0268afefbbbc6e5bdc81101e8 | |
parent | c6a7abdaa9900b45f9b63984cdb47969e7efdd60 (diff) |
cmake: rename XBMCROOT to APP_ROOT with backwards compatibility
-rw-r--r-- | project/cmake/addons/CMakeLists.txt | 12 | ||||
-rw-r--r-- | project/cmake/addons/README | 4 | ||||
-rw-r--r-- | project/cmake/addons/depends/README | 4 | ||||
-rw-r--r-- | project/cmake/addons/depends/windows/cmake/kodi/CMakeLists.txt | 12 | ||||
-rw-r--r-- | project/cmake/scripts/common/prepare-env.cmake | 16 | ||||
-rw-r--r-- | tools/buildsteps/win32/make-addons.bat | 2 |
6 files changed, 27 insertions, 23 deletions
diff --git a/project/cmake/addons/CMakeLists.txt b/project/cmake/addons/CMakeLists.txt index 755ba9e733..e41ab0f951 100644 --- a/project/cmake/addons/CMakeLists.txt +++ b/project/cmake/addons/CMakeLists.txt @@ -15,12 +15,14 @@ endif() include(ExternalProject) ### setup all the necessary paths -if(NOT XBMCROOT) - set(XBMCROOT ${PROJECT_SOURCE_DIR}/../../..) +if(NOT APP_ROOT AND NOT XBMCROOT) + set(APP_ROOT ${PROJECT_SOURCE_DIR}/../../..) +elseif(NOT APP_ROOT) + file(TO_CMAKE_PATH "${XBMCROOT}" APP_ROOT) else() - file(TO_CMAKE_PATH "${XBMCROOT}" XBMCROOT) + file(TO_CMAKE_PATH "${APP_ROOT}" APP_ROOT) endif() -get_filename_component(XBMCROOT "${XBMCROOT}" ABSOLUTE) +get_filename_component(APP_ROOT "${APP_ROOT}" ABSOLUTE) if(NOT WIN32) if(NOT DEPENDS_PATH) @@ -71,7 +73,7 @@ endif() if(NOT WIN32) # 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) + file(COPY ${APP_ROOT}/project/cmake/scripts/common/prepare-env.cmake DESTINATION ${DEPENDS_PATH}/lib/kodi) # 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) diff --git a/project/cmake/addons/README b/project/cmake/addons/README index 93f2f8e607..159f7c5a4b 100644 --- a/project/cmake/addons/README +++ b/project/cmake/addons/README @@ -30,7 +30,7 @@ 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 project (default is the + * APP_ROOT 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 <CMAKE_INSTALL_PREFIX>/lib/kodi/addons and @@ -57,7 +57,7 @@ In case of additional options the call might look like this cmake <path> [-G <generator>] \ -DCMAKE_BUILD_TYPE=Release \ - -DXBMCROOT="<path-to-app-root>" \ + -DAPP_ROOT="<path-to-app-root>" \ -DARCH_DEFINES="-DTARGET_LINUX" \ -DDEPENDS_PATH="<path-to-built-depends>" \ -DCMAKE_INSTALL_PREFIX="<path-to-install-directory" diff --git a/project/cmake/addons/depends/README b/project/cmake/addons/depends/README index 36ae24a46d..c26a41c9a6 100644 --- a/project/cmake/addons/depends/README +++ b/project/cmake/addons/depends/README @@ -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 project (default is the + * APP_ROOT 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 <path> [-G <generator>] \ -DCMAKE_BUILD_TYPE=Release \ - -DXBMCROOT="<path-to-project-root>" \ + -DAPP_ROOT="<path-to-project-root>" \ -DARCH_DEFINES="-DTARGET_LINUX" \ -DCMAKE_INSTALL_PREFIX="<path-to-install-directory" diff --git a/project/cmake/addons/depends/windows/cmake/kodi/CMakeLists.txt b/project/cmake/addons/depends/windows/cmake/kodi/CMakeLists.txt index ab49ddf0a1..811f5be2ae 100644 --- a/project/cmake/addons/depends/windows/cmake/kodi/CMakeLists.txt +++ b/project/cmake/addons/depends/windows/cmake/kodi/CMakeLists.txt @@ -6,12 +6,14 @@ list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR}) ### setup all the necessary paths -if(NOT XBMCROOT) - set(XBMCROOT ${PROJECT_SOURCE_DIR}/../../../../../../..) +if(NOT APP_ROOT AND NOT XBMCROOT) + set(APP_ROOT ${PROJECT_SOURCE_DIR}/../../../../../../..) +elseif(NOT APP_ROOT) + file(TO_CMAKE_PATH "${XBMCROOT}" APP_ROOT) else() - file(TO_CMAKE_PATH "${XBMCROOT}" XBMCROOT) + file(TO_CMAKE_PATH "${APP_ROOT}" APP_ROOT) endif() -get_filename_component(XBMCROOT "${XBMCROOT}" ABSOLUTE) +get_filename_component(APP_ROOT "${APP_ROOT}" ABSOLUTE) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR NOT CMAKE_INSTALL_PREFIX) message(FATAL_ERROR "CMAKE_INSTALL_PREFIX (${CMAKE_INSTALL_PREFIX}) is not a valid target directory.") @@ -25,7 +27,7 @@ get_filename_component(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" ABSOLUTE) set(DEPENDS_PATH "${CMAKE_INSTALL_PREFIX}") # copy the prepare-env.cmake script so that we can include it -file(COPY ${XBMCROOT}/project/cmake/scripts/common/prepare-env.cmake DESTINATION ${CMAKE_BINARY_DIR}) +file(COPY ${APP_ROOT}/project/cmake/scripts/common/prepare-env.cmake DESTINATION ${CMAKE_BINARY_DIR}) # include prepare-env.cmake which contains the logic to install the addon header bindings etc include(prepare-env)
\ No newline at end of file diff --git a/project/cmake/scripts/common/prepare-env.cmake b/project/cmake/scripts/common/prepare-env.cmake index 4d47209652..c0b5217ac9 100644 --- a/project/cmake/scripts/common/prepare-env.cmake +++ b/project/cmake/scripts/common/prepare-env.cmake @@ -1,6 +1,6 @@ # parse version.txt to get the version info -if(EXISTS "${XBMCROOT}/version.txt") - file(STRINGS "${XBMCROOT}/version.txt" versions) +if(EXISTS "${APP_ROOT}/version.txt") + file(STRINGS "${APP_ROOT}/version.txt" versions) foreach (version ${versions}) if(version MATCHES "^VERSION_.*") string(REGEX MATCH "^[^ ]+" version_name ${version}) @@ -16,7 +16,7 @@ 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") + message(FATAL_ERROR "Could not determine app version! make sure that ${APP_ROOT}/version.txt exists") endif() ### copy all the addon binding header files to include/kodi @@ -45,23 +45,23 @@ endif() 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) +configure_file(${APP_ROOT}/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}) +file(COPY ${APP_ROOT}/project/cmake/scripts/common/addon-helpers.cmake ${APP_ROOT}/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) +configure_file(${APP_ROOT}/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) +file(STRINGS ${APP_ROOT}/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}) + file(COPY ${APP_ROOT}/${header} DESTINATION ${KODI_INCLUDE_DIR}) # auto-generate header files for backwards comaptibility to xbmc with deprecation warning get_filename_component(headerfile ${header} NAME) diff --git a/tools/buildsteps/win32/make-addons.bat b/tools/buildsteps/win32/make-addons.bat index 45764791a8..48ff14073b 100644 --- a/tools/buildsteps/win32/make-addons.bat +++ b/tools/buildsteps/win32/make-addons.bat @@ -96,7 +96,7 @@ cmake "%ADDONS_PATH%" -G "NMake Makefiles" ^ -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% ^ + -DAPP_ROOT=%WORKDIR% ^ -DCMAKE_PREFIX_PATH=%ADDON_DEPENDS_PATH% ^ -DPACKAGE_ZIP=1 ^ -DARCH_DEFINES="-DTARGET_WINDOWS -DNOMINMAX -D_CRT_SECURE_NO_WARNINGS -D_USE_32BIT_TIME_T -D_WINSOCKAPI_" ^ |