CMakeLists: only link library if Raspberry Pi (or equivalent condition)
I have a package that I want to run on both a desktop/laptop (x64) and a Raspberry Pi (armhf). There's a node in my package that has to be run on the Raspberry Pi. It uses the wiringPi library. Obviously, doing catkin_make
on something other than a RPi results in an error, so at the moment I just comment out those lines.
I'd like to find a way to only execute target_link_libraries()
if the current computer/architecture/distro matches that of the RPi.
@Chris_: this is really a CMake question, and not related to ROS per se (catkin == essentially CMake in this case). I'd advise you to do a (google) search for keywords like "cmake detect architecture" or "cmake detect raspberry pi". You'll probably find a solution much faster that way.
@gvdhoorn yeah I figured it wasn't strictly ROS-related, but I thought I'd see if people went through the same stuff here. Thanks for the suggestion!