-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathlibparams.cmake
More file actions
50 lines (42 loc) · 1.65 KB
/
Copy pathlibparams.cmake
File metadata and controls
50 lines (42 loc) · 1.65 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
# Copyright (c) 2023-2025 Dmitry Ponomarev <ponomarevda96@gmail.com>
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
cmake_minimum_required(VERSION 3.22)
if(LIBPARAMS_PLATFORM STREQUAL "stm32f103")
elseif(LIBPARAMS_PLATFORM STREQUAL "stm32g0b1")
elseif(LIBPARAMS_PLATFORM STREQUAL "stm32h753xx")
elseif(LIBPARAMS_PLATFORM STREQUAL "ubuntu")
else()
message(SEND_ERROR "LIBPARAMS_PLATFORM is not specified! Options: stm32f103, stm32g0b1, stm32h753xx, ubuntu.")
endif()
FILE(GLOB libparamsPlatformSpecificSrc
${CMAKE_CURRENT_LIST_DIR}/platform_specific/${LIBPARAMS_PLATFORM}/*.c*
)
if(LIBPARAMS_PLATFORM STREQUAL "stm32h753xx")
FILE(GLOB libparamsStm32h753xxSpiFramSrc
${CMAKE_CURRENT_LIST_DIR}/platform_specific/stm32h753xx/stm32h753xx_spifram/*.c*
)
list(APPEND libparamsPlatformSpecificSrc ${libparamsStm32h753xxSpiFramSrc})
endif()
FILE(GLOB libparamsPlatformSpecificHeaders
${CMAKE_CURRENT_LIST_DIR}/platform_specific/${LIBPARAMS_PLATFORM}/
)
set(libparamsExtraPlatformHeaders)
if(LIBPARAMS_PLATFORM STREQUAL "stm32h753xx")
list(APPEND libparamsExtraPlatformHeaders
${CMAKE_CURRENT_LIST_DIR}/platform_specific/stm32h753xx/stm32h753xx_spifram/
)
endif()
set(libparamsSrc
${CMAKE_CURRENT_LIST_DIR}/src/rom.c
${CMAKE_CURRENT_LIST_DIR}/src/storage.c
${libparamsPlatformSpecificSrc}
)
set(libparamsHeaders
${CMAKE_CURRENT_LIST_DIR}/include/libparams/
${CMAKE_CURRENT_LIST_DIR}/platform_specific/${LIBPARAMS_PLATFORM}/
${libparamsPlatformSpecificHeaders}
${libparamsExtraPlatformHeaders}
)