]> git.donarmstrong.com Git - kiibohd-controller.git/blobdiff - CMakeLists.txt
Porting teensy-loader-cli to use libusb-1.0 (from 0.1).
[kiibohd-controller.git] / CMakeLists.txt
index 177ee14a19b82ba4b951cf13e3b6750c168280b6..2c27c011c49621e570a7807906e1f625ffc6c9c1 100644 (file)
@@ -1,6 +1,6 @@
 ###| CMAKE Kiibohd Controller |###
 #
-# Jacob Alexander 2011-2013
+# Jacob Alexander 2011-2014
 # Due to this file's usefulness:
 #
 # Released into the Public Domain
@@ -11,9 +11,6 @@
 set( CMAKE_LEGACY_CYGWIN_WIN32 0 )
 set( CMAKE_USE_RELATIVE_PATHS  1 )
 
-#| Add Dependency Macro
-include( AddFileDependencies )
-
 
 
 ###
@@ -27,8 +24,9 @@ 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}" )
@@ -91,6 +89,12 @@ ModuleCompatibility( ${DebugModulePath}  ${DebugModuleCompatibility}  )
 
 
 
+###
+# CMake Module Checking
+#
+find_package( Git REQUIRED )
+
+
 ###
 # Build Targets
 #
@@ -137,25 +141,26 @@ add_custom_command( TARGET ${TARGET_ELF} POST_BUILD
 #
 
 #| 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()
 
-#| TODO Windows
+#| Provides the user with the correct teensy-loader-cli command for the built .HEX file
+#| Windows
 if( ${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
-       configure_file( LoadFile/bash load )
+       configure_file( LoadFile/winload load NEWLINE_STYLE UNIX )
+#| Default
+else()
+       configure_file( LoadFile/load load NEWLINE_STYLE UNIX )
 endif()