[osg-users] Windows 7 beta: "The binary is not a valid Windows image."
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
> 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.
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the osg-users