-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
executable file
·38 lines (31 loc) · 1.22 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
38
### This file is used for build example projects.
# set this will supress some warnings
set(BUILDING_SDK "yes" CACHE INTERNAL "")
# LoBo: do not show all messages
set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
# basic config
if (NOT PROJ)
message("No project, only compiling libraries")
set(PROJ "Dummy")
else()
message("PROJ = ${PROJ}")
endif ()
cmake_minimum_required(VERSION 3.0)
include(./cmake/common.cmake)
project(${PROJ})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_LIST_DIR}/lib/arch/include ${CMAKE_CURRENT_LIST_DIR}/lib/utils/include)
# config self use headers
header_directories(${SDK_ROOT}/lib)
# build library first
add_subdirectory(lib SDK)
add_subdirectory(third_party)
# Do not compile project if not given
if (NOT PROJ STREQUAL "Dummy")
include_directories(${CMAKE_CURRENT_LIST_DIR}/lib/drivers/include
${CMAKE_CURRENT_LIST_DIR}/lib/hal/include
${CMAKE_CURRENT_LIST_DIR}/lib/freertos/include
${CMAKE_CURRENT_LIST_DIR}/lib/freertos/portable
${CMAKE_CURRENT_LIST_DIR}/lib/freertos/conf)
add_source_files(src/${PROJ}/*.c src/${PROJ}/*.s src/${PROJ}/*.S src/${PROJ}/*.cpp)
include(./cmake/executable.cmake)
endif ()