2021-03-05 04:27:15 +00:00
|
|
|
cmake_minimum_required(VERSION 3.19)
|
|
|
|
|
2021-03-08 02:38:40 +00:00
|
|
|
set(KEYMAPFILE keymaps.txt)
|
|
|
|
|
2021-03-05 04:27:15 +00:00
|
|
|
# Set up the toolchain and other architecture specific details
|
|
|
|
|
|
|
|
if(ARCH MATCHES atmega328p)
|
|
|
|
message(STATUS "setting up for atmega328p")
|
|
|
|
set(AVF_H_FUSE 0xd9)
|
|
|
|
set(AVR_L_FUSE 0xd2)
|
|
|
|
set(AVR_MCU ${ARCH})
|
|
|
|
|
|
|
|
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cmake/generic-gcc-avr.cmake)
|
|
|
|
set (ASDF_OUT_TARGET ${ASDF_TARGET}.elf)
|
|
|
|
|
|
|
|
elseif(ARCH MATCHES atmega2560)
|
|
|
|
message(STATUS "setting up for atmega2560")
|
|
|
|
set(AVF_H_FUSE 0x99)
|
|
|
|
set(AVR_L_FUSE 0xe7)
|
|
|
|
set(AVR_MCU ${ARCH})
|
|
|
|
|
|
|
|
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cmake/generic-gcc-avr.cmake)
|
|
|
|
set (ASDF_OUT_TARGET ${ASDF_TARGET}.elf)
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
project("asdf"
|
2021-11-29 22:26:08 +00:00
|
|
|
VERSION 1.6.2
|
2021-03-05 04:27:15 +00:00
|
|
|
DESCRIPTION "A customizable keyboard matrix controller for retrocomputers"
|
|
|
|
LANGUAGES C)
|
|
|
|
|
|
|
|
set_property(GLOBAL PROPERTY C_STANDARD 99)
|
|
|
|
|
|
|
|
set(ASDF_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
|
|
|
|
2021-03-05 04:44:09 +00:00
|
|
|
set (ASDF_TARGET_NAME asdf-v${PROJECT_VERSION}-${ARCH})
|
2021-03-05 04:27:15 +00:00
|
|
|
set (ASDF_EXECUTABLE_TARGET_NAME ${ASDF_TARGET_NAME})
|
|
|
|
|
|
|
|
if(ARCH MATCHES test)
|
|
|
|
add_subdirectory(test)
|
|
|
|
else()
|
|
|
|
if((ARCH MATCHES atmega328p) OR (ARCH MATCHES atmega2560))
|
|
|
|
set (ASDF_EXECUTABLE_TARGET_NAME ${ASDF_TARGET_NAME}.elf)
|
|
|
|
|
2021-05-19 18:32:23 +00:00
|
|
|
function(custom_add_library EXECUTABLE_NAME)
|
|
|
|
add_avr_library(${EXECUTABLE_NAME} ${ARGN})
|
|
|
|
endfunction(custom_add_library)
|
|
|
|
|
2021-03-05 04:27:15 +00:00
|
|
|
function(custom_add_executable EXECUTABLE_NAME)
|
|
|
|
add_avr_executable(${EXECUTABLE_NAME} ${ARGN})
|
|
|
|
endfunction(custom_add_executable)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_subdirectory(src)
|
|
|
|
endif()
|