[CMake] find_file() fails for specific file in C:/Windows/System32 - Why?

Scott Fowler s.fowler at tecplot.com
Wed Jun 2 17:18:05 EDT 2010


I'm using the 'fixup_bundle' capability for generating my installation package, but GetPrerequisites fails for a specific file, which is in C:/Windows/System32.  Other files in C:/Windows/System32 are found just fine.  I've detected that the problem is specifically with the find_file() call.

# Example Code that illustrates the problem
set (myfiles
    kernel32.dll
    mpich2mpi.dll
    testfile.txt  #dummy file I added to System32 for testing purposes.
    )
set (dirs
    "C:/Windows/System32"
    "C:/TEMP"
    )
foreach(file ${myfiles})
  set(rt "rt-NOTFOUND")
  find_file(rt "${file}" ${dirs} NO_DEFAULT_PATH)
  MESSAGE(STATUS "FILE: ${file}; RT: ${rt}")
endforeach(file)

Ouput:
FILE: kernel32.dll; RT: C:/Windows/System32/kernel32.dll
FILE: mpich2mpi.dll; RT: rt-NOTFOUND
FILE: testfile.txt; RT: rt-NOTFOUND

If I copy mpich2mpi.dll and testfile.txt to C:/TEMP, the find_file() call will find the files in C:/TEMP.

So my question is why does find_file NOT find mpich2mpi.dll in System32, but it can find it in C:/TEMP.  Does find_file treat the System32 directory special somehow?  Is there a recommended work around to this issue?

Thanks,
Scott

________________________________
This e-mail and any files transmitted with it are confidential and are intended solely for the use of the individual or entity to whom they are addressed. If you are NOT the intended recipient or the person responsible for delivering the e-mail to the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, forwarding, printing or copying this e-mail is strictly prohibited.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100602/d9e409f1/attachment.htm>


More information about the CMake mailing list