diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
commit | c04dcc2e7d834218ef2d4194331e383402495ae1 (patch) | |
tree | 7333e38d10d75386e60f336b80c2443c1166031d /cmake/addons/depends/CMakeLists.txt | |
parent | Initial commit. (diff) | |
download | kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.tar.xz kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.zip |
Adding upstream version 2:20.4+dfsg.upstream/2%20.4+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmake/addons/depends/CMakeLists.txt')
-rw-r--r-- | cmake/addons/depends/CMakeLists.txt | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/cmake/addons/depends/CMakeLists.txt b/cmake/addons/depends/CMakeLists.txt new file mode 100644 index 0000000..831e0ed --- /dev/null +++ b/cmake/addons/depends/CMakeLists.txt @@ -0,0 +1,41 @@ +cmake_minimum_required(VERSION 3.1) +project(kodi-addons-depends) + +list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) + +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release) +endif() + +if(NOT CORE_SYSTEM_NAME) + string(TOLOWER ${CMAKE_SYSTEM_NAME} CORE_SYSTEM_NAME) +endif() + +include(ExternalProject) + +if(NOT ADDON_DEPENDS_PATH) + set(ADDON_DEPENDS_PATH ${PROJECT_SOURCE_DIR}/../build/depends) +else() + file(TO_CMAKE_PATH "${ADDON_DEPENDS_PATH}" ADDON_DEPENDS_PATH) +endif() +get_filename_component(ADDON_DEPENDS_PATH "${ADDON_DEPENDS_PATH}" ABSOLUTE) +list(APPEND CMAKE_PREFIX_PATH ${ADDON_DEPENDS_PATH}) + +if(NOT BUILD_DIR) + set(BUILD_DIR "${CMAKE_BINARY_DIR}/build") +else() + file(TO_CMAKE_PATH "${BUILD_DIR}" BUILD_DIR) +endif() +get_filename_component(BUILD_DIR "${BUILD_DIR}" ABSOLUTE) + +## use add_addon_depends to handle the cmake based dependencies +include(${CORE_SOURCE_DIR}/cmake/scripts/common/HandleDepends.cmake) +add_addon_depends(depends "${PROJECT_SOURCE_DIR}") + +## if there's a platform-specific sub-directory containing a CMakeLists.txt, add it to the build as well +if(EXISTS ${PROJECT_SOURCE_DIR}/${CORE_SYSTEM_NAME}/CMakeLists.txt) + message(STATUS "Processing ${CORE_SYSTEM_NAME}") + add_subdirectory(${CORE_SYSTEM_NAME}) +else() + message(STATUS "No platform specific file ${PROJECT_SOURCE_DIR}/${CORE_SYSTEM_NAME}/CMakeLists.txt found") +endif() |