arduino-cmake / Arduino-CMake-NG

CMake-Based framework for Arduino platforms
MIT License
138 stars 39 forks source link

Install for library depending on platform #80

Closed RobinMaub closed 5 years ago

RobinMaub commented 5 years ago

Hello,

I would create a library (let's say libArduino) using SD and Servo, and link to this lib in a separated executable, but I get the following error CMake Error: install(EXPORT "libarduino-targets" ...) includes target "libarduino" which requires target "servoLib" that is not in the export set.

how can I add to the export set the required files ?

Thanks,

MrPointer commented 5 years ago

@RobinMaub Hi there and sorry for the delay, could you please attach your CMakeLists.txt file?

RobinMaub commented 5 years ago

@MrPointer Hello, no problem. Yes sure, attached : CMakeLists.txt

My goal is to get something like :

  1. libarduino (a library) links to Servo or SPI or something like that
  2. an arduino executable links to libarduino and is able to use Servo or SPI through it.

Many thanks for the help.

MrPointer commented 5 years ago

Oh I see, it looks like you're using the master branch, although it's NOT designed for users! For that, you have our releases, where you can find all stable (to a certain degree) versions. Note that your current CMakeLists.txt file will need to change due to this transition, since the current master branch introduced many API changes - To understand exactly how the API should be used with the latest release, please see our docs.

RobinMaub commented 5 years ago

Ahh My bad...

Can you tell me if the thin I am looking for will be working with my CMakeList ?

Thanks

MrPointer commented 5 years ago

Yes of course, what your'e trying to achieve is a very common pattern in Arduino-CMake. The only thing I'm not sure of (and haven't been since your original comment) is the install part - I don't know what do you intend to use it for, but personally I've never seen any use of it in the Arduino-CMake framework.

RobinMaub commented 5 years ago

Ok many thanks !