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

David Cole david.cole at kitware.com
Wed Jun 2 17:44:52 EDT 2010


Is it 64-bit Windows?
What happens if you put those files in "C:\Windows\SysWOW64"?

The command:
dir /s /b "C:\Windows\kernel32.dll"

will show you that there are actually many kernel32.dlls to be found within
Windows nowadays...


HTH,
David


On Wed, Jun 2, 2010 at 5:18 PM, Scott Fowler <s.fowler at tecplot.com> wrote:

>  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.
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100602/e44bb6ba/attachment.htm>


More information about the CMake mailing list