queezythegreat / arduino-cmake

Arduino CMake Build system
645 stars 216 forks source link

dropdown list of possible boards to set ARDUINO_DEFAULT_BOARD #165

Open carrardt opened 8 years ago

carrardt commented 8 years ago

Using cmake code like the following in example/CMakeLists.txt, you can show user a dropdown list of (when using cmake-gui) or cycle through (when using ccmake) possible boards instead of typing its name into ARDUINO_DEFAULT_BOARD. I find this more convenient than copy-pasting from printed list.

foreach(PLATFORM ${ARDUINO_PLATFORMS}) set(ARDUINO_BOARD_LIST ${ARDUINO_BOARD_LIST} ${${PLATFORM}_BOARDS}) endforeach() set(ARDUINO_DEFAULT_BOARD uno CACHE STRING "Default Board") # Default Board ID, when not specified set_property(CACHE ARDUINO_DEFAULT_BOARD PROPERTY STRINGS ${ARDUINO_BOARD_LIST})