summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2017-04-23 11:23:13 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2017-04-23 11:23:13 +0200
commit4c159924abc0ad027166fe8853d062ed0a46481e (patch)
treeb1a2bdbd4367d8e3a6f5218a0fdea0be3d541951 /CMakeLists.txt
downloadradio-controller-4c159924abc0ad027166fe8853d062ed0a46481e.tar.gz
radio-controller-4c159924abc0ad027166fe8853d062ed0a46481e.tar.bz2
radio-controller-4c159924abc0ad027166fe8853d062ed0a46481e.tar.xz
radio-controller-4c159924abc0ad027166fe8853d062ed0a46481e.zip
o Initial start of radio controller.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt48
1 files changed, 48 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..3ed8461
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,48 @@
+cmake_minimum_required(VERSION 3.6)
+set(MCU_CHIP stm32f103C6)
+set(MCU_USE_STM32CUBEMX TRUE)
+include(thirdparty/mcu.cmake/mcu.cmake)
+project(radio-controller C CXX ASM)
+
+set(CMAKE_CXX_STANDARD 14)
+
+add_executable(firmware src/radio-controller.cpp)
+target_compile_definitions(firmware PUBLIC MCUCMAKE_USING_STM32CUBEMX=1)
+target_link_libraries(firmware PUBLIC gcc)
+mcu_add_executable(TARGET firmware)
+
+# mcu.cmake sources
+target_include_directories(firmware PUBLIC
+ thirdparty/mcu.cmake/stm32f103/include
+)
+target_sources(firmware PUBLIC
+ thirdparty/mcu.cmake/stm32f103/src/default_handler.cpp
+ thirdparty/mcu.cmake/stm32f103/src/init_high.cpp
+ thirdparty/mcu.cmake/stm32f103/src/init_low.s
+)
+
+# mcucpp sources
+target_include_directories(firmware PUBLIC
+ thirdparty/mcucpp/include
+ thirdparty/mcucpp/thirdparty/tinyprintf
+)
+target_sources(firmware PUBLIC
+ thirdparty/mcucpp/src/arm/semihosting.cpp
+ thirdparty/mcucpp/src/arm/semihosting-putc.cpp
+ thirdparty/mcucpp/src/arm/semihosting-putchar.cpp
+ thirdparty/mcucpp/src/generic/tinyprintf-printf.cpp
+ thirdparty/mcucpp/src/generic/tinyprintf-snprintf.cpp
+ thirdparty/mcucpp/thirdparty/tinyprintf/tinyprintf.c
+)
+
+# stm32cubemx sources
+mcu_include_directories_from_sources(
+ SOURCE_DIR stm32cubemx
+ EXCLUDE Templates
+ EXCLUDE stm32f1xx_it.c
+ SOURCES_VAR STM32_CUBEMX_SOURCES
+ HEADERS_VAR STM32_CUBEMX_HEADERS
+ INCLUDES_VAR STM32_CUBEMX_INCLUDES
+)
+target_include_directories(firmware PUBLIC ${STM32_CUBEMX_INCLUDES})
+target_sources(firmware PUBLIC ${STM32_CUBEMX_SOURCES} ${STM32_CUBEMX_HEADERS})