-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
38 lines (31 loc) · 1.14 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)
set(CORTEX_TYPE "cm0")
# Set branch names for the sub modules dependencies
set(GITHUB_BRANCH_TOOLCHAIN "HEAD" CACHE STRING "git SHA for CMake Toolchain")
# set the location of all fetched repos
set(FETCHCONTENT_BASE_DIR "${CMAKE_SOURCE_DIR}/_deps")
# 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(hal
VERSION 0.0.1
LANGUAGES C ASM CXX
DESCRIPTION "Hardware Abstraction Layer for STM32CubeMx based project"
)
include(cmake/lib_hal.cmake)
if(DEMO)
add_subdirectory(demo)
endif()