[osg-users] Windows 7 beta: "The binary is not a valid Windows image."

Philip Lowman philip at yhbt.com
Sat Mar 28 23:01:18 PDT 2009


On Sat, Mar 28, 2009 at 11:24 PM, Jean-Sébastien Guay <
jean-sebastien.guay at cm-labs.com> wrote:

> Hi Philip,
>
> Thanks for your insight.
>
>  You might be able to use the ProductName, CDSVersion, CurrentVersion,
>> and/or CurrentBuildNumber fields in the following part of the registry to
>> determine if you're building on the Windows 7 Beta.
>>
>> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
>>
>
> OK, seems ProductName contains "Windows 7 Ultimate" so using a test such as
> "contains 'Windows 7'" should work.
>
>  1.  Use the output of "reg query" in an execute_process() cmake command
>> (or something similar)
>>    reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion" /v
>> CurrentBuildNumber
>>
>
> Using execute_process(), will CMake return the resulting string? If so, can
> I then do a pattern match (like a regex) on that string?


Yes, there is an option to execute_process() that will return the output as
a string.  See the CMake documentation.
http://www.cmake.org/cmake/help/cmake2.6docs.html#command:execute_process

You can use the STRING(REGEX REPLACE...) command in conjunction with ( ) to
extract strings.  See the FAQ below as well as the CMake manual for
details.  You should be able to find plenty of examples using Google.
Beware escaping regular expressions in CMake is a bit weird.

http://vtk.org/Wiki/CMake_FAQ#Which_regular_expressions_are_supported_by_CMake.3F

-- 
Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20090329/6bb1754e/attachment-0003.htm>


More information about the osg-users mailing list