[CMake] find_file and following links on windows

John Cary cary at txcorp.com
Fri Jun 25 10:08:59 EDT 2010


I have created a simple CMakeLists.txt file:

FIND_FILE(tmp_h tmp.h PATHS /cygwin/home/cary/tmp/tmp1)
MESSAGE("tmp_h = ${tmp_h}"

and inside of tmp1 I have put the file tmp.h.

This works fine.  The output contains


tmp_h = /cygwin/home/cary/tmp/tmp1/tmp.h

Then I create a lnk and rename it

In tmp:

mkshortcut tmp1
mv tmp1.lnk tmp2.lnk

and try



FIND_FILE(tmp_h tmp.h PATHS /cygwin/home/cary/tmp/tmp2)
MESSAGE("tmp_h = ${tmp_h}"

and it fails.

tmp_h = tmp_h-NOTFOUND

Is this expected behavior?  Am I doing something wrong?

Thx....John Cary


More information about the CMake mailing list