My Marlin configs for Fabrikator Mini and CTC i3 Pro B
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

CMakeLists.txt 7.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. cmake_minimum_required(VERSION 2.8)
  2. #====================================================================#
  3. # Usage under Linux: #
  4. # #
  5. # From Marlin/buildroot/share/cmake folder: #
  6. # mkdir -p build && cd build #
  7. # cmake .. #
  8. # make #
  9. # #
  10. # Usage under Windows: #
  11. # #
  12. # From Marlin/buildroot/share/cmake folder: : #
  13. # mkdir build && cd build #
  14. # cmake -G"Unix Makefiles" .. #
  15. # make #
  16. #====================================================================#
  17. #====================================================================#
  18. # Download marlin-cmake scriptfiles if not already installed #
  19. # and add the path to the module path #
  20. #====================================================================#
  21. if(NOT EXISTS ${CMAKE_BINARY_DIR}/marlin-cmake)
  22. file(DOWNLOAD https://raw.githubusercontent.com/tohara/marlin-cmake/v1.0.0/modules/Arduino_SDK.cmake
  23. ${CMAKE_BINARY_DIR}/marlin-cmake/modules/Arduino_SDK.cmake SHOW_PROGRESS)
  24. file(DOWNLOAD https://raw.githubusercontent.com/tohara/marlin-cmake/v1.0.0/modules/marlin_cmake_functions.cmake
  25. ${CMAKE_BINARY_DIR}/marlin-cmake/modules/marlin_cmake_functions.cmake SHOW_PROGRESS)
  26. file(DOWNLOAD https://raw.githubusercontent.com/tohara/marlin-cmake/v1.0.0/Platform/Arduino.cmake
  27. ${CMAKE_BINARY_DIR}/marlin-cmake/Platform/Arduino.cmake SHOW_PROGRESS)
  28. file(DOWNLOAD https://raw.githubusercontent.com/tohara/marlin-cmake/v1.0.0/settings/marlin_boards.txt
  29. ${CMAKE_BINARY_DIR}/marlin-cmake/settings/marlin_boards.txt SHOW_PROGRESS)
  30. file(DOWNLOAD https://raw.githubusercontent.com/tohara/marlin-cmake/v1.0.0/toolchain/ArduinoToolchain.cmake
  31. ${CMAKE_BINARY_DIR}/marlin-cmake/toolchain/ArduinoToolchain.cmake SHOW_PROGRESS)
  32. if(WIN32)
  33. file(DOWNLOAD https://raw.githubusercontent.com/tohara/marlin-cmake/v1.0.0/resources/make.exe
  34. ${CMAKE_BINARY_DIR}/make.exe SHOW_PROGRESS)
  35. endif(WIN32)
  36. endif()
  37. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_BINARY_DIR}/marlin-cmake/modules)
  38. #====================================================================#
  39. # Custom path to Arduino SDK can be set here. #
  40. # It can also be set from command line. eg.: #
  41. # cmake .. -DARDUINO_SDK_PATH="/path/to/arduino-1.x.x" #
  42. #====================================================================#
  43. #set(ARDUINO_SDK_PATH ${CMAKE_CURRENT_LIST_DIR}/arduino-1.6.8)
  44. #set(ARDUINO_SDK_PATH /home/tom/git/BigBox-Dual-Marlin/ArduinoAddons/Arduino_1.6.x)
  45. #set(ARDUINO_SDK_PATH /home/tom/test/arduino-1.6.11)
  46. #====================================================================#
  47. # Set included cmake files #
  48. #====================================================================#
  49. include(Arduino_SDK) # Find the intallpath of Arduino SDK
  50. include(marlin_cmake_functions)
  51. #====================================================================#
  52. # Set toolchain file for arduino #
  53. #====================================================================#
  54. set(CMAKE_TOOLCHAIN_FILE ${CMAKE_BINARY_DIR}/marlin-cmake/toolchain/ArduinoToolchain.cmake) # Arduino Toolchain
  55. #====================================================================#
  56. # Setup Project #
  57. #====================================================================#
  58. project(Marlin C CXX)
  59. #====================================================================#
  60. # Register non standard hardware #
  61. #====================================================================#
  62. #register_hardware_platform(/home/tom/test/Sanguino)
  63. #====================================================================#
  64. # Print any info #
  65. # print_board_list() #
  66. # print_programmer_list() #
  67. # print_board_settings(mega) #
  68. #====================================================================#
  69. print_board_list()
  70. print_programmer_list()
  71. #====================================================================#
  72. # Get motherboard settings from Configuration.h #
  73. # setup_motherboard(TARGET Marlin_src_folder) #
  74. # Returns ${TARGET}_BOARD and ${TARGET}_CPU #
  75. # #
  76. # To set it manually: #
  77. # set(${PROJECT_NAME}_BOARD mega) #
  78. # set(${PROJECT_NAME}_CPU atmega2560) #
  79. #====================================================================#
  80. setup_motherboard(${PROJECT_NAME} ${CMAKE_CURRENT_LIST_DIR}/../../../Marlin)
  81. #====================================================================#
  82. # Setup all source files #
  83. # Incude Marlin.ino to compile libs not included in *.cpp files #
  84. #====================================================================#
  85. file(GLOB SOURCES "../../../Marlin/*.cpp")
  86. set(${PROJECT_NAME}_SRCS "${SOURCES};../../../Marlin/Marlin.ino")
  87. #====================================================================#
  88. # Define the port for uploading code to the Arduino #
  89. # Can be set from commandline with: #
  90. # cmake .. -DUPLOAD_PORT=/dev/ttyACM0 #
  91. #====================================================================#
  92. if(UPLOAD_PORT)
  93. set(${PROJECT_NAME}_PORT ${UPLOAD_PORT})
  94. else()
  95. set(${PROJECT_NAME}_PORT /dev/ttyACM0)
  96. endif()
  97. #====================================================================#
  98. # Register arduino libraries not included in SDK #
  99. #====================================================================#
  100. #link_directories(/home/tom/test/ArduinoAddons) #U8glib
  101. #set(${PROJECT_NAME}_ARDLIBS U8glib)
  102. #set(U8glib_RECURSE True)
  103. #====================================================================#
  104. # Command to generate code arduino firmware (.hex file) #
  105. #====================================================================#
  106. generate_arduino_firmware(${PROJECT_NAME})