From a69ab0c23a0c38e3fed3e412df36538d8959d23c Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 13 Nov 2018 21:53:22 -0800 Subject: cmake: Update coding style to use lowercase commands Also updates our coding style file. Ancient CMake versions required upper-case commands. Later command names became case-insensitive. Now the preferred style is lower-case. Run the following shell code (with GNU compliant sed): cmake --help-command-list | grep -v "cmake version" | while read c; do echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g' done > convert.sed \ && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' \ '*CMakeLists.txt' | xargs -0 gsed -i -f convert.sed && rm convert.sed (Make sure the backslashes don't get mangled!) --- firmware/fx2/CMakeLists.txt | 14 +++++++------- firmware/fx2/config/CMakeASM_SDCCInformation.cmake | 12 ++++++------ firmware/fx2/config/CMakeDetermineASM_SDCCCompiler.cmake | 8 ++++---- firmware/fx2/config/CMakeTestASM_SDCCCompiler.cmake | 6 +++--- firmware/fx2/config/Rename.cmake | 8 ++++---- firmware/fx2/config/Toolchain-sdcc.cmake | 6 +++--- 6 files changed, 27 insertions(+), 27 deletions(-) (limited to 'firmware/fx2') diff --git a/firmware/fx2/CMakeLists.txt b/firmware/fx2/CMakeLists.txt index f7f6e96ca..7a41333f5 100644 --- a/firmware/fx2/CMakeLists.txt +++ b/firmware/fx2/CMakeLists.txt @@ -15,22 +15,22 @@ # along with this program. If not, see . # -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +cmake_minimum_required(VERSION 2.6) set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/config/Toolchain-sdcc.cmake) -PROJECT(USRP1 C) +project(USRP1 C) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/config/") -INCLUDE(FindPythonInterp) +include(FindPythonInterp) ######################################################################## # Set toolchain to use SDCC ######################################################################## # we're doing mixed ASM and C -ENABLE_LANGUAGE(ASM_SDCC) +enable_language(ASM_SDCC) ######################################################################## # C flags and linking flags ######################################################################## -ADD_DEFINITIONS(-DHAVE_USRP2) +add_definitions(-DHAVE_USRP2) set(CMAKE_C_LINK_FLAGS "--code-loc 0x0000 --code-size 0x1800 --xram-loc 0x1800 --xram-size 0x0800 -Wl '-b USBDESCSEG = 0xE000'") set(CMAKE_C_FLAGS "--no-xinit-opt") @@ -45,5 +45,5 @@ set(BUILD_EEPROM ${CMAKE_SOURCE_DIR}/utils/build_eeprom.py) ######################################################################## # Add the subdirectories ######################################################################## -ADD_SUBDIRECTORY(usrp1) -ADD_SUBDIRECTORY(b100) +add_subdirectory(usrp1) +add_subdirectory(b100) diff --git a/firmware/fx2/config/CMakeASM_SDCCInformation.cmake b/firmware/fx2/config/CMakeASM_SDCCInformation.cmake index d9f28b8d3..6d922bfc6 100644 --- a/firmware/fx2/config/CMakeASM_SDCCInformation.cmake +++ b/firmware/fx2/config/CMakeASM_SDCCInformation.cmake @@ -16,13 +16,13 @@ # # support for the SDCC assembler, asx8051 -SET( ASM_DIALECT "_SDCC" ) -SET( CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS a51 ) +set( ASM_DIALECT "_SDCC" ) +set( CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS a51 ) #i don't want to talk about it. i had such high hopes for CMake. -SET( CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT " -plosgff " "${CMAKE_COMMAND} -DFILE= -DSOURCE= -P ${CMAKE_SOURCE_DIR}/config/Rename.cmake") +set( CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT " -plosgff " "${CMAKE_COMMAND} -DFILE= -DSOURCE= -P ${CMAKE_SOURCE_DIR}/config/Rename.cmake") -INCLUDE( CMakeASMInformation ) -SET( CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION ".rel" ) #must go here because the include appears to overwrite it, although it shouldn't +include( CMakeASMInformation ) +set( CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION ".rel" ) #must go here because the include appears to overwrite it, although it shouldn't # for future use -SET( ASM_DIALECT ) +set( ASM_DIALECT ) diff --git a/firmware/fx2/config/CMakeDetermineASM_SDCCCompiler.cmake b/firmware/fx2/config/CMakeDetermineASM_SDCCCompiler.cmake index 37481077c..2cade6002 100644 --- a/firmware/fx2/config/CMakeDetermineASM_SDCCCompiler.cmake +++ b/firmware/fx2/config/CMakeDetermineASM_SDCCCompiler.cmake @@ -14,9 +14,9 @@ # Find the MS assembler (masm or masm64) -SET(ASM_DIALECT "_SDCC") +set(ASM_DIALECT "_SDCC") -SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT sdas8051) +set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT sdas8051) -INCLUDE(CMakeDetermineASMCompiler) -SET(ASM_DIALECT) +include(CMakeDetermineASMCompiler) +set(ASM_DIALECT) diff --git a/firmware/fx2/config/CMakeTestASM_SDCCCompiler.cmake b/firmware/fx2/config/CMakeTestASM_SDCCCompiler.cmake index 1cb71cd9d..16f7ba943 100644 --- a/firmware/fx2/config/CMakeTestASM_SDCCCompiler.cmake +++ b/firmware/fx2/config/CMakeTestASM_SDCCCompiler.cmake @@ -18,6 +18,6 @@ # is set and cmake stops processing commands and will not generate # any makefiles or projects. -SET(ASM_DIALECT "_SDCC") -INCLUDE(CMakeTestASMCompiler) -SET(ASM_DIALECT) +set(ASM_DIALECT "_SDCC") +include(CMakeTestASMCompiler) +set(ASM_DIALECT) diff --git a/firmware/fx2/config/Rename.cmake b/firmware/fx2/config/Rename.cmake index 36cd33527..e96e4bcf7 100644 --- a/firmware/fx2/config/Rename.cmake +++ b/firmware/fx2/config/Rename.cmake @@ -23,8 +23,8 @@ get_filename_component(source_noext ${SOURCE} NAME_WE) get_filename_component(source_path ${SOURCE} PATH) set(compiled_ext .rel) list(APPEND compiled_filepath ${source_path}/${source_noext}${compiled_ext}) -#EXECUTE_PROCESS(COMMAND echo Moving ${compiled_filepath} to ${FILE}) -EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E rename ${compiled_filepath} ${FILE}) +#execute_process(COMMAND echo Moving ${compiled_filepath} to ${FILE}) +execute_process(COMMAND ${CMAKE_COMMAND} -E rename ${compiled_filepath} ${FILE}) #now do the same for the .lst set(compiled_lst .lst) @@ -33,5 +33,5 @@ get_filename_component(lst_noext ${FILE} NAME_WE) get_filename_component(lst_path ${FILE} PATH) list(APPEND compiled_lstpath ${source_path}/${source_noext}${compiled_lst}) list(APPEND compiled_outputlstpath ${lst_path}/${lst_noext}${src_ext}${compiled_lst}) -#EXECUTE_PROCESS(COMMAND echo Moving ${compiled_lstpath} to ${compiled_outputlstpath}) -EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E rename ${compiled_lstpath} ${compiled_outputlstpath}) +#execute_process(COMMAND echo Moving ${compiled_lstpath} to ${compiled_outputlstpath}) +execute_process(COMMAND ${CMAKE_COMMAND} -E rename ${compiled_lstpath} ${compiled_outputlstpath}) diff --git a/firmware/fx2/config/Toolchain-sdcc.cmake b/firmware/fx2/config/Toolchain-sdcc.cmake index f640ae665..9726b8b50 100644 --- a/firmware/fx2/config/Toolchain-sdcc.cmake +++ b/firmware/fx2/config/Toolchain-sdcc.cmake @@ -16,12 +16,12 @@ # # the name of the target operating system -SET(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_NAME Generic) # which compilers to use for C and C++ -SET(CMAKE_C_COMPILER sdcc) +set(CMAKE_C_COMPILER sdcc) # here is where the target environment is located -SET(CMAKE_FIND_ROOT_PATH /usr/bin /usr/share/sdcc /usr/libexec/sdcc) +set(CMAKE_FIND_ROOT_PATH /usr/bin /usr/share/sdcc /usr/libexec/sdcc) # adjust the default behaviour of the FIND_XXX() commands: # search headers and libraries in the target environment, search -- cgit v1.2.3