[CMake] How to find_file by pattern

David Cole david.cole at kitware.com
Tue Feb 26 13:31:45 EST 2008


Try:
FILE(GLOB OMNIORB_VERSION_FILE "${OMNIORB_ROOT_DIR}/THIS_IS_OMNIORB_*" )


HTH,
David


On 2/26/08, Laurent Humbertclaude <laurent.humbertclaude at gmail.com> wrote:
>
> Hi,
>
> while writing a FindXXX.cmake module,
> I am trying to figure out the version of the library.
> The library use an empty file in the root directory of the source package.
> The file is named THIS_IS_OMNIORB_X_Y_Z without extension
>
> Using a file glob like
>   FILE(GLOB OMNIORB_VERSION_FILE THIS_IS_OMNIORB_* )
> does not works because it looks in the source dir and I haven't found
> a way to specify the base directory
>
> Is there another option than listing every version number I know of ?
>
> FIND_FILE(OMNIORB_VERSION_FILE NAMES
>   THIS_IS_OMNIORB_4_0_5
>   THIS_IS_OMNIORB_4_1_0
>   THIS_IS_OMNIORB_4_1_1
> PATHS
>   ${OMNIORB_ROOT_DIR}
> )
>
> This works but it is far from future proof.
>
> Thanks,
>
> Laurent
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20080226/286646a1/attachment.htm


More information about the CMake mailing list