From 779ab2a5fdf2d8fd4ec1b3589b068a3e4fc51961 Mon Sep 17 00:00:00 2001 From: Nanosonde <2073569+nanosonde@users.noreply.github.com> Date: Sun, 18 Oct 2020 17:41:33 +0200 Subject: [PATCH] Change cmake build --- examples/knx-cc1310/CMakeLists.txt | 18 ++++++++-- examples/knx-cc1310/build.sh | 4 +-- ...ke => FindSimpleLinkCC13X0SDKnortos.cmake} | 36 ++++++++++++++----- examples/knx-cc1310/cmake/LICENSE | 21 ----------- examples/knx-cc1310/cmake/cc13xx.cmake | 24 +++++++++++-- .../cmake/toolchain-arm-none-eabi.cmake | 30 ++++++++++++---- 6 files changed, 90 insertions(+), 43 deletions(-) rename examples/knx-cc1310/cmake/{FindSimpleLinkCC13X0SDK_nortos.cmake => FindSimpleLinkCC13X0SDKnortos.cmake} (54%) delete mode 100644 examples/knx-cc1310/cmake/LICENSE diff --git a/examples/knx-cc1310/CMakeLists.txt b/examples/knx-cc1310/CMakeLists.txt index e7c57a6..bff68d3 100644 --- a/examples/knx-cc1310/CMakeLists.txt +++ b/examples/knx-cc1310/CMakeLists.txt @@ -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 _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 diff --git a/examples/knx-cc1310/build.sh b/examples/knx-cc1310/build.sh index bcf3e3c..4a308f5 100755 --- a/examples/knx-cc1310/build.sh +++ b/examples/knx-cc1310/build.sh @@ -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 .. diff --git a/examples/knx-cc1310/cmake/FindSimpleLinkCC13X0SDK_nortos.cmake b/examples/knx-cc1310/cmake/FindSimpleLinkCC13X0SDKnortos.cmake similarity index 54% rename from examples/knx-cc1310/cmake/FindSimpleLinkCC13X0SDK_nortos.cmake rename to examples/knx-cc1310/cmake/FindSimpleLinkCC13X0SDKnortos.cmake index 1bf2ee6..6570ff6 100644 --- a/examples/knx-cc1310/cmake/FindSimpleLinkCC13X0SDK_nortos.cmake +++ b/examples/knx-cc1310/cmake/FindSimpleLinkCC13X0SDKnortos.cmake @@ -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 diff --git a/examples/knx-cc1310/cmake/LICENSE b/examples/knx-cc1310/cmake/LICENSE deleted file mode 100644 index d4a9495..0000000 --- a/examples/knx-cc1310/cmake/LICENSE +++ /dev/null @@ -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. diff --git a/examples/knx-cc1310/cmake/cc13xx.cmake b/examples/knx-cc1310/cmake/cc13xx.cmake index 6619570..b8cf1ec 100644 --- a/examples/knx-cc1310/cmake/cc13xx.cmake +++ b/examples/knx-cc1310/cmake/cc13xx.cmake @@ -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 ## diff --git a/examples/knx-cc1310/cmake/toolchain-arm-none-eabi.cmake b/examples/knx-cc1310/cmake/toolchain-arm-none-eabi.cmake index 6ac7ade..b990ad9 100644 --- a/examples/knx-cc1310/cmake/toolchain-arm-none-eabi.cmake +++ b/examples/knx-cc1310/cmake/toolchain-arm-none-eabi.cmake @@ -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)