Skip to content

Build a project with a library that depends on another library #70

Closed
@blemasle

Description

@blemasle

Hi,

New to Cmake here. I try to hack my CMakeLists.txt and follow tutorials but I can't build my project which include an arduino library that has a dependency on another arduino library :
| Project
| ---> EEPROMEx
| --------->EEPROM

Here is my CMakeLists.txt :

set(ARDUINO_DEFAULT_BOARD uno) #default board ID, when not specified
set(ARDUINO_DEFAULT_PORT /dev/ttyUSB0) #default port, when not specified

link_directories(${CMAKE_SOURCE_DIR}/libraries)
set(Wire_RECURSE True)

generate_arduino_firmware(mls400
        SKETCH ./
        HDRS SomeHeader.h
        SRCS SomeHeader.cpp)

I even try to

  • add EEPROM to the "LIBS" argument, no luck
  • add link_directories [...]/libraries to the root CMakeLists.txt, no luck
  • call generate_arduino_library before generate_arduino_firmware, no luck
  • move EEPROMEx library to the ARDUINO_SDK libraries folder, no luck

For reference, I do not see my the EEPROM directory being included when building (by looking at build.make) EEPROMEx whereas I see the Wire directoy :

-I"/opt/arduino-1.0.5/hardware/arduino/cores/arduino"
-I"/opt/arduino-1.0.5/libraries"
-I"/opt/arduino-1.0.5/hardware/arduino/variants/standard" 
-I"/home/blemasle/tmp/workdir/libraries/EEPROMEx"
-I"/home/blemasle/tmp/workdir/libraries/EEPROMEx/utility" 
-I"/home/blemasle/tmp/workdir/MLS400"
-I"/home/blemasle/tmp/workdir/libraries/EEPROMEx" 
-I"/opt/arduino-1.0.5/libraries/Wire" 
-o CMakeFiles/uno_EEPROMEx.dir/__/libraries/EEPROMEx/EEPROMEx.cpp.obj 
-c /home/blemasle/tmp/workdir/libraries/EEPROMEx/EEPROMEx.cpp

Here is the make output :

Linking CXX static library libuno_CORE.a
[ 68%] Built target uno_CORE
Scanning dependencies of target uno_Wire
[ 72%] Building CXX object MLS400/CMakeFiles/uno_Wire.dir/opt/arduino-1.0.5/libraries/Wire/Wire.cpp.obj
[ 75%] Building C object MLS400/CMakeFiles/uno_Wire.dir/opt/arduino-1.0.5/libraries/Wire/utility/twi.c.obj
Linking CXX static library libuno_Wire.a
[ 75%] Built target uno_Wire
Scanning dependencies of target uno_EEPROM
[ 82%] Building CXX object MLS400/CMakeFiles/uno_EEPROM.dir/opt/arduino-1.0.5/libraries/EEPROM/EEPROM.cpp.obj
Linking CXX static library libuno_EEPROM.a
[ 82%] Built target uno_EEPROM
Scanning dependencies of target uno_EEPROMEx
[ 86%] Building CXX object MLS400/CMakeFiles/uno_EEPROMEx.dir/__/libraries/EEPROMEx/EEPROMEx.cpp.obj
In file included from /home/blemasle/tmp/workdir/libraries/EEPROMEx/EEPROMEx.cpp:23:
/home/blemasle/tmp/workdir/libraries/EEPROMEx/EEPROMEx.h:23:20: error: EEPROM.h: File or directory not found
make[2]: *** [MLS400/CMakeFiles/uno_EEPROMEx.dir/__/libraries/EEPROMEx/EEPROMEx.cpp.obj] Error 1
make[1]: *** [MLS400/CMakeFiles/uno_EEPROMEx.dir/all] Error 2
make: *** [all] Error 2

Could someone enlight me on how I can achieve this ?
The EEPROMEx library can be found here : http://thijs.elenbaas.net/files/EEPROMEx.0.8.3.zip

Thanks,
blemasle

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions