Skip to content

External SDK path does not work #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
thomasgt opened this issue Jan 31, 2017 · 3 comments
Open

External SDK path does not work #168

thomasgt opened this issue Jan 31, 2017 · 3 comments

Comments

@thomasgt
Copy link

Manually setting the Arduino SDK path does not work. This issue can only replicated in environments where the Arduino IDE is not installed in one of the default locations.

I am working in Ubuntu 16.04. The only Arduino IDE/SDK on my system is installed in /opt/tools/arduino-1.0.3. I am running cmake from an out-of-tree build directory like this:
cmake -DARDUINO_SDK_PATH=/opt/tools/arduino-1.0.3 ..

I see the following output + error messages:

-- The C compiler identification is GNU 4.3.2
-- The CXX compiler identification is GNU 4.3.2
-- Arduino SDK version 1.0.3: /opt/tools/arduino-1.0.3
-- Check for working C compiler: /opt/tools/arduino-1.0.3/hardware/tools/avr/bin/avr-gcc
CMake Error at /home/thomas/Documents/arduino-cmake-master/cmake/ArduinoToolchain.cmake:81 (message):
  Could not find Arduino SDK (set ARDUINO_SDK_PATH)!
Call Stack (most recent call first):
  /home/thomas/Documents/arduino-cmake-master/build/CMakeFiles/3.5.1/CMakeSystem.cmake:6 (include)
  CMakeLists.txt:3 (project)


CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Configuring incomplete, errors occurred!
See also "/home/thomas/Documents/arduino-cmake-master/build/CMakeFiles/CMakeOutput.log".

If I install the arduino IDE in a different location, such as /opt/arduino-1.0.3, it works, but only because this is one of the default locations. It effectively ignores the path I specified when I invoked cmake.

It doesn't fail immediately (it finds the compiler), which is strange. It appears that the ARDUINO_SDK_PATH variable is being cleared at some point, but I can't figure out where this is happening.

@thomasgt
Copy link
Author

I think the issue is related to two conditions in cmake/ArduinoToolchain.cmake. The DEFINED keyword should be use to detect the ARDUINO_SDK_PATH:
if(NOT DEFINED ARDUINO_SDK_PATH)
and
if(DEFINED ARDUINO_SDK_PATH)

@frans-fuerst
Copy link

I've stumbled over this, too, but I think is has to do with compiler check. Looks like the compiler check step just uses it's own variable space.

(also see my StackOverflow question I've asked right now: http://stackoverflow.com/questions/43718042/how-can-a-cmake-variable-be-hidden)

@MrPointer
Copy link

If still relevant, please see #180. This should resolve all those issues.

Erriez added a commit to Erriez/arduino-cmake that referenced this issue Feb 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants