Change cmake build

This commit is contained in:
Nanosonde 2020-10-18 17:41:33 +02:00
parent 7584e325d2
commit 779ab2a5fd
6 changed files with 90 additions and 43 deletions

View File

@ -1,18 +1,30 @@
##
## Uatecho Example
## KNX for CC1310
##
project(knx-cc1310 C CXX ASM)
cmake_minimum_required(VERSION 3.6)
cmake_minimum_required(VERSION 3.12)
# Generate a "compile_commands.json" file containing the exact compiler calls for all translation units of the project in machine-readable form.
# Useful for C/CPP extension of VS code
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Use <Package>_ROOT variables for locating in find_path, find_package, etc.
cmake_policy(SET CMP0074 NEW)
# Append current directory to CMAKE_MODULE_PATH for making device specific cmake modules visible
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)
message("CMAKE_MODULE_PATH: ${CMAKE_MODULE_PATH}")
# Configure Toolchain for CC13xx
set(LINKER_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/CC1310_LAUNCHXL_NoRTOS.lds")
include(cc13xx)
set(SimpleLinkCC13X0SDKnortos_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/coresdk_cc13xx_cc26xx")
message("SimpleLinkCC13X0SDKnortos_ROOT: ${SimpleLinkCC13X0SDKnortos_ROOT}")
# Find dependencies
find_package(SimpleLinkCC13X0SDK_nortos REQUIRED)
find_package(SimpleLinkCC13X0SDKnortos REQUIRED)
#
# Target

View File

@ -1,2 +1,2 @@
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_PREFIX_PATH="~/ti/simplelink_cc13x0_sdk_4_10_02_04" -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-arm-none-eabi.cmake ..
#cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_PREFIX_PATH="~/ti/simplelink_cc13x0_sdk_4_10_02_04" -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-arm-none-eabi.cmake ..
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-arm-none-eabi.cmake ..

View File

@ -1,6 +1,27 @@
## Derived from this project: https://github.com/jobroe/cmake-arm-embedded
##
## Author: Johannes Bruder
## License: See LICENSE.TXT file included in the project
## MIT License
##
## Copyright (c) 2018 Johannes Bruder
##
## Permission is hereby granted, free of charge, to any person obtaining a copy
## of this software and associated documentation files (the "Software"), to deal
## in the Software without restriction, including without limitation the rights
## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
## copies of the Software, and to permit persons to whom the Software is
## furnished to do so, subject to the following conditions:
##
## The above copyright notice and this permission notice shall be included in all
## copies or substantial portions of the Software.
##
## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
## AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
## SOFTWARE.
##
## Find TI's SimpleLink CC13X0 SDK
##
@ -25,10 +46,10 @@ find_library(SimpleLinkCC13X0SDK_rf_singleMode_cc13x0_LIBRARY
)
# Find cc13x0 radio multi mode lib
#find_library(SimpleLinkCC13X0SDK_rf_multiMode_cc13x0_LIBRARY
# NAMES rf_multiMode_cc13x0.am3g
# PATH_SUFFIXES "source/ti/drivers/rf/lib"
#)
find_library(SimpleLinkCC13X0SDK_rf_multiMode_cc13x0_LIBRARY
NAMES rf_multiMode_cc13x0.am3g
PATH_SUFFIXES "source/ti/drivers/rf/lib"
)
# Find driver porting layer (NoRTOS) lib
find_library(SimpleLinkCC13X0SDK_dpl_cc13x0_LIBRARY
@ -46,10 +67,9 @@ set(SimpleLinkCC13X0SDK_INCLUDE_DIRS
"${SimpleLinkCC13X0SDK_DEVICES_DIR}/../.."
"${SimpleLinkCC13X0SDK_DEVICES_DIR}/../../../kernel/nortos"
)
message("Content of SimpleLinkCC13X0SDK_INCLUDE_DIRS " ${SimpleLinkCC13X0SDK_INCLUDE_DIRS})
# Handle arguments and set SimpleLinkCC13X0SDK_FOUND to TRUE if all listed variables are TRUE
find_package_handle_standard_args(SimpleLinkCC13X0SDK DEFAULT_MSG
find_package_handle_standard_args(SimpleLinkCC13X0SDK DEFAULT_MSG
SimpleLinkCC13X0SDK_drivers_cc13x0_LIBRARY
SimpleLinkCC13X0SDK_rf_singleMode_cc13x0_LIBRARY
SimpleLinkCC13X0SDK_dpl_cc13x0_LIBRARY

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2018 Johannes Bruder
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,7 +1,27 @@
## Derived from this project: https://github.com/jobroe/cmake-arm-embedded
##
## Author: Johannes Bruder
## License: See LICENSE.TXT file included in the project
## MIT License
##
## Copyright (c) 2018 Johannes Bruder
##
## Permission is hereby granted, free of charge, to any person obtaining a copy
## of this software and associated documentation files (the "Software"), to deal
## in the Software without restriction, including without limitation the rights
## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
## copies of the Software, and to permit persons to whom the Software is
## furnished to do so, subject to the following conditions:
##
## The above copyright notice and this permission notice shall be included in all
## copies or substantial portions of the Software.
##
## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
## AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
## SOFTWARE.
##
## CC13xx target specific CMake file
##

View File

@ -1,16 +1,33 @@
## Derived from this project: https://github.com/jobroe/cmake-arm-embedded
##
## Author: Johannes Bruder
## License: See LICENSE.TXT file included in the project
## MIT License
##
## Copyright (c) 2018 Johannes Bruder
##
## Permission is hereby granted, free of charge, to any person obtaining a copy
## of this software and associated documentation files (the "Software"), to deal
## in the Software without restriction, including without limitation the rights
## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
## copies of the Software, and to permit persons to whom the Software is
## furnished to do so, subject to the following conditions:
##
## The above copyright notice and this permission notice shall be included in all
## copies or substantial portions of the Software.
##
## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
## AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
## SOFTWARE.
##
## CMake arm-none-eabi toolchain file
##
# Append current directory to CMAKE_MODULE_PATH for making device specific cmake modules visible
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
# Target definition
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR ARM)
#---------------------------------------------------------------------------------------
@ -96,7 +113,6 @@ set(CMAKE_C_COMPILER ${TOOLCHAIN_BIN_DIR}/${TOOLCHAIN}-gcc${TOOLCHAIN_EXT} CACHE
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_BIN_DIR}/${TOOLCHAIN}-g++${TOOLCHAIN_EXT} CACHE INTERNAL "C++ Compiler")
set(CMAKE_ASM_COMPILER ${TOOLCHAIN_BIN_DIR}/${TOOLCHAIN}-gcc${TOOLCHAIN_EXT} CACHE INTERNAL "ASM Compiler")
set(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_PREFIX}/${${TOOLCHAIN}} ${CMAKE_PREFIX_PATH})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)