Difference between revisions of "User:Michelle2 Zenovka/cmake"

From Second Life Wiki
Jump to: navigation, search
(Get the source)
Line 63: Line 63:
 
== Get the source ==
 
== 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. cmake has just hit the release branch so it should be in a released zip ball soon.
+
At the time of writing the source is only available via SVN. cmake based viewer builds are in the release branch so it should be in a released zip ball soon and is expected to start shipping with the 1.21 RCs
  
 
Check out the source :-
 
Check out the source :-
Line 69: Line 69:
 
svn co http://svn.secondlife.com/svn/linden/release
 
svn co http://svn.secondlife.com/svn/linden/release
  
Probably the best plan if you do not have an svn client but have installed cygwin, is to go back to the cygwin setup and select the svn tools from the development group. Once these are installed you can checkout svn just like we do on unix.  
+
Probably the best plan on Windowd, if you do not have an svn client but have installed cygwin, is to go back to the cygwin setup and select the svn tools from the development group. Once these are installed you can checkout svn just like we do on unix.  
  
Open a cygwin prompt and run the following commands :-
+
Open a cygwin prompt (or for linux just at your console) and run the following commands :-
 
  cd c:
 
  cd c:
 
  mkdir secondlife
 
  mkdir secondlife
Line 82: Line 82:
 
DON'T FORGET THE ARTWORK!
 
DON'T FORGET THE ARTWORK!
  
If you are running from svn and still in your cygwin prompt the easiest and quickest way to get the artwork is as follows -
+
If you are running from svn and still in your cygwin prompt/console, the easiest and quickest way to get the artwork is as follows -
 
  chmod +x release/doc/assert_urls.txt
 
  chmod +x release/doc/assert_urls.txt
 
  . release/doc/assert_urls.txt
 
  . release/doc/assert_urls.txt
Line 89: Line 89:
 
  cp linden/* release/ -r
 
  cp linden/* release/ -r
  
In the future this section will change to a straight forward download from the usual viewer source location.
+
In the future this section will be supplemented by a straight forward download from the usual viewer source location as well as the option of downloading the latest and greatest direct from svn release branch.
  
 
== Generate the project files ==
 
== Generate the project files ==

Revision as of 04:02, 29 July 2008

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.

As cygwin is required for a couple of operations during the building of the viewer i make use of it for svn access too. If you are more familar with unix/linux then this will feel quite at home to you, if you are use to windows it all looks a bit scary!

Prerequisites

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+ 2007 http://www.microsoft.com/downloads/details.aspx?FamilyId=4B78A58A-E672-4B83-A28E-72B5E93BD60A&displaylang=en]


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


Openssl SDK

Not sure why this is not packaged with the viewer. Probably license issues as OpenSSL can be troublesome WRT licenses and compatibility with other licenses. Some windows packages are available which may be a better solution. Work to do

http://www.openssl.org/


Prerequisites for Linux

For linux you will also need very similar packages to the windows build, but it is highly recommended that you install these via your distributions package management system.

Required packages :-

  • cmake
  • python
  • build-essentials (gcc/ld/make etc)

TODO do a chroot build to find out exactly what is needed as a minimum

Prerequisites for Mac

HELP!

Get the source

At the time of writing the source is only available via SVN. cmake based viewer builds are in the release branch so it should be in a released zip ball soon and is expected to start shipping with the 1.21 RCs

Check out the source :-

svn co http://svn.secondlife.com/svn/linden/release

Probably the best plan on Windowd, if you do not have an svn client but have installed cygwin, is to go back to the cygwin setup and select the svn tools from the development group. Once these are installed you can checkout svn just like we do on unix.

Open a cygwin prompt (or for linux just at your console) and run the following commands :-

cd c:
mkdir secondlife
cd secondlife
svn co http://svn.secondlife.com/svn/linden/release


You no longer need to download the libs tarball/zip file as the develo.py will download the required libraries for you, note you still need the librarys and programs in the initial section of this page installed.

DON'T FORGET THE ARTWORK!

If you are running from svn and still in your cygwin prompt/console, the easiest and quickest way to get the artwork is as follows -

chmod +x release/doc/assert_urls.txt
. release/doc/assert_urls.txt
wget $SLASSET_ART
unzip *.zip
cp linden/* release/ -r

In the future this section will be supplemented by a straight forward download from the usual viewer source location as well as the option of downloading the latest and greatest direct from svn release branch.

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 seems quite possible to stay with in your cygwin prompt and just "cd release/indra" "develo.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

NOTE: This develo.py script now downloads the libraries that were previously in the libs zip file. This saves developers who are tracking release from constantly downloading them every update and only downloads updated libraries. This means on the first run develo.py will take ages download the libs and secondly if you manually want to override libs with older or newer versions it will take some dancing around (feel free to document this).

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.

If you don't have the VSTool.exe issues below, just opening up your Visual Studio c++ will show secondlife at the top of the recent projects, ready for you to open.

Problems

Express editions of Visual C++

Express editions do not have some of the extra features that VSTool.exe requires, VSTool is a little application that sets a few default project options, like which project is the startup and which build configuration to use.