Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary explicit dereferences of CMake variables #150

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions avrdude-utilities.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ set( TOOLCHAIN_AVR_GCC_DIR "${CMAKE_CURRENT_LIST_DIR}" )

find_program( CMAKE_AVRDUDE avrdude )
mark_as_advanced( CMAKE_AVRDUDE )
if( "${CMAKE_AVRDUDE}" STREQUAL "CMAKE_AVRDUDE-NOTFOUND" )
if( CMAKE_AVRDUDE STREQUAL "CMAKE_AVRDUDE-NOTFOUND" )
message( FATAL_ERROR "avrdude not found" )
endif( "${CMAKE_AVRDUDE}" STREQUAL "CMAKE_AVRDUDE-NOTFOUND" )
endif( CMAKE_AVRDUDE STREQUAL "CMAKE_AVRDUDE-NOTFOUND" )

# Add avrdude target.
#
Expand Down Expand Up @@ -94,35 +94,35 @@ function( add_avrdude_target target )
endif( DEFINED add_avrdude_target_PORT )

if( DEFINED add_avrdude_target_VERBOSITY )
if( "${add_avrdude_target_VERBOSITY}" STREQUAL "VERY_QUIET" )
if( add_avrdude_target_VERBOSITY STREQUAL "VERY_QUIET" )
list( APPEND avrdude_arguments "-q" "-q" )
elseif( "${add_avrdude_target_VERBOSITY}" STREQUAL "QUIET" )
elseif( add_avrdude_target_VERBOSITY STREQUAL "QUIET" )
list( APPEND avrdude_arguments "-q" )
elseif( "${add_avrdude_target_VERBOSITY}" STREQUAL "VERBOSE" )
elseif( add_avrdude_target_VERBOSITY STREQUAL "VERBOSE" )
list( APPEND avrdude_arguments "-v" )
elseif( "${add_avrdude_target_VERBOSITY}" STREQUAL "VERY_VERBOSE" )
elseif( add_avrdude_target_VERBOSITY STREQUAL "VERY_VERBOSE" )
list( APPEND avrdude_arguments "-v" "-v" )
else( "${add_avrdude_target_VERBOSITY}" STREQUAL "VERY_QUIET" )
else( add_avrdude_target_VERBOSITY STREQUAL "VERY_QUIET" )
message( FATAL_ERROR "'${add_avrdude_target_VERBOSITY}' is not a supported verbosity" )
endif( "${add_avrdude_target_VERBOSITY}" STREQUAL "VERY_QUIET" )
endif( add_avrdude_target_VERBOSITY STREQUAL "VERY_QUIET" )
endif( DEFINED add_avrdude_target_VERBOSITY )

list( APPEND avrdude_arguments ${add_avrdude_target_ARGUMENTS} )

if( ${add_avrdude_target_RESET} )
if( add_avrdude_target_RESET )
add_custom_target(
"${target}"
COMMAND "${TOOLCHAIN_AVR_GCC_DIR}/utility/reset.py" ${reset_arguments}
COMMAND "${CMAKE_AVRDUDE}" ${avrdude_arguments}
DEPENDS ${add_avrdude_target_DEPENDS}
)
else( ${add_avrdude_target_RESET} )
else( add_avrdude_target_RESET )
add_custom_target(
"${target}"
COMMAND "${CMAKE_AVRDUDE}" ${avrdude_arguments}
DEPENDS ${add_avrdude_target_DEPENDS}
)
endif( ${add_avrdude_target_RESET} )
endif( add_avrdude_target_RESET )
endfunction( add_avrdude_target target )

# Add an avrdude programming target for an executable.
Expand Down Expand Up @@ -207,9 +207,9 @@ function( add_avrdude_programming_target executable target_postfix )
)
endif( DEFINED add_avrdude_programming_target_UNPARSED_ARGUMENTS )

if( ${add_avrdude_programming_target_RESET} )
if( add_avrdude_programming_target_RESET )
set( reset "RESET" )
endif( ${add_avrdude_programming_target_RESET} )
endif( add_avrdude_programming_target_RESET )

set( operations "" )
foreach( operation ${add_avrdude_programming_target_OPERATIONS} )
Expand Down Expand Up @@ -303,9 +303,9 @@ function( add_avrdude_flash_programming_targets executable )
)
endif( DEFINED add_avrdude_flash_programming_targets_UNPARSED_ARGUMENTS )

if( ${add_avrdude_flash_programming_targets_RESET} )
if( add_avrdude_flash_programming_targets_RESET )
set( reset "RESET" )
endif( ${add_avrdude_flash_programming_targets_RESET} )
endif( add_avrdude_flash_programming_targets_RESET )

add_avrdude_programming_target(
"${executable}"
Expand Down Expand Up @@ -383,9 +383,9 @@ function( add_avrdude_eeprom_programming_targets executable )
)
endif( DEFINED add_avrdude_eeprom_programming_targets_UNPARSED_ARGUMENTS )

if( ${add_avrdude_eeprom_programming_targets_RESET} )
if( add_avrdude_eeprom_programming_targets_RESET )
set( reset "RESET" )
endif( ${add_avrdude_eeprom_programming_targets_RESET} )
endif( add_avrdude_eeprom_programming_targets_RESET )

add_avrdude_programming_target(
"${executable}"
Expand Down
36 changes: 18 additions & 18 deletions toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,54 +27,54 @@ set( CMAKE_SYSTEM_PROCESSOR "Microchip-AVR" )

find_program( CMAKE_C_COMPILER avr-gcc )
mark_as_advanced( CMAKE_C_COMPILER )
if( "${CMAKE_C_COMPILER}" STREQUAL "CMAKE_C_COMPILER-NOTFOUND" )
if( CMAKE_C_COMPILER STREQUAL "CMAKE_C_COMPILER-NOTFOUND" )
message( FATAL_ERROR "avr-gcc not found" )
endif( "${CMAKE_C_COMPILER}" STREQUAL "CMAKE_C_COMPILER-NOTFOUND" )
endif( CMAKE_C_COMPILER STREQUAL "CMAKE_C_COMPILER-NOTFOUND" )

find_program( CMAKE_CXX_COMPILER avr-g++ )
mark_as_advanced( CMAKE_CXX_COMPILER )
if( "${CMAKE_CXX_COMPILER}" STREQUAL "CMAKE_CXX_COMPILER-NOTFOUND" )
if( CMAKE_CXX_COMPILER STREQUAL "CMAKE_CXX_COMPILER-NOTFOUND" )
message( FATAL_ERROR "avr-g++ not found" )
endif( "${CMAKE_CXX_COMPILER}" STREQUAL "CMAKE_CXX_COMPILER-NOTFOUND" )
endif( CMAKE_CXX_COMPILER STREQUAL "CMAKE_CXX_COMPILER-NOTFOUND" )

find_program( CMAKE_LINKER avr-ld )
mark_as_advanced( CMAKE_LINKER )
if( "${CMAKE_LINKER}" STREQUAL "CMAKE_LINKER-NOTFOUND" )
if( CMAKE_LINKER STREQUAL "CMAKE_LINKER-NOTFOUND" )
message( FATAL_ERROR "avr-ld not found" )
endif( "${CMAKE_LINKER}" STREQUAL "CMAKE_LINKER-NOTFOUND" )
endif( CMAKE_LINKER STREQUAL "CMAKE_LINKER-NOTFOUND" )

find_program( CMAKE_NM avr-nm )
mark_as_advanced( CMAKE_NM )
if( "${CMAKE_NM}" STREQUAL "CMAKE_NM-NOTFOUND" )
if( CMAKE_NM STREQUAL "CMAKE_NM-NOTFOUND" )
message( FATAL_ERROR "avr-nm not found" )
endif( "${CMAKE_NM}" STREQUAL "CMAKE_NM-NOTFOUND" )
endif( CMAKE_NM STREQUAL "CMAKE_NM-NOTFOUND" )

find_program( CMAKE_OBJCOPY avr-objcopy )
mark_as_advanced( CMAKE_OBJCOPY )
if( "${CMAKE_OBJCOPY}" STREQUAL "CMAKE_OBJCOPY-NOTFOUND" )
if( CMAKE_OBJCOPY STREQUAL "CMAKE_OBJCOPY-NOTFOUND" )
message( FATAL_ERROR "avr-objcopy not found" )
endif( "${CMAKE_OBJCOPY}" STREQUAL "CMAKE_OBJCOPY-NOTFOUND" )
endif( CMAKE_OBJCOPY STREQUAL "CMAKE_OBJCOPY-NOTFOUND" )

find_program( CMAKE_OBJDUMP avr-objdump )
mark_as_advanced( CMAKE_OBJDUMP )
if( "${CMAKE_OBJDUMP}" STREQUAL "CMAKE_OBJDUMP-NOTFOUND" )
if( CMAKE_OBJDUMP STREQUAL "CMAKE_OBJDUMP-NOTFOUND" )
message( FATAL_ERROR "avr-objdump not found" )
endif( "${CMAKE_OBJDUMP}" STREQUAL "CMAKE_OBJDUMP-NOTFOUND" )
endif( CMAKE_OBJDUMP STREQUAL "CMAKE_OBJDUMP-NOTFOUND" )

find_program( CMAKE_AR avr-ar )
mark_as_advanced( CMAKE_AR )
if( "${CMAKE_AR}" STREQUAL "CMAKE_AR-NOTFOUND" )
if( CMAKE_AR STREQUAL "CMAKE_AR-NOTFOUND" )
message( FATAL_ERROR "avr-ar not found" )
endif( "${CMAKE_AR}" STREQUAL "CMAKE_AR-NOTFOUND" )
endif( CMAKE_AR STREQUAL "CMAKE_AR-NOTFOUND" )

find_program( CMAKE_RANLIB avr-ranlib )
mark_as_advanced( CMAKE_RANLIB )
if( "${CMAKE_RANLIB}" STREQUAL "CMAKE_RANLIB-NOTFOUND" )
if( CMAKE_RANLIB STREQUAL "CMAKE_RANLIB-NOTFOUND" )
message( FATAL_ERROR "avr-ranlib not found" )
endif( "${CMAKE_RANLIB}" STREQUAL "CMAKE_RANLIB-NOTFOUND" )
endif( CMAKE_RANLIB STREQUAL "CMAKE_RANLIB-NOTFOUND" )

find_program( CMAKE_STRIP avr-strip )
mark_as_advanced( CMAKE_STRIP )
if( "${CMAKE_STRIP}" STREQUAL "CMAKE_STRIP-NOTFOUND" )
if( CMAKE_STRIP STREQUAL "CMAKE_STRIP-NOTFOUND" )
message( FATAL_ERROR "avr-strip not found" )
endif( "${CMAKE_STRIP}" STREQUAL "CMAKE_STRIP-NOTFOUND" )
endif( CMAKE_STRIP STREQUAL "CMAKE_STRIP-NOTFOUND" )