Akos Balazs wrote:
> Hi Marcus,
>
> On Mon, 21 May 2007, Marcus Lindblom wrote:
>   
>>
>> The most supported method to build OpenSG is scons. The VS proj files
>> aren't always updated (only with major release points), so the best way
>> would probably be to launch opensg's scons from cmake, which ought to be
>> quite simple, no? (scons is included in OpenSG's svn-tree so you need
>> not worry about a separate installation).
>>     
>
> I think you misunderstood the mail a bit, we don't want to build OpenSG 
> itself via cmake (the binary dailybuild or even building with scons is 
> just fine by us) but applications that use OpenSG. AFAICS the recommended 
> way of building Windows apps that use OpenSG currently is taking the 
> workspace files of one of the tutorials and removing the tutorial sources 
> and adding your own. This is, err, somewhat suboptimal, especially if you 
> want to build your app on different platforms -- that's why we thought 
> cmake could be used here.
>   
Right.  Sorry about that. :)

Well, that shouldn't be a problem. We use OpenSG on Windows and what 
I've done is to pust most of the required defined in my precompiled 
header (that also include some basic OpenSG-files). That reduces the 
amount of configuration & parametrisation of build-files/projects down 
to zero.

This is what have in my project that uses OpenSG dlls in windows. The 
project file itself has almost nothing specific in it's config (it's a 
plain win32-dll build file, so you ought to be ok with the cmake 
defaults as well.)

// basic stuff

#define _WIN32_WINNT 0x0501 // require Windows XP or better
#define WINVER 0x0501

#define WIN32_LEAN_AND_MEAN
#include "windows.h"

#ifndef snprintf
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#endif

#include <GL/GL.h>

// very useful .. :)
#define for if(false) {} else for

/////////// OpenSG 
//////////////////////////////////////////////////////////

#pragma warning(disable : 4231)
#pragma warning(push, 1)
#pragma warning(disable : 4275 4267 4244 4231)

#define _OSG_HAVE_CONFIGURED_H_
#define OSG_BUILD_DLL
#define OSG_WITH_GLUT
#define OSG_WITH_GIF
#define OSG_WITH_TIF
#define OSG_WITH_JPG
#define OSG_WITH_PNG

#ifndef htonl
 // OpenSG includes "windows.h" to get htonl and related functions
 // but it is excluded when WIN32_LEAN_AND_MEAN is defined.
 #include "winsock2.h"
#endif

#include <OpenSG/OSGConfig.h>

#include <OpenSG/OSGCamera.h>
...
>   
>> Also, I don't know if scons supports cross-compiling, at all or as well 
>> as cmake. (We might only need some configuration in OpenSG's 
>> scons-scripts to support it.)
>>     
> We don't want to cross-compile, we just want to build on different 
> platforms from a common source tree (and preferably with one buildsystem, 
> which would be cmake. :)
>   
No problem. Just do what you do for any third-party library. The above 
stuff should help you a bit.

Does this make more sense? :)

Cheers,
/Marcus

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to