###| CMAKE Kiibohd Controller |###
#
-# Jacob Alexander 2011-2013
+# Jacob Alexander 2011-2014
# Due to this file's usefulness:
#
# Released into the Public Domain
set( CMAKE_LEGACY_CYGWIN_WIN32 0 )
set( CMAKE_USE_RELATIVE_PATHS 1 )
-#| Add Dependency Macro
-include( AddFileDependencies )
-
###
#| "avr" # Teensy++ 1.0
#| "avr" # Teensy++ 2.0
#| "arm" # Teensy 3.0
-#set( COMPILER_FAMILY "arm" )
-set( COMPILER_FAMILY "avr" )
+#| "arm" # Teensy 3.1
+set( COMPILER_FAMILY "arm" )
+#set( COMPILER_FAMILY "avr" )
+
+message( STATUS "Compiler Family:" )
+message( "${COMPILER_FAMILY}" )
${COMPILER_SRCS}
${SCAN_SRCS}
${MACRO_SRCS}
- ${USB_SRCS}
+ ${OUTPUT_SRCS}
${DEBUG_SRCS}
)
+#| Directories to include by default
+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 )
###
#
#| After Changes Size Information
-add_custom_target( SizeAfter ALL ${SIZE} --target=${FORMAT} ${TARGET_HEX} ${TARGET_ELF}
+#| TODO Do lookup on Flash and RAM sizes and do % used
+add_custom_target( SizeAfter ALL
+ COMMAND ${SIZE} --target=${FORMAT} ${TARGET_HEX} ${TARGET_ELF}
DEPENDS ${TARGET_ELF}
- COMMENT "Size after generation:"
+ COMMENT "Size after generation\n\tFlash Usage: data (hex)\n\t RAM Usage: data (elf)"
)
###
-# Setup Loader Script
+# Setup Loader Script and Program
#
#| Provides the user with the correct teensy-loader-cli command for the built .HEX file
-#| teensy-loader-cli must be in the user's path
-if( ${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
- configure_file( LoadFile/bash load )
-endif( ${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
-
-#| TODO Windows
-if( ${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
- configure_file( LoadFile/bash load )
-endif( ${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
+configure_file( LoadFile/load load )