How can I build OpenSceneGraph from source? What should I do to get the third party dependencies for OSG built?
This is just an initial guide which will get basic OSG installed on your system. There are many other configuration changes and compilation with dependencies that you can do later (building third party libraries is specified after the first long dotted line).
For the sake of uniformity, you can use these environment variables:
OSG_ROOT for specifying the location of the build folder
OSG_FILE_PATH for specifying the location of the sample models and images (The folder which you extract from OpenSceneGraph–Data–3.0.0.zip)
OSG_SOURCE for specifying the location of the source files which you just extracted from the zip file.
(Except for OSG_SOURCE, the rest were taken from the OSG tutorial/guide pdf's)
.....................................................................
Building third party libraries:
–––––––––––––––––––––––––––––––
Whether you've already done the above build process or not, you can reconfigure CMake to be able to build the third party libraries.
If you followed the above procedure, you might remember in the configuration process, it showed "Could not find libcurl" etc.
Now you're gonna show CMake where to find it.
Lets say you're configuring for the curl library.
* Click 'configure' in CMake and in the CMake gui, you'll find that the CMake gui has a search field. Search for 'curl' and it'll show you two parameters to be set for curl. Replace the right side parameters (which will be something like CURL–INCLUDE–NOT–FOUND), to the include path of your third party library where curl's header is located.
* Same way, for what would be something like CURL–LIB–NOT–FOUND, replace it with the path to the lib file and at the end of the path, type the name of the lib file too. Eg: F:\ProgramFiles\OSG\ThirdPartyLibraries\debug_vc10_x86\lib\curllib.lib
* Do a similar thing for other libraries like TIFF, ZLIB, PNG etc.
* Once you're done with all of them, click 'Configure' and then 'Generate'.
* Go to your OSG build folder, find OpenSceneGraph.sln and build it as I've mentioned above.
* That's it!
More info on building third party libraries is in: http://binglongx.wordpress.com/2011/07/27/building–openscenegraph–3–0–0–from–source–for–both–x86–and–x64/