[CMake] find_file/find_path recursive
Pablo Yanez Trujillo
shaoran at sakuranohana.org
Thu Sep 24 06:36:10 EDT 2009
Hi
I've already read the online documentation but I don't find anything
about it. I'm want to use 'find_path'. I only have the installation
prefix of a project and I would want to search recursively in this
directory. I've thought of something like that:
set(ABC_INSTALL_PREFIX "" CACHE PATH "Install Prefix of abc project")
find_path(ABC_PACKAGE_FILE abc-config.cmake PATHS ${ABC_INSTALL_PREFIX}
NO_DEFAULT_PATH)
if(NOT ${ABC_PACKAGE_FILE})
message(FATAL_ERROR "Could not find abc-config.cmake. Set
ABC_INSTALL_PREFIX properly.")
endif()
set(abc_DIR ${ABC_PACKAGE_FILE})
find_package(abc)
but this only works when the abc-config.cmake file is stored in
${ABC_INSTALL_PREFIX}. This is not the case, hence I would want to
search for it recursively in ${ABC_INSTALL_PREFIX}, but I don't know how
to manage it.
Is it actually posible to search recursively with find_path?
Pablo
--
Pablo Yanez Trujillo
OpenPGP Key: http://www.sakuranohana.org/gpg/shaoran.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090924/e7f36239/attachment.pgp>
More information about the CMake
mailing list