== Windows build with cmake: == Author: David Burken Last modified: 21 February 2013 '''This page is not complete yet...''' Feedback welcome. Please send to the ossim mailing list at "ossim-developer AT lists.sourceforge.net" and reference this page. Note: Windows command shell commands start with ":\>", unix commands start with $, anything else will be notes, comments. If you see a $ // The part after slash slash is a comment. '''Environment variables'''[[BR]] I put my build environment in a separate file that I source. I do this because I have more than one workspace, i.e. osgeo, geoeye, geoeye-dev. Usually I'll put this in D:\dev directory. Contents of ossim-vs10.bat file:[[BR]] {{{ :: File: ossim-vs10.bat :: Forward slashes for use with cmake and nmake. set OSSIM_DEV_HOME_FS=D:/dev/vs10_x86 :: Backward Slash windows things. We'll use MS for MicroSoft. set OSSIM_DEV_HOME=D:\dev\vs10_x86 set OSSIM_DEPENDENCIES=%OSSIM_DEV_HOME%\local set OSSIM_HOME=%OSSIM_DEV_HOME%\ossim set OSSIM_PREFS_FILE=%OSSIM_DEV_HOME%\ossim-prefs set QTDIR=D:\Qt\4.8.4 set PATH=D:\cmake\cmake-2.8.10.2-win32-x86\bin;%OSSIM_DEV_HOME%\build\bin;%OSSIM_DEV_HOME%\local\bin;C:\Program Files (x86)\XEmacs\XEmacs-21.4.22\i586-pc-win32;%QTDIR%\bin;%PATH% }}} '''Make a workspace:'''[[BR]] // Top level, this is OSSIM_DEV_HOME:[[BR]] D:\> mkdir dev\vs10_x64 [[BR]] // ossim build dir:[[BR]] D:\> cd dev\vs10_x64[[BR]] D:\dev\vs10_x64> mkdir build // Sandbox for 3rd party dependencies:[[BR]] D:\dev\vs10_x64> mkdir deps[[BR]] '''Building'''[[BR]] // Source the bat file for environment variables.[[BR]] D:\> D:\dev\ossim-vs10.bat First time through check out code. Note I don't like to check out the whole trunk so I do pieces. I always build geos, libtiff, geotiff, gdal from the latest. You don't have to, it's up to you. Most of these you can get from yum but I find the code is usually way behind. NOTE: Things I build with cmake I use an "out of source" build so I put in a sub directory of the package. '''geos:'''[[BR]] // Needed by ossim.[[BR]] D:\> mkdir %OSSIM_DEV_HOME%\geos[[BR]] D:\> cd %OSSIM_DEV_HOME%\geos[[BR]] // Get code from svn or optionally download a release.[[BR]] D:\dev\vs10_x64\geos> svn co http://svn.osgeo.org/geos/trunk geos-svn[[BR]] // Make a cmake config script[[BR]] D:\dev\vs10_x64\geos> xemacs geos-cmake-config.bat // Use whatever editor you want, notepad, whatever...[[BR]] // Contents of script:[[BR]] {{{ ::--- :: File: geos-cmake-config.bat ::--- :: Development root dir: set dev=%OSSIM_DEV_HOME_FS% cmake -G "NMake Makefiles" ^ -DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_INSTALL_PREFIX=%dev%/deps ^ ../geos-svn }}} D:\dev\vs10_x64\geos> mkdir build // "out of source" build dir[[BR]] D:\dev\vs10_x64\geos> cd build[[BR]] // Run the cmake command to set up the build system:[[BR]] D:\dev\vs10_x64\geos\build> ..\geos-cmake-config.sh // Make:[[BR]] D:\dev\vs10_x64\geos\build> nmake // Install to sandbox:[[BR]] D:\dev\vs10_x64\geos\build> nmake install // End of GEOS