-include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} )
-
-
-
-###
-# Module Compatibility Check
-#
-
-#| Check for whether the set modules are compatible with the specified compiler family
-ModuleCompatibility( ${ScanModulePath} ${ScanModuleCompatibility} )
-ModuleCompatibility( ${MacroModulePath} ${MacroModuleCompatibility} )
-ModuleCompatibility( ${OutputModulePath} ${OutputModuleCompatibility} )
-ModuleCompatibility( ${DebugModulePath} ${DebugModuleCompatibility} )
-
-
-
-###
-# CMake Module Checking
-#
-find_package( Git REQUIRED )
-
-
-###
-# Build Targets
-#
-
-#| Create the .ELF file
-set( TARGET_ELF ${TARGET}.elf )
-add_executable( ${TARGET_ELF} ${SRCS} )
-
-
-#| .ELF Properties
-set_target_properties( ${TARGET_ELF} PROPERTIES
- LINK_FLAGS ${LINKER_FLAGS}
- SUFFIX "" # XXX Force Windows to keep the .exe off
-)
-
-
-#| Convert the .ELF into a .HEX to load onto the Teensy
-set( TARGET_HEX ${TARGET}.hex )
-add_custom_command( TARGET ${TARGET_ELF} POST_BUILD
- COMMAND ${CMAKE_OBJCOPY} ${HEX_FLAGS} ${TARGET_ELF} ${TARGET_HEX}
- COMMENT "Creating load file for Flash: ${TARGET_HEX}"
-)
-
-
-#| Generate the Extended .LSS
-set( TARGET_LSS ${TARGET}.lss )
-add_custom_command( TARGET ${TARGET_ELF} POST_BUILD
- COMMAND ${CMAKE_OBJDUMP} ${LSS_FLAGS} ${TARGET_ELF} > ${TARGET_LSS}
- COMMENT "Creating Extended Listing: ${TARGET_LSS}"
-)
-
-
-#| Generate the Symbol Table .SYM
-set( TARGET_SYM ${TARGET}.sym )
-add_custom_command( TARGET ${TARGET_ELF} POST_BUILD
- COMMAND ${CMAKE_NM} -n ${TARGET_ELF} > ${TARGET_SYM}
- COMMENT "Creating Symbol Table: ${TARGET_SYM}"
-)
-
-
-
-###
-# Size Information
-#
-
-#| After Changes Size Information
-#| TODO Do lookup on Flash and RAM sizes and do % used
-add_custom_target( SizeAfter ALL
- COMMAND ${CMAKE_SIZE} --target=${FORMAT} ${TARGET_HEX} ${TARGET_ELF}
- DEPENDS ${TARGET_ELF}
- COMMENT "Size after generation\n\tFlash Usage: data (hex)\n\t RAM Usage: data (elf)"
-)