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

Philip Lowman philip at yhbt.com
Sat Mar 28 09:37:35 PDT 2009


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

> Hi all,
>
>  If I get no opinions I'll just submit a modified CMakeLists.txt that
>> includes /DYNAMICBASE.
>>
>
> OK, perhaps it's a result of my previous message being overly verbose, but
> I got no responses. So I'm now going to do this and submit it.
>
> One question for CMake experts (Philip? Mattias?): is there some way to
> know the exact version of Windows?


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

Only problem is I have no idea how to easily get this information via
CMake.  It appears that CMake only supports reading from the registry as
part of a find_path(), find_library(), etc. command.  This kinda sucks and
should be remedied.

In the meantime, here are a few options:
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
2.  Use CHECK_CXX_SOURCE_RUNS with your own calls to the Windows registry
functions and have it return 0 or 1 depending on if Windows 7 beta is found
3.  Do nothing and leave things the way you have them.

When Windows 7 gold comes out hopefully the bug will be fixed by then.

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


More information about the osg-users mailing list