OznOg
OznOg

Reputation: 4732

tell if a directory exists in one of the prefixes

I'm trying to find a way to detect if a directory exists in one of the CMAKE prefix.

I am integrating a recipe in yocto, and a program tries to check is a directory exists to activate or not a feature.

The problem is that it looks for a path like /usr/include/somelib, but this does not exist on the system, but exists in the build/tmp/work/corei7-64-rdos-linux/MyApp/git/recipe-sysroot.

When working with standard libraries, this works fine because cmake is able to search for things relative to the CMAKE_PREFIX_PATH or CMAKE_SYSTEM_PREFIX_PATH using the Config.cmake files.

The function find_path works well with files (it crawls the prefixes), but does not accept a path (with /).

Is there a way to do that with cmake?

Upvotes: 0

Views: 33

Answers (0)

Related Questions