CMake x64 bit option for OsgWorks and OsgBullet

141 views
Skip to first unread message

David Cofer

unread,
Feb 25, 2014, 6:03:51 PM2/25/14
to osgwork...@googlegroups.com
I am trying to generate a 64 bit build for Visual studio 2010 for OsgWorks and OsgBullet using CMake. In OsgWorks I see a number of Cmake params that have 32 in them, for example, CMAKE_CXX_FLAGS has /DWIN32, and CMAKE_EXE_LINKER_FLAGS has /machine:X86. Do I need to change all those settings by hand or is there some flag somewhere I am missing that will tell it to flip to 64 bit and change it in all the required places. I assumed that there should be a single flag somewhere, but if so then I am not seeing what flag it is that I should be changing to make everything correspond with a 64 bit build. If I have to change all params related to 64 bits then can someone tell me exactly which ones need to be changed and what the new settings should be so I do not miss any?

Thanks

Paul Martz

unread,
Feb 25, 2014, 8:51:02 PM2/25/14
to osgwork...@googlegroups.com
Hi David -- It sounds like you told CMake to use the wrong generator.

It sounds like you're using Visual Studio. If you're using cmake-gui, then the first time you run CMake to create your project files, you should get a dialog to select the generator. You want something like "Visual Studio 11 Win64".as opposed to "Visual Studio 11" (which would give you a 32-bit build).

If you are running cmake.exe from the command line, then just running that command with no options should give you the help text, which contains a list of available generators. And you'd specify that on the command line like so:
    cmake.exe -G"Visual Studio 11 Win64"

If you're building NMake makefiles, you should run this command:
    cmake.exe -G"NMake Makefiles"
But whether you get a 32- or 64-bit build depends on the VS command tools in your path. So you'd want to run cmake from within a VS x64 command shell prompt.

As a side note, selecting the generator for osgWorks/osgBullet is no different from how you'd do that for your OSG and Bullet builds. That makes me wonder: Are you using OSG and Bullet prebuilt binaries that you obtained from somewhere? If so, I have to worry a little about compatibility. You'll need to use the same version of Visual Studio as was used to build your OSG and Bullet binaries. People have ran into problems with this in the past, and I have always built all four projects from source to avoid compatibility issues. The only prebuilts I uses are the AlphaPixel 3rd party dependencies.

Please feel free to post again if you have other questions.


On Tue, Feb 25, 2014 at 4:03 PM, David Cofer <davidc...@gmail.com> wrote:
I am trying to generate a 64 bit build for Visual studio 2010 for OsgWorks and OsgBullet using CMake. In OsgWorks I see a number of Cmake params that have 32 in them, for example, CMAKE_CXX_FLAGS has /DWIN32, and CMAKE_EXE_LINKER_FLAGS has /machine:X86. Do I need to change all those settings by hand or is there some flag somewhere I am missing that will tell it to flip to 64 bit and change it in all the required places. I assumed that there should be a single flag somewhere, but if so then I am not seeing what flag it is that I should be changing to make everything correspond with a 64 bit build. If I have to change all params related to 64 bits then can someone tell me exactly which ones need to be changed and what the new settings should be so I do not miss any?

Thanks

--
You received this message because you are subscribed to the Google Groups "osgworks-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osgworks-user...@googlegroups.com.
To post to this group, send email to osgwork...@googlegroups.com.
Visit this group at http://groups.google.com/group/osgworks-users.
For more options, visit https://groups.google.com/groups/opt_out.



--
   -Paul

Reply all
Reply to author
Forward
0 new messages