-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·36 lines (25 loc) · 1.62 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
project(codal-stm32-NUCLEO_F4x1RE)
include("${CODAL_UTILS_LOCATION}")
# find sources and headers
RECURSIVE_FIND_DIR(TOP_LEVEL_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/inc" "*.h")
RECURSIVE_FIND_FILE(TOP_LEVEL_INCLUDE_DIRS0 "${CMAKE_CURRENT_SOURCE_DIR}/source" "*.h")
RECURSIVE_FIND_FILE(TOP_LEVEL_SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/source" "*.c")
RECURSIVE_FIND_FILE(TOP_LEVEL_SOURCE_FILES0 "${CMAKE_CURRENT_SOURCE_DIR}/source" "*.cpp")
RECURSIVE_FIND_DIR(MODEL_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/model" "*.h")
RECURSIVE_FIND_FILE(MODEL_SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/model" "*.c")
RECURSIVE_FIND_FILE(MODEL_SOURCE_FILES0 "${CMAKE_CURRENT_SOURCE_DIR}/model" "*.cpp")
RECURSIVE_FIND_DIR(SAMPLES_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/samples" "*.h")
RECURSIVE_FIND_FILE(SAMPLES_SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/samples" "*.c")
RECURSIVE_FIND_FILE(SAMPLES_SOURCE_FILES0 "${CMAKE_CURRENT_SOURCE_DIR}/samples" "*.cpp")
string(TOLOWER "${CODAL_TARGET_PROCESSOR}" TARGET_PROCESSOR)
# add them
include_directories(${INCLUDE_DIRS} ${TOP_LEVEL_INCLUDE_DIRS} ${TOP_LEVEL_INCLUDE_DIRS0} ${MODEL_INCLUDE_DIRS} ${SAMPLES_INCLUDE_DIRS})
# create our target
add_library(codal-stm32-NUCLEO_F4x1RE ${TOP_LEVEL_SOURCE_FILES} ${TOP_LEVEL_SOURCE_FILES0} ${MODEL_SOURCE_FILES} ${MODEL_SOURCE_FILES0} ${SAMPLES_SOURCE_FILES} ${SAMPLES_SOURCE_FILES0})
target_link_libraries(
codal-stm32-NUCLEO_F4x1RE
codal-core
codal-stm32
)
# expose it to parent cmake.
target_include_directories(codal-stm32-NUCLEO_F4x1RE PUBLIC ${TOP_LEVEL_INCLUDE_DIRS} ${TOP_LEVEL_INCLUDE_DIRS0} ${MODEL_INCLUDE_DIRS} ${SAMPLES_INCLUDE_DIRS})