User:Michelle2 Zenovka/cmake

From Second Life Wiki
Jump to navigation Jump to search

How to build the viewer with cmake

This page represents some notes of mine for building the viewer via cmake. The process under linux is trivial but under windows it is slightly more involved (but not really that bad at all). If you've only ever been used to starting with a Visual Studio project file then the cmake steps may seem a little strange at first but its a great system for ensuring that radically different build environments start from the same "control" files.


Prerequisites for windows

  • cmake (well duh!)
  • Python
  • bison and flex (from cygwin)
  • DirectX SDK (Microsoft DirectX SDK (November 2007))
  • Quicktime SDK
  • openssl SDK


Get cmake from http://www.cmake.org/HTML/Download.html Download and install the setup executable


Get python from http://www.python.org

When installing cmake and python, its important to allow the commands to be addded to the system path. Both installers give an option for this towards the end of the installation. (On my system i needed to select for current user only as for all users (silently) failed to work).


Get cygwin from http://www.cygwin.com/

When you get to the package choice make sure you select bison and flex, they are under development tools.


Get DirectX SDK November 2007 from Microsoft Warning 400MB+


Get Quicktime SDK from Apple http://developer.apple.com/quicktime/download/


Openssl SDK

Not sure why this is not packaged with the viewer, need to verifiy and or file a JIRA. Some windows packages are avaiable which may be a better solution. Work to do

http://www.openssl.org/

Get the source

At the time of writing the source is only available via SVN. This may be a problem for windows users and the best plan is to look for a windows SVN client OR install the svn tools in cygwin. The most recent cmake test is cmake-8

Check out the source :-

svn co http://svn.secondlife.com/svn/linden/branches/cmake-8

After getting the source, look at the file linden/doc/assert_urls.txt to find the location of the current libs and artwork packages to support this build. Download these files and unpack them on top of the source.

In the future this section will change to a straight forward download from the usual viewer source location.

Generate the project files

This is where the real fun and grace of cmake starts to take shape. Open a terminal window and go to the folder with the viewer source code. Enter the folder linden/indra/ now run the develop.py script. Probably on windows if python installed correctly you can just type "develop.py".

it may be necessary to add a -G option which selects which version of visual studio to target, possible options are :-

  • VC71
  • VC2003 (default)
  • VC80 (VS2005)
  • VC90 (VS2008)

for example

develop.py -G VC90

will generate project files for Visual C++ 2008

Add some missing files

There are currently glh-include files missing from the source distribution (this is fixed in 1.19.1.X branch aka windlight but not cmake yet). You should be able to grab them here or download a patch from the JIRA. The files need to go into linden/libraries/include/glh/*.h

Build the viewer

Now the previous cmake process will have generated some Visual Studio files for you under linden/indra/build-vc71 (in fact the exact path name depends on which visual studio you have files generated for). Just open the solution file .sln in that folder and build the solution in the standard way.

Problems

Currently build is not working, issues being tracked as sub tasks of VWR-2871