-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
37 lines (30 loc) · 1.37 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Minimum version for cmake compatiblity
cmake_minimum_required(VERSION 3.25)
include(CMakePrintHelpers)
include(FetchContent)
# show limited messages while cloning git repos
set(FETCHCONTENT_QUIET ON)
cmake_print_variables(GITHUB_BRANCH_TOOLCHAIN)
FetchContent_Declare(
cmake-toolchains # Recommendation: Stick close to the original name.
GIT_REPOSITORY git@github.com:kodezine/cmake-toolchains.git
GIT_TAG ${GITHUB_BRANCH_TOOLCHAIN}
)
# pre-fetch the toolchain repository as the first job before project configuration
FetchContent_GetProperties(cmake-toolchains)
if(NOT cmake-toolchains_POPULATED)
FetchContent_Populate(cmake-toolchains)
endif()
project(stm32f072rb-disco-board)
# Set pre-requsities for selecting the CPU identifier for cross compilation
set(CORTEX_TYPE "cm0" CACHE STRING "CPU identifier for toolchains options")
# Set pre-requsites for selecting the STM32 microcontroller family type
set(STM32_TYPE "f0" CACHE STRING "STM32 HAL Microcontroller type")
# Set pre-requisite for exact device name of the STM32
set(STM32_DEVICE "STM32F072xB" CACHE STRING "STM32 Microcontoller Device")
# Set branch names for the sub modules dependencies
set(GITHUB_BRANCH_TOOLCHAIN "HEAD" CACHE STRING "git SHA for CMake Toolchain")
include(${CMAKE_CURRENT_LIST_DIR}/cmake/lib_stm32f072rb_disco.cmake)
if(DEMO)
add_subdirectory(demo)
endif()