blob: 822843f7505adf90f8fa35f2629b2dd39a3689b2 [file] [log] [blame]
Raef Coles19715382020-07-10 09:50:17 +01001#-------------------------------------------------------------------------------
2# Copyright (c) 2020, Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
8include(FetchContent)
9set(FETCHCONTENT_QUIET FALSE)
10
11# Set to not download submodules if that option is available
12if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0")
13 cmake_policy(SET CMP0097 NEW)
14endif()
15
16if ("${MCUBOOT_PATH}" STREQUAL "DOWNLOAD")
17 FetchContent_Declare(mcuboot
18 GIT_REPOSITORY https://github.com/JuulLabs-OSS/mcuboot.git
Tamas Ban63f87ca2020-09-21 10:41:51 +010019 GIT_TAG ${MCUBOOT_VERSION}
Tamas Ban4b2d5a22020-09-16 13:15:43 +010020 GIT_SHALLOW FALSE
Raef Coles19715382020-07-10 09:50:17 +010021 GIT_PROGRESS TRUE
22 GIT_SUBMODULES ""
23 )
Tamas Ban4b2d5a22020-09-16 13:15:43 +010024 # ToDo: set GIT_SHALLOW to 'TRUE' when MCUBOOT_VERSION will be set to a tag
25 # (instead of a commit hash) with the new release.
Raef Coles19715382020-07-10 09:50:17 +010026
27 FetchContent_GetProperties(mcuboot)
28 if(NOT mcuboot_POPULATED)
29 FetchContent_Populate(mcuboot)
30 set(MCUBOOT_PATH ${mcuboot_SOURCE_DIR} CACHE PATH "Path to MCUBOOT (or DOWNLOAD to get automatically" FORCE)
31 endif()
32endif()