aboutsummaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-11-13 21:53:22 -0800
committerBrent Stapleton <bstapleton@g.hmc.edu>2018-11-14 14:10:09 -0800
commita69ab0c23a0c38e3fed3e412df36538d8959d23c (patch)
treee6669a138dad84f79c46588f43a38c69dda90246 /firmware
parent4247f025020d7dd1f696dfbd3cce248957d6ace7 (diff)
downloaduhd-a69ab0c23a0c38e3fed3e412df36538d8959d23c.tar.gz
uhd-a69ab0c23a0c38e3fed3e412df36538d8959d23c.tar.bz2
uhd-a69ab0c23a0c38e3fed3e412df36538d8959d23c.zip
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!)
Diffstat (limited to 'firmware')
-rw-r--r--firmware/fx2/CMakeLists.txt14
-rw-r--r--firmware/fx2/config/CMakeASM_SDCCInformation.cmake12
-rw-r--r--firmware/fx2/config/CMakeDetermineASM_SDCCCompiler.cmake8
-rw-r--r--firmware/fx2/config/CMakeTestASM_SDCCCompiler.cmake6
-rw-r--r--firmware/fx2/config/Rename.cmake8
-rw-r--r--firmware/fx2/config/Toolchain-sdcc.cmake6
-rw-r--r--firmware/octoclock/CMakeLists.txt2
-rw-r--r--firmware/octoclock/lib/CMakeLists.txt12
-rw-r--r--firmware/usrp2/CMakeLists.txt68
-rw-r--r--firmware/usrp2/lib/CMakeLists.txt2
-rw-r--r--firmware/usrp2/usrp2/CMakeLists.txt16
-rw-r--r--firmware/usrp2/usrp2p/CMakeLists.txt18
-rw-r--r--firmware/usrp2/usrp2p/bootloader/CMakeLists.txt22
-rw-r--r--firmware/usrp3/CMakeLists.txt90
-rw-r--r--firmware/usrp3/n230/CMakeLists.txt2
-rw-r--r--firmware/usrp3/x300/CMakeLists.txt4
16 files changed, 145 insertions, 145 deletions
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 <http://www.gnu.org/licenses/>.
#
-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 "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> -plosgff <SOURCE>" "${CMAKE_COMMAND} -DFILE=<OBJECT> -DSOURCE=<SOURCE> -P ${CMAKE_SOURCE_DIR}/config/Rename.cmake")
+set( CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> -plosgff <SOURCE>" "${CMAKE_COMMAND} -DFILE=<OBJECT> -DSOURCE=<SOURCE> -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
diff --git a/firmware/octoclock/CMakeLists.txt b/firmware/octoclock/CMakeLists.txt
index 0f2af35e9..4d99add0a 100644
--- a/firmware/octoclock/CMakeLists.txt
+++ b/firmware/octoclock/CMakeLists.txt
@@ -27,7 +27,7 @@ project(OCTOCLOCK C)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmcu=atmega128 -std=gnu99")
if(NOT DEFINED PROGRAMMER)
- SET(PROGRAMMER "avrisp2")
+ set(PROGRAMMER "avrisp2")
endif(NOT DEFINED PROGRAMMER)
if(OCTOCLOCK_DEBUG)
diff --git a/firmware/octoclock/lib/CMakeLists.txt b/firmware/octoclock/lib/CMakeLists.txt
index 3c992399e..0dfa1b0c9 100644
--- a/firmware/octoclock/lib/CMakeLists.txt
+++ b/firmware/octoclock/lib/CMakeLists.txt
@@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-SET(lib_files
+set(lib_files
arp_cache.c
clkdist.c
enc28j60.c
@@ -27,11 +27,11 @@ SET(lib_files
usart.c
)
-IF(OCTOCLOCK_DEBUG)
- LIST(APPEND lib_files serial.c)
-ENDIF(OCTOCLOCK_DEBUG)
+if(OCTOCLOCK_DEBUG)
+ list(APPEND lib_files serial.c)
+endif(OCTOCLOCK_DEBUG)
-ADD_LIBRARY(octoclock ${lib_files})
-SET_TARGET_PROPERTIES(octoclock
+add_library(octoclock ${lib_files})
+set_target_properties(octoclock
PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -O2 -g"
)
diff --git a/firmware/usrp2/CMakeLists.txt b/firmware/usrp2/CMakeLists.txt
index 80fd074bd..693fbf9c3 100644
--- a/firmware/usrp2/CMakeLists.txt
+++ b/firmware/usrp2/CMakeLists.txt
@@ -18,19 +18,19 @@
########################################################################
# setup project and compiler
########################################################################
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+cmake_minimum_required(VERSION 2.6)
#force the compiler because the check wont use the special flag below
-INCLUDE(CMakeForceCompiler)
-SET(CMAKE_SYSTEM_NAME Generic)
+include(CMakeForceCompiler)
+set(CMAKE_SYSTEM_NAME Generic)
CMAKE_FORCE_C_COMPILER(zpu-elf-gcc GNU)
-PROJECT(USRP_NXXX_FW C)
+project(USRP_NXXX_FW C)
########################################################################
# lwIP header include dirs
########################################################################
-SET(LWIPDIR ${CMAKE_SOURCE_DIR}/lwip/lwip-1.3.1)
+set(LWIPDIR ${CMAKE_SOURCE_DIR}/lwip/lwip-1.3.1)
-INCLUDE_DIRECTORIES(
+include_directories(
${CMAKE_SOURCE_DIR}/lwip
${CMAKE_SOURCE_DIR}/lwip_port
${LWIPDIR}/src/include
@@ -40,16 +40,16 @@ INCLUDE_DIRECTORIES(
########################################################################
# misc flags for the gcc compiler
########################################################################
-SET(CMAKE_C_FLAGS -phi) #always needed compile time and link time
-ADD_DEFINITIONS(-Os)
-ADD_DEFINITIONS(--std=gnu99)
-ADD_DEFINITIONS(-Wall)
-ADD_DEFINITIONS(-Werror-implicit-function-declaration)
-ADD_DEFINITIONS(-ffunction-sections)
+set(CMAKE_C_FLAGS -phi) #always needed compile time and link time
+add_definitions(-Os)
+add_definitions(--std=gnu99)
+add_definitions(-Wall)
+add_definitions(-Werror-implicit-function-declaration)
+add_definitions(-ffunction-sections)
-MACRO(ADD_LINKER_FLAGS flags)
- SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${flags}")
-ENDMACRO(ADD_LINKER_FLAGS)
+macro(ADD_LINKER_FLAGS flags)
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${flags}")
+endmacro(ADD_LINKER_FLAGS)
ADD_LINKER_FLAGS("-Wl,--gc-sections")
ADD_LINKER_FLAGS("-Wl,--relax")
@@ -57,13 +57,13 @@ ADD_LINKER_FLAGS("-Wl,--relax")
########################################################################
# define for the hal io (FIXME move?)
########################################################################
-#ADD_DEFINITIONS(-DHAL_IO_USES_DBOARD_PINS)
-ADD_DEFINITIONS(-DHAL_IO_USES_UART)
+#add_definitions(-DHAL_IO_USES_DBOARD_PINS)
+add_definitions(-DHAL_IO_USES_UART)
########################################################################
# common cflags and ldflags
########################################################################
-INCLUDE_DIRECTORIES(
+include_directories(
${CMAKE_SOURCE_DIR}/../../host/lib/usrp
${CMAKE_SOURCE_DIR}/lib
)
@@ -71,52 +71,52 @@ INCLUDE_DIRECTORIES(
########################################################################
# setup programs for output files
########################################################################
-FIND_PROGRAM(LINKER zpu-elf-ld)
-FIND_PROGRAM(OBJCOPY zpu-elf-objcopy)
-FIND_PROGRAM(OBJDUMP zpu-elf-objdump)
-FIND_PROGRAM(HEXDUMP hexdump)
+find_program(LINKER zpu-elf-ld)
+find_program(OBJCOPY zpu-elf-objcopy)
+find_program(OBJDUMP zpu-elf-objdump)
+find_program(HEXDUMP hexdump)
########################################################################
# helper functions to build output formats
########################################################################
-SET(GEN_OUTPUTS_BIN_SIZE "bin_size_not_set") #set before calling
-MACRO(GEN_OUTPUTS target)
- GET_FILENAME_COMPONENT(name ${target} NAME_WE)
+set(GEN_OUTPUTS_BIN_SIZE "bin_size_not_set") #set before calling
+macro(GEN_OUTPUTS target)
+ get_filename_component(name ${target} NAME_WE)
#command to create a map from elf
- ADD_CUSTOM_COMMAND(
+ add_custom_command(
OUTPUT ${name}.map DEPENDS ${target}
COMMAND ${LINKER} -Map ${name}.map ${target}
)
#command to create a bin from elf
- ADD_CUSTOM_COMMAND(
+ add_custom_command(
OUTPUT ${name}.bin DEPENDS ${target}
COMMAND ${OBJCOPY} -O binary ${target} ${name}.bin
--pad-to ${GEN_OUTPUTS_BIN_SIZE}
)
#command to create a ihx from elf
- ADD_CUSTOM_COMMAND(
+ add_custom_command(
OUTPUT ${name}.ihx DEPENDS ${target}
COMMAND ${OBJCOPY} -O ihex ${target} ${name}.ihx
--pad-to ${GEN_OUTPUTS_BIN_SIZE}
)
#command to create a dump from elf
- ADD_CUSTOM_COMMAND(
+ add_custom_command(
OUTPUT ${name}.dump DEPENDS ${target}
COMMAND ${OBJDUMP} -DSC ${target} > ${name}.dump
)
#command to create a rom from bin
- ADD_CUSTOM_COMMAND(
+ add_custom_command(
OUTPUT ${name}.rom DEPENDS ${name}.bin
COMMAND ${HEXDUMP} -v -e'1/1 \"%.2X\\n\"' ${name}.bin > ${name}.rom
)
#add a top level target for output files
- ADD_CUSTOM_TARGET(
+ add_custom_target(
${name}_outputs ALL DEPENDS ${name}.map ${name}.bin ${name}.ihx ${name}.dump ${name}.rom
)
-ENDMACRO(GEN_OUTPUTS)
+endmacro(GEN_OUTPUTS)
########################################################################
# Add the subdirectories
########################################################################
-ADD_SUBDIRECTORY(usrp2)
-ADD_SUBDIRECTORY(usrp2p)
+add_subdirectory(usrp2)
+add_subdirectory(usrp2p)
diff --git a/firmware/usrp2/lib/CMakeLists.txt b/firmware/usrp2/lib/CMakeLists.txt
index ce6b7fa44..7d83ddb4b 100644
--- a/firmware/usrp2/lib/CMakeLists.txt
+++ b/firmware/usrp2/lib/CMakeLists.txt
@@ -16,7 +16,7 @@
#
########################################################################
-SET(COMMON_SRCS
+set(COMMON_SRCS
${CMAKE_SOURCE_DIR}/lib/u2_init.c
${CMAKE_SOURCE_DIR}/lib/abort.c
${CMAKE_SOURCE_DIR}/lib/ad9510.c
diff --git a/firmware/usrp2/usrp2/CMakeLists.txt b/firmware/usrp2/usrp2/CMakeLists.txt
index 3662532f1..1cbbd1e7c 100644
--- a/firmware/usrp2/usrp2/CMakeLists.txt
+++ b/firmware/usrp2/usrp2/CMakeLists.txt
@@ -16,22 +16,22 @@
#
########################################################################
-INCLUDE(${CMAKE_SOURCE_DIR}/lib/CMakeLists.txt)
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
+include(${CMAKE_SOURCE_DIR}/lib/CMakeLists.txt)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
-ADD_DEFINITIONS(-DUSRP2)
-ADD_DEFINITIONS(-DUDP_UART_MASK=0)
+add_definitions(-DUSRP2)
+add_definitions(-DUDP_UART_MASK=0)
-ADD_LIBRARY(libusrp2fw STATIC
+add_library(libusrp2fw STATIC
${COMMON_SRCS}
sd.c
ethernet.c
)
########################################################################
-SET(GEN_OUTPUTS_BIN_SIZE 0x3fff)
+set(GEN_OUTPUTS_BIN_SIZE 0x3fff)
-ADD_EXECUTABLE(usrp2_txrx_uhd.elf ${CMAKE_SOURCE_DIR}/apps/txrx_uhd.c)
-TARGET_LINK_LIBRARIES(usrp2_txrx_uhd.elf libusrp2fw)
+add_executable(usrp2_txrx_uhd.elf ${CMAKE_SOURCE_DIR}/apps/txrx_uhd.c)
+target_link_libraries(usrp2_txrx_uhd.elf libusrp2fw)
GEN_OUTPUTS(usrp2_txrx_uhd.elf)
diff --git a/firmware/usrp2/usrp2p/CMakeLists.txt b/firmware/usrp2/usrp2p/CMakeLists.txt
index 4cb663742..d83e9e84c 100644
--- a/firmware/usrp2/usrp2p/CMakeLists.txt
+++ b/firmware/usrp2/usrp2p/CMakeLists.txt
@@ -16,13 +16,13 @@
#
########################################################################
-INCLUDE(${CMAKE_SOURCE_DIR}/lib/CMakeLists.txt)
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
+include(${CMAKE_SOURCE_DIR}/lib/CMakeLists.txt)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
-ADD_DEFINITIONS(-DUSRP2P)
-ADD_DEFINITIONS(-DUDP_UART_MASK=4) #GPS=UART2 streaming enabled
+add_definitions(-DUSRP2P)
+add_definitions(-DUDP_UART_MASK=4) #GPS=UART2 streaming enabled
-ADD_LIBRARY(libusrp2pfw STATIC
+add_library(libusrp2pfw STATIC
${COMMON_SRCS}
spif.c
spi_flash.c
@@ -34,12 +34,12 @@ ADD_LIBRARY(libusrp2pfw STATIC
u2p_init.c
)
-ADD_SUBDIRECTORY(bootloader)
+add_subdirectory(bootloader)
########################################################################
-SET(GEN_OUTPUTS_BIN_SIZE 0x3fff)
+set(GEN_OUTPUTS_BIN_SIZE 0x3fff)
-ADD_EXECUTABLE(usrp2p_txrx_uhd.elf ${CMAKE_SOURCE_DIR}/apps/txrx_uhd.c)
-TARGET_LINK_LIBRARIES(usrp2p_txrx_uhd.elf libusrp2pfw)
+add_executable(usrp2p_txrx_uhd.elf ${CMAKE_SOURCE_DIR}/apps/txrx_uhd.c)
+target_link_libraries(usrp2p_txrx_uhd.elf libusrp2pfw)
GEN_OUTPUTS(usrp2p_txrx_uhd.elf)
diff --git a/firmware/usrp2/usrp2p/bootloader/CMakeLists.txt b/firmware/usrp2/usrp2p/bootloader/CMakeLists.txt
index 07f234302..86a3b0e5c 100644
--- a/firmware/usrp2/usrp2p/bootloader/CMakeLists.txt
+++ b/firmware/usrp2/usrp2p/bootloader/CMakeLists.txt
@@ -16,27 +16,27 @@
#
########################################################################
-INCLUDE(FindPythonInterp)
+include(FindPythonInterp)
-MACRO(GEN_RMI target)
- GET_FILENAME_COMPONENT(name ${target} NAME_WE)
+macro(GEN_RMI target)
+ get_filename_component(name ${target} NAME_WE)
#command to create a rmi from elf
- ADD_CUSTOM_COMMAND(
+ add_custom_command(
OUTPUT ${name}.rmi DEPENDS ${name}.bin
COMMAND ${PYTHON_EXECUTABLE}
${CMAKE_SOURCE_DIR}/bin/bin_to_ram_macro_init.py ${name}.bin ${name}.rmi
)
#add a top level target for output files
- ADD_CUSTOM_TARGET(
+ add_custom_target(
${name}_rmi ALL DEPENDS ${name}.rmi
)
-ENDMACRO(GEN_RMI)
+endmacro(GEN_RMI)
########################################################################
-ADD_EXECUTABLE(bootloader.elf ${CMAKE_SOURCE_DIR}/apps/txrx_uhd.c)
-ADD_DEFINITIONS(-DUSRP2P)
-ADD_DEFINITIONS(-DBOOTLOADER)
-TARGET_LINK_LIBRARIES(bootloader.elf libusrp2pfw)
-SET(GEN_OUTPUTS_BIN_SIZE 0x3fff)
+add_executable(bootloader.elf ${CMAKE_SOURCE_DIR}/apps/txrx_uhd.c)
+add_definitions(-DUSRP2P)
+add_definitions(-DBOOTLOADER)
+target_link_libraries(bootloader.elf libusrp2pfw)
+set(GEN_OUTPUTS_BIN_SIZE 0x3fff)
GEN_OUTPUTS(bootloader.elf)
GEN_RMI(bootloader.bin)
diff --git a/firmware/usrp3/CMakeLists.txt b/firmware/usrp3/CMakeLists.txt
index 66a43b6bd..abf1d46cb 100644
--- a/firmware/usrp3/CMakeLists.txt
+++ b/firmware/usrp3/CMakeLists.txt
@@ -18,27 +18,27 @@
########################################################################
# setup project and compiler
########################################################################
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+cmake_minimum_required(VERSION 2.6)
#force the compiler because the check wont use the special flag below
-INCLUDE(CMakeForceCompiler)
-SET(CMAKE_SYSTEM_NAME Generic)
+include(CMakeForceCompiler)
+set(CMAKE_SYSTEM_NAME Generic)
CMAKE_FORCE_C_COMPILER(zpu-elf-gcc GNU)
-PROJECT(USRP3_FW C)
+project(USRP3_FW C)
-SET(UHD_VERSION_HASH 0 CACHE INTEGER "UHD Version Hash")
-EXECUTE_PROCESS(COMMAND ${CMAKE_SOURCE_DIR}/utils/git-hash.sh OUTPUT_VARIABLE UHD_VERSION_HASH)
-ADD_DEFINITIONS(-DUHD_VERSION_HASH=0x${UHD_VERSION_HASH})
+set(UHD_VERSION_HASH 0 CACHE INTEGER "UHD Version Hash")
+execute_process(COMMAND ${CMAKE_SOURCE_DIR}/utils/git-hash.sh OUTPUT_VARIABLE UHD_VERSION_HASH)
+add_definitions(-DUHD_VERSION_HASH=0x${UHD_VERSION_HASH})
-INCLUDE_DIRECTORIES(include)
+include_directories(include)
find_package(PythonInterp)
########################################################################
# lwIP header include dirs
########################################################################
-SET(LWIPDIR ${CMAKE_SOURCE_DIR}/lwip/lwip-1.3.1)
+set(LWIPDIR ${CMAKE_SOURCE_DIR}/lwip/lwip-1.3.1)
-INCLUDE_DIRECTORIES(
+include_directories(
${CMAKE_SOURCE_DIR}/lwip
${CMAKE_SOURCE_DIR}/lwip_port
${LWIPDIR}/src/include
@@ -48,17 +48,17 @@ INCLUDE_DIRECTORIES(
########################################################################
# misc flags for the gcc compiler
########################################################################
-SET(CMAKE_C_FLAGS -phi) #always needed compile time and link time
-ADD_DEFINITIONS(-Os)
-ADD_DEFINITIONS(--std=gnu99)
-ADD_DEFINITIONS(-Wall)
-ADD_DEFINITIONS(-Werror-implicit-function-declaration)
-ADD_DEFINITIONS(-ffunction-sections)
-ADD_DEFINITIONS(-DPRINTF_LONG_SUPPORT)
+set(CMAKE_C_FLAGS -phi) #always needed compile time and link time
+add_definitions(-Os)
+add_definitions(--std=gnu99)
+add_definitions(-Wall)
+add_definitions(-Werror-implicit-function-declaration)
+add_definitions(-ffunction-sections)
+add_definitions(-DPRINTF_LONG_SUPPORT)
-MACRO(ADD_LINKER_FLAGS flags)
- SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${flags}")
-ENDMACRO(ADD_LINKER_FLAGS)
+macro(ADD_LINKER_FLAGS flags)
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${flags}")
+endmacro(ADD_LINKER_FLAGS)
ADD_LINKER_FLAGS("-Wl,--gc-sections")
ADD_LINKER_FLAGS("-Wl,--relax")
@@ -66,72 +66,72 @@ ADD_LINKER_FLAGS("-Wl,--relax")
########################################################################
# setup programs for output files
########################################################################
-FIND_PROGRAM(LINKER zpu-elf-ld)
-FIND_PROGRAM(OBJCOPY zpu-elf-objcopy)
-FIND_PROGRAM(OBJDUMP zpu-elf-objdump)
-FIND_PROGRAM(HEXDUMP hexdump)
+find_program(LINKER zpu-elf-ld)
+find_program(OBJCOPY zpu-elf-objcopy)
+find_program(OBJDUMP zpu-elf-objdump)
+find_program(HEXDUMP hexdump)
########################################################################
# Firmware tracing support
########################################################################
# Look at include/trace.h to see what the different trace levels map to.
-SET(TRACE_LEVEL "0" CACHE STRING "Firmware Trace Level") #0 by default
-OPTION(TRACE_LEVEL "Firmware Trace Level" "")
-IF(TRACE_LEVEL)
+set(TRACE_LEVEL "0" CACHE STRING "Firmware Trace Level") #0 by default
+option(TRACE_LEVEL "Firmware Trace Level" "")
+if(TRACE_LEVEL)
#If TRACE_LEVEL == 0, don't define UHD_FW_TRACE_LEVEL so that the C
#code can easily detect if tracing is requested
- IF(${TRACE_LEVEL} GREATER 0)
- ADD_DEFINITIONS(-DUHD_FW_TRACE_LEVEL=${TRACE_LEVEL})
- ENDIF(${TRACE_LEVEL} GREATER 0)
-ENDIF(TRACE_LEVEL)
+ if(${TRACE_LEVEL} GREATER 0)
+ add_definitions(-DUHD_FW_TRACE_LEVEL=${TRACE_LEVEL})
+ endif(${TRACE_LEVEL} GREATER 0)
+endif(TRACE_LEVEL)
########################################################################
# helper functions to build output formats
########################################################################
-SET(GEN_OUTPUTS_BIN_SIZE "bin_size_not_set") #set before calling
-MACRO(GEN_OUTPUTS target pretty_name)
- GET_FILENAME_COMPONENT(name ${target} NAME_WE)
+set(GEN_OUTPUTS_BIN_SIZE "bin_size_not_set") #set before calling
+macro(GEN_OUTPUTS target pretty_name)
+ get_filename_component(name ${target} NAME_WE)
#command to create a map from elf
- ADD_CUSTOM_COMMAND(
+ add_custom_command(
OUTPUT ${name}.map DEPENDS ${target}
COMMAND ${LINKER} -Map ${name}.map ${target}
)
#command to create a bin from elf
- ADD_CUSTOM_COMMAND(
+ add_custom_command(
OUTPUT ${name}.bin DEPENDS ${target}
COMMAND ${OBJCOPY} -O binary ${target} ${name}.bin
--pad-to ${GEN_OUTPUTS_BIN_SIZE}
)
#command to create a ihx from elf
- ADD_CUSTOM_COMMAND(
+ add_custom_command(
OUTPUT ${name}.ihx DEPENDS ${target}
COMMAND ${OBJCOPY} -O ihex ${target} ${name}.ihx
--pad-to ${GEN_OUTPUTS_BIN_SIZE}
)
#command to create a dump from elf
- ADD_CUSTOM_COMMAND(
+ add_custom_command(
OUTPUT ${name}.dump DEPENDS ${target}
COMMAND ${OBJDUMP} -DSC ${target} > ${name}.dump
)
#command to create a rom from bin
- ADD_CUSTOM_COMMAND(
+ add_custom_command(
OUTPUT ${name}.rom DEPENDS ${name}.bin
COMMAND ${HEXDUMP} -v -e'1/1 \"%.2X\\n\"' ${name}.bin > ${name}.rom
)
#command to create a coe from bin
- ADD_CUSTOM_COMMAND(
+ add_custom_command(
OUTPUT ${name}.coe DEPENDS ${name}.bin
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/utils/bin_to_coe.py ${name}.bin ${name}.coe
)
#add a top level target for output files
- ADD_CUSTOM_TARGET(
+ add_custom_target(
${pretty_name} ALL DEPENDS ${name}.map ${name}.bin ${name}.ihx ${name}.dump ${name}.rom ${name}.coe
)
-ENDMACRO(GEN_OUTPUTS)
+endmacro(GEN_OUTPUTS)
########################################################################
# Add the subdirectories
########################################################################
-ADD_SUBDIRECTORY(lib)
-ADD_SUBDIRECTORY(x300)
-ADD_SUBDIRECTORY(n230)
+add_subdirectory(lib)
+add_subdirectory(x300)
+add_subdirectory(n230)
diff --git a/firmware/usrp3/n230/CMakeLists.txt b/firmware/usrp3/n230/CMakeLists.txt
index 5787fbb7d..185704276 100644
--- a/firmware/usrp3/n230/CMakeLists.txt
+++ b/firmware/usrp3/n230/CMakeLists.txt
@@ -33,7 +33,7 @@ add_executable(n230_main.elf ${n230_sources})
target_link_libraries(n230_main.elf usrp3fw)
GEN_OUTPUTS(n230_main.elf n230)
-#INSTALL(
+#install(
# FILES ${CMAKE_CURRENT_BINARY_DIR}/n230_main.bin
# DESTINATION share/uhd/images
# RENAME usrp_n230_fw.bin
diff --git a/firmware/usrp3/x300/CMakeLists.txt b/firmware/usrp3/x300/CMakeLists.txt
index 5e6134885..96aa7fe6e 100644
--- a/firmware/usrp3/x300/CMakeLists.txt
+++ b/firmware/usrp3/x300/CMakeLists.txt
@@ -23,13 +23,13 @@ list(APPEND x300_sources x300_init.c x300_main.c)
########################################################################
set(GEN_OUTPUTS_BIN_SIZE 0x7fff)
-SET(CMAKE_C_FLAGS_DEBUG -DX300_DEBUG_UART)
+set(CMAKE_C_FLAGS_DEBUG -DX300_DEBUG_UART)
add_executable(x300_main.elf ${x300_sources})
target_link_libraries(x300_main.elf usrp3fw)
GEN_OUTPUTS(x300_main.elf x300)
-INSTALL(
+install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/x300_main.bin
DESTINATION share/uhd/images
RENAME usrp_x300_fw.bin