Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use a regular expression for CMake find_path hints

Using CMake's find_path, I'm actualy searching some file in the /usr/share/arduino folder, with a very simple find_path:

find_path(ARDUINO_SDK_PATH
      NAMES lib/version.txt hardware libraries
      PATH_SUFFIXES share/arduino
      DOC "Arduino Development Kit path.")

The problem is that it seems on some distributions (for example, Gentoo), the Arduino SDK is packaged, and installed in /usr/share/arduino-version. In fact, I try to search in all the folders beginning with "arduino", in /usr/share. I tried to add a * at the end of the PATH_SUFFIXES, but that's not working.

What should I do to make it work?

like image 365
Marc Plano-Lesay Avatar asked Oct 26 '25 11:10

Marc Plano-Lesay


1 Answers

Take a look at file(GLOB ...) command.

like image 96
arrowd Avatar answered Oct 28 '25 00:10

arrowd



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!