Raef Coles | 1971538 | 2020-07-10 09:50:17 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
| 2 | # Copyright (c) 2020, Arm Limited. All rights reserved. |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | |
| 8 | include(FetchContent) |
| 9 | set(FETCHCONTENT_QUIET FALSE) |
| 10 | |
| 11 | # Set to not download submodules if that option is available |
| 12 | if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0") |
| 13 | cmake_policy(SET CMP0097 NEW) |
| 14 | endif() |
| 15 | |
| 16 | if ("${MCUBOOT_PATH}" STREQUAL "DOWNLOAD") |
| 17 | FetchContent_Declare(mcuboot |
| 18 | GIT_REPOSITORY https://github.com/JuulLabs-OSS/mcuboot.git |
Tamas Ban | 63f87ca | 2020-09-21 10:41:51 +0100 | [diff] [blame] | 19 | GIT_TAG ${MCUBOOT_VERSION} |
Tamas Ban | 4b2d5a2 | 2020-09-16 13:15:43 +0100 | [diff] [blame] | 20 | GIT_SHALLOW FALSE |
Raef Coles | 1971538 | 2020-07-10 09:50:17 +0100 | [diff] [blame] | 21 | GIT_PROGRESS TRUE |
Øyvind Rønningstad | 1655ef5 | 2020-10-30 21:29:40 +0100 | [diff] [blame] | 22 | GIT_SUBMODULES "docs" # Workaround for |
| 23 | # https://gitlab.kitware.com/cmake/cmake/-/issues/20579 |
| 24 | # in cmake 3.17 and below. |
Raef Coles | 1971538 | 2020-07-10 09:50:17 +0100 | [diff] [blame] | 25 | ) |
Tamas Ban | 4b2d5a2 | 2020-09-16 13:15:43 +0100 | [diff] [blame] | 26 | # ToDo: set GIT_SHALLOW to 'TRUE' when MCUBOOT_VERSION will be set to a tag |
| 27 | # (instead of a commit hash) with the new release. |
Raef Coles | 1971538 | 2020-07-10 09:50:17 +0100 | [diff] [blame] | 28 | |
| 29 | FetchContent_GetProperties(mcuboot) |
| 30 | if(NOT mcuboot_POPULATED) |
| 31 | FetchContent_Populate(mcuboot) |
| 32 | set(MCUBOOT_PATH ${mcuboot_SOURCE_DIR} CACHE PATH "Path to MCUBOOT (or DOWNLOAD to get automatically" FORCE) |
| 33 | endif() |
| 34 | endif() |