{"action":"created","issue":{"url":"https://api.github.com/repos/tohara/marlin-cmake/issues/1","repository_url":"https://api.github.com/repos/tohara/marlin-cmake","labels_url":"https://api.github.com/repos/tohara/marlin-cmake/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/tohara/marlin-cmake/issues/1/comments","events_url":"https://api.github.com/repos/tohara/marlin-cmake/issues/1/events","html_url":"https://github.com/tohara/marlin-cmake/issues/1","id":184692608,"number":1,"title":"Cannot get a valid BOARD ?","user":{"login":"Salamandar","id":6552989,"avatar_url":"https://avatars.githubusercontent.com/u/6552989?v=3","gravatar_id":"","url":"https://api.github.com/users/Salamandar","html_url":"https://github.com/Salamandar","followers_url":"https://api.github.com/users/Salamandar/followers","following_url":"https://api.github.com/users/Salamandar/following{/other_user}","gists_url":"https://api.github.com/users/Salamandar/gists{/gist_id}","starred_url":"https://api.github.com/users/Salamandar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Salamandar/subscriptions","organizations_url":"https://api.github.com/users/Salamandar/orgs","repos_url":"https://api.github.com/users/Salamandar/repos","events_url":"https://api.github.com/users/Salamandar/events{/privacy}","received_events_url":"https://api.github.com/users/Salamandar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-23T14:16:54Z","updated_at":"2016-10-24T01:19:05Z","closed_at":null,"body":"I'm trying to build Marlin with this, but I can't get the Toolchain file to accept any board ID.\r\n\r\nFor now my CMakeLists.txt is :\r\n```\r\n####################################################################\r\n#   Project configuration\r\n####################################################################\r\ncmake_minimum_required(VERSION 3.0)\r\n\r\nset(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchain/ArduinoToolchain.cmake)\r\n\r\nproject (Marlin-Triforce)\r\nset     (Marlin-Triforce_VERSION_MAJOR 0)\r\nset     (Marlin-Triforcre_VERSION_MINOR 9)\r\n\r\nset(Marlin_SKETCH ${CMAKE_SOURCE_DIR})\r\n\r\nset(Marlin_BOARD mega)\r\n\r\ngenerate_arduino_firmware(Marlin)\r\n```\r\nI just cloned this repo as the `cmake` directory.\r\nWhy doesn't this work ?\r\n"},"comment":{"url":"https://api.github.com/repos/tohara/marlin-cmake/issues/comments/255628903","html_url":"https://github.com/tohara/marlin-cmake/issues/1#issuecomment-255628903","issue_url":"https://api.github.com/repos/tohara/marlin-cmake/issues/1","id":255628903,"user":{"login":"tohara","id":10041611,"avatar_url":"https://avatars.githubusercontent.com/u/10041611?v=3","gravatar_id":"","url":"https://api.github.com/users/tohara","html_url":"https://github.com/tohara","followers_url":"https://api.github.com/users/tohara/followers","following_url":"https://api.github.com/users/tohara/following{/other_user}","gists_url":"https://api.github.com/users/tohara/gists{/gist_id}","starred_url":"https://api.github.com/users/tohara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tohara/subscriptions","organizations_url":"https://api.github.com/users/tohara/orgs","repos_url":"https://api.github.com/users/tohara/repos","events_url":"https://api.github.com/users/tohara/events{/privacy}","received_events_url":"https://api.github.com/users/tohara/received_events","type":"User","site_admin":false},"created_at":"2016-10-24T01:19:05Z","updated_at":"2016-10-24T01:19:05Z","body":"You need to include the Arduino_SDK module to find the SDK install path, and you need to specify the CPU for the mega board. \r\n\r\nI am not sure why, but using SKETCH does not work, try change it to using SRCS instead.\r\nI have tested with a CMakeLists.txt as show below and I get it to compile.\r\n\r\n\r\n```\r\n####################################################################\r\n#   Project configuration\r\n####################################################################\r\ncmake_minimum_required(VERSION 3.0)\r\n\r\nset(CMAKE_MODULE_PATH  ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/modules)\r\n\r\ninclude(Arduino_SDK) # Find the intallpath of Arduino SDK\r\n\r\nset(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchain/ArduinoToolchain.cmake)\r\n\r\n\r\nproject (Marlin-Triforce)\r\nset     (Marlin-Triforce_VERSION_MAJOR 0)\r\nset     (Marlin-Triforcre_VERSION_MINOR 9)\r\n\r\n#set(Marlin_SKETCH ${CMAKE_SOURCE_DIR})\r\n\r\nfile(GLOB SOURCES \"*.cpp\")\r\nset(Marlin_SRCS \"${SOURCES};Marlin.ino\")\r\n\r\nset(Marlin_BOARD mega)\r\nset(Marlin_CPU atmega2560)\r\n\r\ngenerate_arduino_firmware(Marlin)\r\n```\r\n\r\nI have also provided two CMakeLists.txt files that can be used for marlin and will read the correct board configuration from Configuration.h.\r\n\r\nTo use this you just need to copy CMakelists/MarlinRootDir/CMakeLists.txt to the root (Marlin-Triforce in your case) directory and copy CMakelists/MarlinSrcDir/CMakeLists.txt to the source( Marlin) directory.\r\n\r\nThen from the root directory run:\r\nmkdir build && cd build\r\ncmake ..\r\nmake\r\n\r\nThe needed toolchain files will the be downloaded to the build directory.\r\n\r\nFor some more info see: https://github.com/MarlinFirmware/Marlin/issues/4680"}}
{"actor":{"display_login":"tohara"}}