0

I'm trying to get CLion 2019.2 working with Vladimir Schneider's Arduino Support plugin (v1.4.4, from the Jetbrains Plugin repository)

I installed MinGW from https://sourceforge.net/projects/mingw/ into c:\mingw, then went to Settings -> Build/Execution/Deployment -> Toolchains, added a new MinGW toolchain from c:mingw, and allowed it to autodetect make, gcc, and g++.

I got an error that GDB was too old, selected "use bundled GDB", and the error went away.

I then created a new Arduino/Genuino Uno project, and attempted to build it.

At first, I was getting CMake Error at CMakeLists.txt:5 (set), due to line 5 being "set(${<@PROJECT_NAME@>}_BOARD uno)".

I found a post in the Arduino plugin's bug tracker said it's a bug in the plugin, and the work-around is to hand-edit CMakeLists.txt to replace every instance of "${<@PROJECT_NAME@>}" with "{PROJECT_NAME}" (apparently, there's a bug somewhere that causes it to wrap some environment variables with <@ and @>).

Now, I'm getting a different error whenever I try to build: "Cannot find any CMake profile"

I think I remember seeing a bug report thread for CLion itself speculating about the existence of a bug in CLion where the preferences UI implies that a configuration change has been made, but CLion doesn't actually update the file used by CMake to reflect the change. From what I recall, someone in the thread asked what specific file needed to be changed, and what specific changes were necessary... then the thread died without any subsequent posts for the past ~6 months.

Any ideas about what to try next?

Other relevant links for background info & context:

CLion's Arduino plugin by Vladimir Schneider: https://plugins.jetbrains.com/plugin/11301-arduino-support

Vladimir's project is a fork of an earlier plugin that was apparently broken by the release of CLion-2018.1. I'm under the impression that it still works for CLion 2019 under Linux, but was either broken by 2018.2 or 2019.1 for Windows, or never quite worked properly under Windows at all.

I've gotten the impression that, at least as of 2017-2018 (which is when a large number of postings about CMake-under-MinGW/Windows, CLion, and Arduino were made), CMake under Win32 via MinGW was still kind of buggy and brittle. The number of postings about them in 2019 is a lot smaller than 2017 and 2018, but I'm not sure whether that's because the problems people were talking about 2 years ago were solved, or because the people talking about them 2 years ago just got frustrated, decided it was a bit too bleeding-edge for them, and (at least temporarily) threw in the towel to wait for them to mature a bit.

Update: I just found another post theorizing that some of these problems might be due to limits imposed by Windows (by default) on the number of characters allowed in filename paths. I know Windows 10 allows you to increase the limit, but I know there are still a bunch of issues associated with doing that (Explorer can't touch anything with a path > 260 chars, cmd.exe -- and possibly Powershell -- requires using \\?\ notation, and Very Bad Things™ will happen if you physically attach a hard drive with files whose pathnames exceed the limit to a different computer running Windows that's still enforcing the old limit).

A tutorial for it that unfortunately seems to have gotten broken slightly by a subsequent release of CLion or one of its Arduino dependencies: https://vxlabs.com/2018/03/24/developing-arduino-sketches-with-jetbrains-clion-a-minimal-example/

(note to mods: I tried to tag this with "CLion" and "CMake", but the tags don't already exist, and my reputation isn't high enough yet to create new ones)

  • the reason that those tags do not exist is because they have nothing to do with an Arduino – jsotola Oct 6 at 1:59
  • Not quite. In theory, CLion can be used for C++ Arduino development (though, it appears, getting it to work with Windows instead of Linux is a major fragile ordeal at the moment), and CLion's "Arduino" plugin is CMake-based. It kind of feels as if CLion appeared on the scene right around the time CMake became relevant, and everyone writing Arduino plugins for it decided CMake was "the future"... and unfortunately, CMake STILL kind of appears to be "the future" (and not quite "the present"). See github.com/francoiscampbell/arduino-cmake – Bitbang3r Oct 6 at 2:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.