CMake toolchain for all Arduino compatible boards

Overview

Arduino CMake Toolchain

Arduino CMake toolchain is a CMake toolchain for cross-compiling CMake based projects for all Arduino compatible boards (AVR, ESP32 etc.). Of course, this means all the benefits of CMake for Arduino compilation, like using your favourite IDE, configuration checks (e.g. try_compile, CheckTypeSize), etc. This also brings the Arduino compilation to professional users, who are limited by the Arduino IDE compilation.

Project Roots

Arduino-CMake-NG is a great project, which could have prevented me from writing yet another Arduino CMake toolchain. However, as claimed by the project, Arduino-CMake-NG could not be easily utilized/modified for other Arduino compatible boards other than AVR, like ESP32, due to the fact that it does not fully work the way Arduino IDE works and has lot of AVR specific stuff. An other important limitation is related to portability. Arduino-CMake-NG provides Arduino specific CMake interface, requiring CMake scripts to be written/modified specifically for Arduino, rather than just passing -D CMAKE_TOOLCHAIN_FILE=/path/to/Arduino-toolchain.cmake to a generic CMake project.

My initial expectation was to contribute to Arduino-CMake-NG to fix the above limitations, but had to redo a lot of core logic making it very incompatible (including the usage). Also, the project Arduino-CMake-NG seems to be no longer maintained. I would like to acknowledge the authors who contributed directly/indirectly to Arduino-CMake-NG, and thus indirectly contributed to this project.

Features

  • CMake Arduino toolchain (passed to CMake using -D CMAKE_TOOLCHAIN_FILE=/path/to/Arduino-toolchain.cmake)
    • Support for all Arduino compatible platforms (such as AVR, ESP32 etc.)
    • Generic CMake scripting interface without requiring Arduino specific functions
    • Arduino IDE compatible build (e.g. use of build rules and flags in board.local.txt, pre/postbuild hooks etc.)
    • Selection of board and board-specific menu options as in Arduino IDE tools menu (See ARDUINO_BOARD_OPTIONS_FILE)
  • Generate Arduino HEX binaries and upload to Arduino boards (See target_enable_arduino_upload)
    • Upload using serial port
    • Remote provisioning through network
    • Upload using programmer
    • Burn bootloader
  • Support linking with Arduino libraries (see target_link_arduino_libraries)
    • Arduino native libraries (e.g. Ethernet, Wire)
    • User installed 3rd Party Arduino libraries (e.g. IRremote)
    • Project specific Arduino libraries (those present in /libraries )
  • Support for automatic dependency resolution (Arduino IDE like, but unprofessional)
  • Serial port monitoring
  • Support for .ino and '.pde' sketch files (Arduino IDE like, but unprofessional)
  • Board and Libraries Management without requiring installation of Arduino IDE

Usage

The provided toolchain file (Arduino-toolchain.cmake) is passed to cmake as folows

cmake -D CMAKE_TOOLCHAIN_FILE=/path/to/Arduino-toolchain.cmake <CMAKE_SOURCE_DIR>

Note: As this is cross compilation, use any cross compilation compatible generator, like makefile generators (e.g. -G "NMake Makefiles" or -G "MinGW Makefiles" on Windows command prompt or -G "Unix Makefiles" on UNIX compatible prompts etc.).

The above command generates a file BoardOptions.cmake in the build directory, that enumerates all the installed Arduino boards (installed through Arduino IDE or any other board manager) and their menu options. Select the Arduino board and any non-default options for the board from the BoardOptions.cmake (Or from cmake-gui), and then reinvoke the same command above.

If you already have a customized BoardOptions.cmake file for the Arduino Board, you can use that instead, without waiting for the generation of BoardOptions.cmake, as given below.

cmake -D CMAKE_TOOLCHAIN_FILE=/path/to/Arduino-toolchain.cmake -D ARDUINO_BOARD_OPTIONS_FILE=/path/to/any/BoardOptions.cmake <CMAKE_SOURCE_DIR>

Note:

  1. After the cmake generation is successful, changing the menu options in BoardOptions.cmake may work, but changing the board itself may not be allowed by CMake because the compiler, ABI, features determination and any cache dependencies may not be retriggered again.
  2. CMake does not support build for multiple architectures in the same build tree. If a project requires to build applications for more than one type of Arduino boards, refer to CMake documentation for multiple architecture build.
  3. When this toolchain is used, executables (added with add_executable) have the entry points setup()/loop() and not main(). Need to include "Arduino.h" for these entry points.
  4. If your source files are compiled for both Arduino and other platforms like linux, then the CMake flag ARDUINO and the compiler flag ARDUINO can be used for script/code portability. Other Arduino board/architecture specific standard flags can also be used.

Linking with Arduino code/libraries (target_link_arduino_libraries)

/CMakeLists.txt and any other dependent CMake scripts of the project contain the standard CMake scripting using add_library, add_executable etc. without Arduino specific changes. Refer to CMake documentation for the same. However when the project source code depends on the Arduino code or libraries (i.e. if the corresponding header files are included), then appropriate linking is required, as expected. This is done using target_link_arduino_libraries as explained below.

If Arduino.h is included in your source files, then the target must be linked against the 'core' Arduino library as follows.

add_library(my_library my_library.c) # my_library.c includes Arduino.h
target_link_arduino_libraries(my_library PRIVATE core)

If any other native or 3rd party libraries are used, then those libraries must be linked similarly as follows.

add_executable(my_app my_app.c) # my_app.c includes Wire.h, Arduino.h
target_link_arduino_libraries(my_app PRIVATE Wire core)

Like Arduino IDE, if the required Arduino libraries are to be automatically identified and linked, then it can be done as follows.

add_executable(my_app my_app.c) # my_app.c includes Wire.h, Arduino.h
# Link Wire and core automatically (PUBLIC linking in this example)
target_link_arduino_libraries(my_app AUTO_PUBLIC)

Note:

  1. Wire and core in the above examples are not CMake targets. They are just Arduino library names (case-sensitive).
  2. It is required only to specify the direct dependencies. Any deeper dependencies are automatically identified and linked. For example, if SD.h is included, it is sufficient to link with SD, even if SD depends on other Arduino libraries, like SPI.

These examples illustrates simple usage, but powerful enough for most use cases. However more advanced control and customization of Arduino libraries should be possible. Please refer to the Examples folder, as well as the API documentation of target_link_arduino_libraries (Currently documented as comments in BoardBuildTargets.cmake).

Uploading to the target board (target_enable_arduino_upload)

If support for generating HEX binary and uploading it to the board is required, then a call to target_enable_arduino_upload is required for each executable target, as shown below.

add_executable(my_executable my_executable.c)
target_link_arduino_libraries(my_executable PRIVATE core) # Assuming my_executable.c includes Arduino.h
target_enable_arduino_upload(my_executable) # This adds a target upload-my_executable

Upload the executable (from the above example) to the board on COM3 serial port as follows

<make-command> upload-my_executable SERIAL_PORT=COM3

Upload the executable to the board through remote provisioning as follows

<make-command> upload-my_executable NETWORK_PORT=<IP>[:<port>]

For using a programmer, select the programmer in board options or the CMake GUI, and then execute the following

<make-command> program-my_executable CONFIRM=1

Using the programmer, bootloader can be flashed as below

<make-command> burn-bootloader CONFIRM=1

Serial port monitoring

Currently there is no support available for this within this toolchain. However any external serial port monitor can be used (e.g. Putty). External serial monitor may need to be closed before upload and reopened after upload, because both use the same serial port.

Known issues

Many of the issues in the master branch have been fixed in release-1.1-dev branch. Although not tested to be fully stable, release-1.1-dev is stable enough to try out and report any futher issues before it gets merged into master.

Below are the list of known issues in the master branch.

1. Uploaded application does not work on some boards

Caused by build linking issue that does not link some object files related to platform variant sources contained in the core library. Affects any Arduino platform that has variant source files in addition to the variant header files.

Resolution: Please try with release-1.1-dev branch or otherwise, temporary fixes are available in the branches fix/variant_link_alt1 and fix/variant_link_alt2.

Compromises when using the fix/variant_link_alt1 fix: (1) CMake version must be above 3.13, (2) Application needs to link with core directly, like in Examples/01_hello_world, and not like in Examples/03_portable_app which links transitively.

Compromises when using the fix/variant_link_alt2 fix: Need to retrigger cmake and do rebuild, after the first successful build, if transitive linking of core is used in the project. May get "source some_file.o not found error" in CMake during the first invocation of CMake that can be ignored.

2. Build/link issue on some 3rd party platforms

Resolution: Please try with release-1.1-dev branch.

3. Some libraries are not detected by target_link_arduino_libraries

Currently, target_link_arduino_libraries takes only include names (i.e. the name of the header file without extension). If the include name does not match with the library name (as mentioned in library.properties of the library), the detection of the library fails (Refer issue #19).

Workaround: Rename the library folder to the include name and use include name in target_link_arduino_libraries.

Resolution: Please try with release-1.1-dev branch.

How it works

This toolchain follows the build process described in Arduino Build Process, and processes the JSON, platform.txt and boards.txt files correponding to the Arduino platform as specified in the documentation Arduino IDE 1.5 3rd party Hardware specification.

License

MIT © 2020 Arduino-CMake-Toolchain

Comments
  • The CXX compiler identification is unknown (Optiboot)

    The CXX compiler identification is unknown (Optiboot)

    Hi, having my Board as mega 2560 everything is fine. All compilers are found and perfectly used. But now i have burned Optiboot onto my mega and selected the optiboot2560 board.

    Now it searches avr-gcc and avr-g++ in paths where no binary is located. avr-gcc and avrg++ are available via Path. I have added CMAKE_CXX_COMPILER and CMAKE_C_COMPILER but no success.

    Can you give me any pointers where i could possibly look? I can't tell if the optiboot files are wrong or there is something with arduino toolchain.

    [email protected]:~/git/homeduino$ cmake -DCMAKE_TOOLCHAIN_FILE=~/git/Arduino-CMake-Toolchain/Arduino-toolchain.cmake -G "CodeBlocks - Unix Makefiles" .
    /usr/share/arduino
    -- Found Arduino package /home/hacki/.arduino15/package_index.json
    -- Found Arduino package /home/hacki/.arduino15/package_optiboot_optiboot-additional_index.json
    -- Found Arduino package /usr/share/arduino/hardware/package_index_bundled.json
    -- Found Arduino Platform: /usr/share/arduino/hardware/arduino/avr
    -- Found Arduino Platform: /home/hacki/.arduino15/packages/Optiboot/hardware/avr/0.8.0
    -- Selected Arduino Board: Optiboot on Mega2560 [avr.optiboot2560]
    -- The CXX compiler identification is unknown
    -- Indexing Arduino libraries for the project
    CMake Error at CMakeLists.txt:3 (project):
      The CMAKE_CXX_COMPILER:
    
        /home/hacki/git/homeduino/_pkg_mgr/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++
    
      is not a full path to an existing compiler tool.
    
      Tell CMake where to find the compiler by setting either the environment
      variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
      to the compiler, or to the compiler name if it is in the PATH.
    
    
    -- Configuring incomplete, errors occurred!
    See also "/home/hacki/git/homeduino/CMakeFiles/CMakeOutput.log".
    See also "/home/hacki/git/homeduino/CMakeFiles/CMakeError.log".
    

    Board from Optiboot set(ARDUINO_BOARD "avr.optiboot2560") # Optiboot on Mega2560

    CMakeError.log

    Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
    Compiler: /home/hacki/git/homeduino/cmake-build-debug/_pkg_mgr/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ 
    Build flags: 
    Id flags:  
    
    The output was:
    No such file or directory
    
    question 
    opened by hacki11 7
  • Arduino due produces newline in build command

    Arduino due produces newline in build command

    I am currently unable to compile any project (including the provided examples) for the arduino Due board. I think i see (at least one place) where this comes from, but any help would be appreciated.

    Problem Description

    I successfully followed your Example and created a BoardOptions.cmake with the line for the arduino due uncommented:

    set(ARDUINO_BOARD "Arduino Due (Programming Port) [sam.arduino_due_x_dbg]") # Arduino Due (Programming Port)
    

    Running cmake again works correctly using the command:

    cmake -D CMAKE_TOOLCHAIN_FILE=../Arduino-toolchain.cmake ../Examples
    

    But now actually building the project fails:

    >  cmake --build . --target upload-hello_world -- SERIAL_PORT=/dev/ttyUSB0
    01_hello_world/CMakeFiles/_arduino_lib_core.dir/build.make:64: *** missing separator.  Stop.
    CMakeFiles/Makefile2:157: recipe for target '01_hello_world/CMakeFiles/_arduino_lib_core.dir/all' failed
    make[2]: *** [01_hello_world/CMakeFiles/_arduino_lib_core.dir/all] Error 2
    CMakeFiles/Makefile2:132: recipe for target '01_hello_world/CMakeFiles/upload-hello_world.dir/rule' failed
    make[1]: *** [01_hello_world/CMakeFiles/upload-hello_world.dir/rule] Error 2
    Makefile:131: recipe for target 'upload-hello_world' failed
    make: *** [upload-hello_world] Error 2
    

    Running the whole thing with Ninja instead of make (i.e. append ```-G Ninja to the cmake commands) yields the error

    ninja: error: rules.ninja:29: expected '=', got identifier
     -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM  -D__SAM3X8E__ -mthumb -DUSB_VID=0...
                       ^ near here
    

    Incorrectly generated files

    Checking the file from the make error description actually shows an incorrectly generated command:

    [...]
    59 
    60 01_hello_world/CMakeFiles/_arduino_lib_core.dir/home/wilbrandt/.arduino15/packages/arduino/hardware/sam/1.6.12/cores/arduino/WInterrupts.c.o: 01_hello_world/CMakeFiles/_arduino_lib_core.dir/flags.make
    61 01_hello_world/CMakeFiles/_arduino_lib_core.dir/home/wilbrandt/.arduino15/packages/arduino/hardware/sam/1.6.12/cores/arduino/WInterrupts.c.o: /home/wilbrandt/.arduino15/packages/arduino/hardware/sam/1.6.12/cores/arduino/WInterrupts.c
    62 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/wilbrandt/projects/tracked_robot/arduino_firmware/Arduino-CMake-Toolchain/Examples_build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building C object 62 01_hello_world/CMakeFiles/_arduino_lib_core.dir/home/wilbrandt/.arduino15/packages/arduino/hardware/sam/1.6.12/cores/arduino/WInterrupts.c.o"
    63 	cd /home/wilbrandt/projects/tracked_robot/arduino_firmware/Arduino-CMake-Toolchain/Examples_build/01_hello_world && /home/wilbrandt/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-gcc  -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -Dprintf=iprintf -MMD -mcpu=cortex-m3 -mthumb -DF_CPU=84000000L -DARDUINO=2:10005+dfsg2-401
    64  -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM  -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino Due\"" -I/home/wilbrandt/.arduino15/packages/arduino/hardware/sam/1.6.12/system/libsam -I/home/wilbrandt/.arduino15/packages/arduino/hardware/sam/1.6.12/system/CMSIS/CMSIS/Include/ -I/home/wilbrandt/.arduino15/packages/arduino/hardware/sam/1.6.12/system/CMSIS/Device/ATMEL/ $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) /home/wilbrandt/.arduino15/packages/arduino/hardware/sam/1.6.12/cores/arduino/WInterrupts.c -o CMakeFiles/_arduino_lib_core.dir/home/wilbrandt/.arduino15/packages/arduino/hardware/sam/1.6.12/cores/arduino/WInterrupts.c.o
    65 
    [...]
    

    (Notice the line break before the -DARDUINO_SAM_DUE flag). The ninja.rules file shows a similar error:

    [...]
    24 
    25 rule CXX_COMPILER__hello_world
    26   depfile = $DEP_FILE
    27   deps = gcc
    28   command = /home/wilbrandt/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++  -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD -mcpu=cortex-m3 -mthumb -DF_CPU=84000000L -DARDUINO=2:10005+dfsg2-401
    29  -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM  -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino Due\"" -I/home/wilbrandt/.arduino15/packages/arduino/hardware/sam/1.6.12/system/libsam -I/home/wilbrandt/.arduino15/packages/arduino/hardware/sam/1.6.12/system/CMSIS/CMSIS/Include/ -I/home/wilbrandt/.arduino15/packages/arduino/hardware/sam/1.6.12/system/CMSIS/Device/ATMEL/ $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE $in -o $out
    30   description = Building CXX object $out
    [...]
    

    Suspected Error Source

    After browsing through the toolchain files i found this message call. Uncommenting it already showed the same problem:

    > cmake -D CMAKE_TOOLCHAIN_FILE=../Arduino-toolchain.cmake ../Examples
    -- Found Arduino Platform: /home/wilbrandt/.arduino15/packages/arduino/hardware/avr/1.8.2
    -- Found Arduino Platform: /home/wilbrandt/.arduino15/packages/arduino/hardware/sam/1.6.12
    -- Selected Arduino Board: Arduino Due (Programming Port) [sam.arduino_due_x_dbg]
    ARDUINO_RULE_recipe.c.o.pattern:"/home/wilbrandt/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-gcc" -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -Dprintf=iprintf -MMD -mcpu=cortex-m3 -mthumb -DF_CPU=84000000L -DARDUINO=2:10005+dfsg2-401
     -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM  -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON '-DUSB_MANUFACTURER="Arduino LLC"' '-DUSB_PRODUCT="Arduino Due"' "-I/home/wilbrandt/.arduino15/packages/arduino/hardware/sam/1.6.12/system/libsam" "-I/home/wilbrandt/.arduino15/packages/arduino/hardware/sam/1.6.12/system/CMSIS/CMSIS/Include/" "-I/home/wilbrandt/.arduino15/packages/arduino/hardware/sam/1.6.12/system/CMSIS/Device/ATMEL/" {includes} "{source_file}" -o "{object_file}"
    -- The C compiler identification is GNU 4.8.3
    -- The CXX compiler identification is GNU 4.8.3
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - failed
    -- Detecting C compile features
    -- Detecting C compile features - failed
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - failed
    -- Detecting CXX compile features
    -- Detecting CXX compile features - failed
    -- The ASM compiler identification is GNU
    -- Found assembler: /home/wilbrandt/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-gcc
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/wilbrandt/projects/tracked_robot/arduino_firmware/Arduino-CMake-Toolchain/Examples_build
    

    This (and also testing the written CMAKE_C_COMPILE_OBJECT, which also has the newline) leads me to believe that the _resolve_build_rule_properties function doesn't handle newlines in its input correctly.

    System

    I am not quite sure which information is relevant to you, so i'll just post some system information here. I work on an ubuntu 18.04.4.

    > cmake --version
    cmake version 3.10.2
    
    CMake suite maintained and supported by Kitware (kitware.com/cmake).
    

    I use the current Arduino IDE with version 1.8.12.

    Miscellaneous

    As i don't know too much about low-level CMake witchery any help would be appreciated. Thank you for providing this solution, it seems to be very neatly integrated (once it works for me) and looks like exactly the solution i was looking for.

    bug 
    opened by RobertWilbrandt 7
  • _library_search_process excludes valid libraries when there isn't a matching header.

    _library_search_process excludes valid libraries when there isn't a matching header.

    In Arduino-CMake-Toolchain-release-1.1-dev\Arduino\System\BoardBuildTargets.cmake at the end of the function function(_library_search_process lib search_paths_var search_suffixes_var return_var) is this final check:

    	# Although we got the match, let us search for the required header within the folder
    	file(GLOB_RECURSE lib_header_path "${matched_lib_path}/${lib}.h*")
    	if (NOT lib_header_path)
    		set ("${return_var}" "${lib}-NOTFOUND" PARENT_SCOPE)
    		return()
    	endif()
    

    I am not sure if this applied to other libraries. But the ESP32 BLE Arduino library has some caveats:

    1. The library folder name is BLE. So the call has to be target_link_arduino_libraries(arc003-2 AUTO_PUBLIC PRIVATE BLE) even though that isn't the library name.
    2. The library name is 'ESP32 BLE Arduino'. The mismatch here does not seem to be an issue (probably because BLE is still in the name).
    3. There is no BLE.h or BLE.cpp in the src as the library is comprised of other files. This is the core issue that prevents this library from being found.

    Possible fixes are to:

    1. Modify the final check in _library_search_process to maybe include a flag to skip that check or remove it.
    2. Add BLE.h or BLE.cpp to the library (not ideal).

    For me, I have commented out the check for the time being.

    Looking forward to your thoughts.

    bug 
    opened by raphael-bmec-co 6
  • Cannot find Arduino Nano

    Cannot find Arduino Nano

    It seems to be looking at the right places:

    -- Found Arduino Platform: /home/blasco/.arduino15/packages/esp32/hardware/esp32/1.0.2
    -- Found Arduino Platform: /home/blasco/.arduino15/packages/esp8266/hardware/esp8266/2.5.0
    -- Found Arduino Platform: /home/blasco/.arduino15/packages/arduino/hardware/avr/1.6.23
    -- Found Arduino Platform: /home/blasco/.arduino15/packages/arduino/hardware/megaavr/1.8.3
    -- Found Arduino Platform: /home/blasco/.arduino15/packages/atmel-avr-xminis/hardware/avr/0.
    

    I can see that there is a Arduino Nano option in boards.txt for

    -- Found Arduino Platform: /home/blasco/.arduino15/packages/arduino/hardware/avr/1.6.23
    

    And I can see the arduino nano in board.txt there:

    nano.name=Arduino Nano
    
    nano.upload.tool=avrdude
    nano.upload.protocol=arduino
    
    nano.bootloader.tool=avrdude
    nano.bootloader.unlock_bits=0x3F
    nano.bootloader.lock_bits=0x0F
    
    nano.build.f_cpu=16000000L
    nano.build.board=AVR_NANO
    nano.build.core=arduino
    nano.build.variant=eightanaloginputs
    

    Nevertheless, I don't see arduino nano related content in platform.txt

    Is the script currently looking only at platform txt? What do I need to change to make it work with nano? Thank you for the great project

    bug 
    opened by blasco 5
  • Board options not found in Ubuntu

    Board options not found in Ubuntu

    Hi,

    I've been trying to get the toolchain running on Ubuntu 18.04, but after following the steps on https://github.com/a9183756-gh/Arduino-CMake-Toolchain/blob/master/Examples/README.md the BoardOptions.cmake file it creates is empty:

    # Copyright (c) 2020 Arduino CMake Toolchain
    
    ###############################################################################
    # This is an automatically generated template file for board options.
    # You may edit it to comment/uncomment selected board and board options.
    # However do not change the structure of this template, which is fixed and 
    # any change to the structure gets overwritten.
    

    And I suspect it simply is not finding the installed Arduino framework, which I'm not really quite sure is installed properly in the first place. I followed the normal instructions to install it in the main Arduino page. I'm a bit of a newbie on Ubuntu so I'm not quite sure if I have everything configured properly. The installation path of arduino is on /usr/share/arduino.

    I have tried the same examples on Windows and it works like a charm, it finds the Arduino installation and boards just fine, and the BoardOptions.cmake is populated properly.

    Maybe I'm missing some environment variable, or the path of the Arduino installation is wrong, I'm not sure, or maybe is something completely different.

    I'll look into the code to see how it determines the Arduino installation path, but I figured I asked for help anyways.

    Thanks!

    documentation enhancement good first issue 
    opened by serjche 4
  • Feature request: Sketch exceeds program storage space warning.

    Feature request: Sketch exceeds program storage space warning.

    Arduino IDE provides the following error and blocks upload. This is very useful and a challenging issue to diagnose when upload takes place anyway.

    Sketch uses 1311950 bytes (100%) of program storage space. Maximum is 1310720 bytes.
    Global variables use 57732 bytes (17%) of dynamic memory, leaving 269948 bytes for local variables. Maximum is 327680 bytes.
    Sketch too big; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing it.
    text section exceeds available space in board
    Error compiling for board ESP32 Dev Module.
    
    bug 
    opened by raphael-bmec-co 4
  • ESP8266

    ESP8266

    Hello, nice work to bring a actual version of a cmake-toolchain variant.

    I like to use this with arduino + esp8266 so i tried to setup a project with this, but i can't link it.

    Look at following terminal output:

    Executing recipe.hooks.linking.prelink.1.pattern hook
    /home/jonas/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: warning: cannot find entry symbol app_entry; defaulting to 0000000040100000
    /home/jonas/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: /home/jonas/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/libc/xtensa-lx106-elf/lib/libc.a(lib_a-dtoa.o):(.literal+0x44): undefined reference to `malloc'
    /home/jonas/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: /home/jonas/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/libc/xtensa-lx106-elf/lib/libc.a(lib_a-dtoa.o): in function `_dtoa_r':
    /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdlib/dtoa.c:238: undefined reference to `malloc'
    /home/jonas/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: /home/jonas/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/libc/xtensa-lx106-elf/lib/libc.a(lib_a-mprec.o):(.literal+0x0): undefined reference to `_calloc_r'
    /home/jonas/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: /home/jonas/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/libc/xtensa-lx106-elf/lib/libc.a(lib_a-mprec.o): in function `_Balloc':
    /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdlib/mprec.c:103: undefined reference to `malloc'
    /home/jonas/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdlib/mprec.c:107: undefined reference to `_calloc_r'
    /home/jonas/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdlib/mprec.c:124: undefined reference to `_calloc_r'
    /home/jonas/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: /home/jonas/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/libc/xtensa-lx106-elf/lib/libc.a(lib_a-mprec.o): in function `_Bfree':
    /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdlib/mprec.c:139: undefined reference to `malloc'
    /home/jonas/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: /home/jonas/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/libc/xtensa-lx106-elf/lib/libc.a(lib_a-mprec.o): in function `__pow5mult':
    /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdlib/mprec.c:435: undefined reference to `malloc'
    /home/jonas/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: /home/jonas/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/libc/xtensa-lx106-elf/lib/libc.a(lib_a-nano-svfprintf.o):(.literal+0x0): undefined reference to `_malloc_r'
    /home/jonas/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: /home/jonas/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/libc/xtensa-lx106-elf/lib/libc.a(lib_a-nano-svfprintf.o):(.literal+0x4): undefined reference to `_realloc_r'
    /home/jonas/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: /home/jonas/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/libc/xtensa-lx106-elf/lib/libc.a(lib_a-nano-svfprintf.o):(.literal+0x8): undefined reference to `_free_r'
    /home/jonas/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: /home/jonas/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/libc/xtensa-lx106-elf/lib/libc.a(lib_a-nano-svfprintf.o): in function `__ssputs_r':
    /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/nano-vfprintf.c:202: undefined reference to `_malloc_r'
    /home/jonas/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/nano-vfprintf.c:213: undefined reference to `_realloc_r'
    /home/jonas/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/nano-vfprintf.c:217: undefined reference to `_free_r'
    /home/jonas/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: /home/jonas/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/libc/xtensa-lx106-elf/lib/libc.a(lib_a-nano-svfprintf.o): in function `__ssprint_r':
    /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/nano-vfprintf.c:293: undefined reference to `_malloc_r'
    /home/jonas/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/nano-vfprintf.c:304: undefined reference to `_realloc_r'
    /home/jonas/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/nano-vfprintf.c:309: undefined reference to `_free_r'
    /home/jonas/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: /home/jonas/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/libc/xtensa-lx106-elf/lib/libc.a(lib_a-nano-svfprintf.o): in function `_svfprintf_r':
    /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/nano-vfprintf.c:507: undefined reference to `_malloc_r'
    collect2: error: ld returned 1 exit status
    make[3]: *** [CMakeFiles/IOTNetCore.dir/build.make:92: IOTNetCore.elf] Fehler 1
    make[3]: Verzeichnis „/home/jonas/DEV/Projects/DEV.CPP.IOTNetCore/cmake-build-debug“ wird verlassen
    make[2]: *** [CMakeFiles/Makefile2:170: CMakeFiles/IOTNetCore.dir/all] Fehler 2
    make[2]: Verzeichnis „/home/jonas/DEV/Projects/DEV.CPP.IOTNetCore/cmake-build-debug“ wird verlassen
    make[1]: *** [CMakeFiles/Makefile2:177: CMakeFiles/IOTNetCore.dir/rule] Fehler 2
    make[1]: Verzeichnis „/home/jonas/DEV/Projects/DEV.CPP.IOTNetCore/cmake-build-debug“ wird verlassen
    make: *** [Makefile:157: IOTNetCore] Fehler 2
    
    invalid 
    opened by Jonas18175 4
  • No compiler warnings? Can compiler flags be set on a by-target basis?

    No compiler warnings? Can compiler flags be set on a by-target basis?

    Potential bug? I don't see any compiler warnings even though I expect some.

    Is there a way to set compiler flags either globally or on a per-target basis? And is it expected to not see anything from a #pragma message directive?

    I've attempted to use the following:

    • set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic") both before and after the toolchain file inclusion and with and without cacheing
    • add_definitions("-Wall -Wextra -pedantic")
    • target_compile_options(myLib PUBLIC -Wall -Wextra -pedantic)

    However when I have an unused and uninitialized variable, e.g.,

    void loop() {
       int x;
    }
    

    I see no warnings.

    And even when attempting either the #pragma message "test" or #warning "test" I don't see any warnings printed to the screen. Switching to #error "test" triggers a compile-time error and shows the message.

    Output from CMake config shown below running on MacOS 12.2 using Arduino SDK 1.8.19:

    /Applications/Arduino.app/Contents/Java
    -- Found Arduino Platform: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr
    -- Found Arduino Platform: /Users/connorfuhrman/Library/Arduino15/packages/esp32/hardware/esp32/2.0.0
    -- Selected Arduino Board: Arduino Uno [avr.uno]
    -- The C compiler identification is GNU 7.3.0
    -- The CXX compiler identification is GNU 7.3.0
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working C compiler: /Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc - skipped
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Check for working CXX compiler: /Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ - skipped
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- The ASM compiler identification is GNU
    -- Found assembler: /Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc
    -- Found Arduino Library TimerInterrupt: /Users/connorfuhrman/Documents/Arduino/libraries/TimerInterrupt
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /path/to/my/project
    
    opened by connorfuhrman 2
  • Linking error when compiling stm32duino project

    Linking error when compiling stm32duino project

    When compiling a stm32duino project the linker complains about missing references. I tried all branches. The output is:

    /home/user/local/arduino/arduino15/packages/STM32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: lib_arduino_lib_core.a(startup_stm32yyxx.S.obj): in function LoopFillZerobss': (.text.Reset_Handler+0x2a): undefined reference toSystemInit' /home/user/local/arduino/arduino15/packages/STM32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: lib_arduino_lib_STM32duino_Low_Power.a(STM32LowPower.cpp.o): in function STM32LowPower::begin()': STM32LowPower.cpp:(.text._ZN13STM32LowPower5beginEv+0x4): undefined reference toLowPower_init' /home/user/local/arduino/arduino15/packages/STM32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: lib_arduino_lib_core.a(HardwareSerial.cpp.o): in function HardwareSerial::write(unsigned char)': HardwareSerial.cpp:(.text._ZN14HardwareSerial5writeEh+0x2a): undefined reference touart_enable_tx' /home/user/local/arduino/arduino15/packages/STM32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: HardwareSerial.cpp:(.text._ZN14HardwareSerial5writeEh+0x46): undefined reference to serial_tx_active' /home/user/local/arduino/arduino15/packages/STM32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: HardwareSerial.cpp:(.text._ZN14HardwareSerial5writeEh+0x52): undefined reference touart_attach_tx_callback' /home/user/local/arduino/arduino15/packages/STM32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: lib_arduino_lib_core.a(HardwareSerial.cpp.o): in function HardwareSerial::HardwareSerial(void*, HalfDuplexMode_t)': HardwareSerial.cpp:(.text._ZN14HardwareSerialC2EPv16HalfDuplexMode_t+0x52): undefined reference topinmap_pin' /home/user/local/arduino/arduino15/packages/STM32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: HardwareSerial.cpp:(.text._ZN14HardwareSerialC2EPv16HalfDuplexMode_t+0x5c): undefined reference to pinmap_pin' /home/user/local/arduino/arduino15/packages/STM32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: lib_arduino_lib_core.a(HardwareSerial.cpp.o): in functionHardwareSerial::enableHalfDuplexRx()': HardwareSerial.cpp:(.text._ZN14HardwareSerial18enableHalfDuplexRxEv+0x28): undefined reference to uart_enable_rx' /home/user/local/arduino/arduino15/packages/STM32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: lib_arduino_lib_core.a(board.c.o): in functioninit': board.c:(.text.init+0x2): undefined reference to hw_config_init' /home/user/local/arduino/arduino15/packages/STM32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: lib_arduino_lib_core.a(wiring_time.c.o): in functionmillis': wiring_time.c:(.text.millis+0x2): undefined reference to `getCurrentMillis' collect2: error: ld returned 1 exit status CMake Error at .scripts/LinkScript.cmake:286 (message): Linking test_deepsleep failed!!!

    opened by hackbeere 2
  • Unable to compile examples:

    Unable to compile examples: "The C Compiler [...] is not able to compile a simple test program"

    I am currently unable to build your examples as described without modifying the Toolchain file.

    Problem Description

    I tried building your examples just as descrbed in the markdown file. After a first run, i set the board in BoardOptions.cmake to the arduino due (also tested with arduino uno). Re-running the cmake command leads to the following error:

    > cmake -D CMAKE_TOOLCHAIN_FILE=../Arduino-toolchain.cmake ../Examples
    -- Found Arduino Platform: /home/wilbrandt/.arduino15/packages/arduino/hardware/avr/1.8.2
    -- Found Arduino Platform: /home/wilbrandt/.arduino15/packages/arduino/hardware/sam/1.6.12
    -- Selected Arduino Board: Arduino Due (Programming Port) [sam.arduino_due_x_dbg]
    -- The C compiler identification is GNU 4.8.3
    -- The CXX compiler identification is GNU 4.8.3
    -- Check for working C compiler: /home/wilbrandt/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-gcc
    -- Check for working C compiler: /home/wilbrandt/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-gcc -- broken
    CMake Error at /usr/share/cmake-3.10/Modules/CMakeTestCCompiler.cmake:52 (message):
      The C compiler
    
        "/home/wilbrandt/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-gcc"
    
      is not able to compile a simple test program.
    
      It fails with the following output:
    
        Change Dir: /home/wilbrandt/projects/tracked_robot/arduino_firmware/Arduino-CMake-Toolchain/Examples_build/CMakeFiles/CMakeTmp
        
        Run Build Command:"/usr/bin/make" "cmTC_5a574/fast"
        /usr/bin/make -f CMakeFiles/cmTC_5a574.dir/build.make CMakeFiles/cmTC_5a574.dir/build
        make[1]: Entering directory '/home/wilbrandt/projects/tracked_robot/arduino_firmware/Arduino-CMake-Toolchain/Examples_build/CMakeFiles/CMakeTmp'
        CMakeFiles/cmTC_5a574.dir/build.make:67: *** missing separator.  Stop.
        make[1]: Leaving directory '/home/wilbrandt/projects/tracked_robot/arduino_firmware/Arduino-CMake-Toolchain/Examples_build/CMakeFiles/CMakeTmp'
        Makefile:126: recipe for target 'cmTC_5a574/fast' failed
        make: *** [cmTC_5a574/fast] Error 2
        
    
      
    
      CMake will not be able to correctly generate this project.
    Call Stack (most recent call first):
      CMakeLists.txt:3 (project)
    
    
    -- Configuring incomplete, errors occurred!
    

    Workaround

    After some googling this seems to be a common issue when crosscompiling with cmake. I was able to work around this problem by bypassing the compiler tests completely, but this doesn't seem like the correct way to do this. My workaround was simply adding the two lines

    SET (CMAKE_C_COMPILER_WORKS 1)
    SET (CMAKE_CXX_COMPILER_WORKS 1)
    

    to Arduino-toolchain.cmake.

    System

    I am not quite sure which information is relevant to you, so i'll just post some system information here. I work on an ubuntu 18.04.4.

    > cmake --version
    cmake version 3.10.2
    
    CMake suite maintained and supported by Kitware (kitware.com/cmake).
    

    I use the current Arduino IDE with version 1.8.12.

    Conclusion

    As this seems to be a common problem with cross-compiling, it would be nice to find a usable fix for this. As i don't have any experience cross-compiling with cmake, any help would be appreciated.

    duplicate 
    opened by RobertWilbrandt 2
  • Unknown CMake command

    Unknown CMake command "target_link_arduino_libraries"

    I'm trying to compile the example project hello-world, but i'm stuck with the issue it can not find target_link_arduino_libraries.

    do you have any hints to solve this issue?

    /home/hacki/.local/share/JetBrains/Toolbox/apps/CLion/ch-0/201.7223.86/bin/cmake/linux/bin/cmake -DCMAKE_BUILD_TYPE=Debug -D ARDUINO_TOOLCHAIN_FILE=~/git/Arduino-CMake-Toolchain/Arduino-toolchain.cmake -G "CodeBlocks - Unix Makefiles" /home/hacki/git/Arduino-CMake-Toolchain/Examples/01_hello_world
    -- The CXX compiler identification is GNU 9.3.0
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    CMake Error at CMakeLists.txt:7 (target_link_arduino_libraries):
      Unknown CMake command "target_link_arduino_libraries".
    
    
    -- Configuring incomplete, errors occurred!
    See also "/home/hacki/git/Arduino-CMake-Toolchain/Examples/01_hello_world/cmake-build-debug/CMakeFiles/CMakeOutput.log".
    
    [Finished]
    ``
    opened by hacki11 2
Owner
Arun
Arun
A CMake toolchain file for iOS, macOS, watchOS & tvOS C/C++/Obj-C++ development

A CMake toolchain file for iOS, macOS, watchOS & tvOS C/C++/Obj-C++ development

Alexander Widerberg 1.4k Jan 4, 2023
A toolchain file and examples using cmake for iOS development

ios-cmake A toolchain file and examples using cmake for iOS development. This is a fork of a similar project found on https://code.google.com/p/ios-cm

Bogdan Cristea 304 Nov 30, 2022
CMake toolchain file and other scripts for the Android NDK

android-cmake CMake is great, and so is Android. This is a collection of CMake scripts that may be useful to the Android NDK community. It is based on

Andrey Kamaev 1.2k Jan 7, 2023
📦 CMake's missing package manager. A small CMake script for setup-free, cross-platform, reproducible dependency management.

Setup-free CMake dependency management CPM.cmake is a CMake script that adds dependency management capabilities to CMake. It's built as a thin wrapper

CPM.cmake 1.6k Jan 9, 2023
CMake checks cache helper modules – for fast CI CMake builds!

cmake-checks-cache Cross platform CMake projects do platform introspection by the means of "Check" macros. Have a look at CMake's How To Write Platfor

Cristian Adam 65 Dec 6, 2022
CMake scripts for painless usage of SuiteSparse+METIS from Visual Studio and the rest of Windows/Linux/OSX IDEs supported by CMake

CMake scripts for painless usage of Tim Davis' SuiteSparse (CHOLMOD,UMFPACK,AMD,LDL,SPQR,...) and METIS from Visual Studio and the rest of Windows/Lin

Jose Luis Blanco-Claraco 395 Dec 24, 2022
cmake-font-lock - Advanced, type aware, highlight support for CMake

cmake-font-lock - Advanced, type aware, highlight support for CMake

Anders Lindgren 39 Oct 2, 2022
Make CMake less painful when trying to write Modern Flexible CMake

Izzy's eXtension Modules IXM is a CMake library for writing Modern flexible CMake. This means: Reducing the amount of CMake written Selecting reasonab

IXM 107 Sep 1, 2022
CMake module to enable code coverage easily and generate coverage reports with CMake targets.

CMake-codecov CMake module to enable code coverage easily and generate coverage reports with CMake targets. Include into your project To use Findcodec

HPC 82 Nov 30, 2022
unmaintained - CMake module to activate certain C++ standard, feature checks and appropriate automated workarounds - basically an improved version of cmake-compile-features

Compatibility This library provides an advanced target_compile_features() and write_compiler_detection_header(). The problem with those is that they a

Jonathan Müller 74 Dec 26, 2022
[CMake] [BSD-2] CMake module to find ICU

FindICU.cmake A CMake module to find International Components for Unicode (ICU) Library Note that CMake, since its version 3.7.0, includes a FindICU m

julp 29 Nov 2, 2022
Utility and common library for all polysquare cmake tools.

Polysquare CMake Tooling Utility Functions Utility and common library for all polysquare cmake tools. Status Travis CI (Ubuntu) AppVeyor (Windows) Cov

ポリ平方 POLYSQUARE 3 May 7, 2021
Arduino CMake Build system

Arduino Cmake Example Project This is the Cmake project settings for the Arduino platform. You can use this project as an example to develop C++ progr

Francois Campbell 57 Oct 13, 2022
CMake project for BL602 RISC-V processor

bl602_cmake_base CMake project for BL602 RISC-V processor How to build NOTE : This project uses a pre-compiled version of the Buffalo SDK (bl_iot_sdk)

null 9 Jan 6, 2022
curl cmake module libcurl build with msvc x86

curl-msvc Infomation curl cmake module libcurl build with MSVC10.0 arch (x86 | i386) source from https://github.com/curl/curl tags: curl-7_79_1 Usage

Jason Payne 0 May 16, 2022
NeoWorld is a resampler using the CMake build system

NeoWorld is a resampler using the CMake build system. It's designed for utsu, OpenUTAU, and UTAU.

null 5 Dec 23, 2022
A CMake addon that avoids you writing boilerplate code for resource management.

SHader INJ(I)ector SHINJI (originally SHader INJector) is a CMake addon that avoids you writing boilerplate code for resource management and exposes s

Lorenzo Rutayisire 6 Dec 14, 2022
A CMake starter template using CPM

Cmake Starter About A lightweight Cmake project meant for a binary application (not a shared library), tests with catch2 are configured, CPM is the pa

Matt Williams 1 Jul 14, 2022
Non-intrusive CMake dependency management

cmodule Non-intrusive CMake dependency management. Normally CMake's find_package() looks for packages installed on host system (and compiled for host

scapix.com 14 Sep 29, 2022