wiki:BuildingOnWindowsWithCMake

Version 11 (modified by mloskot, 6 years ago) (diff)

Added strk's note

Status Notice

The CMake build configuration is a community-maintained non-officially supported build setup for GEOS. All GEOS users who aim to rely on CMake, please respect Sandro's request stated in comment on ticket #576 :

*** The official build system is the GNU Automake one. Please only file tickets against CMake if willing to provide a patch. ***

Building on Windows with CMake

This article describes how to use CMake build system to build and install GEOS from sources on Microsoft Windows systems using Visual C++ compiler.


Download and install CMake 2.8+. Executables can be downloaded from http://www.cmake.org/cmake/resources/software.html

If you install from zip package, unpack it (eg: into "C:\cmake\") and add the bin directory to the PATH:

SET PATH=c:\cmake\cmake-2.8.2-win32-x86\bin;%PATH%

After this, start command prompt (cmd.exe).

Alternatively, install from the fully-featured Windows installer and select option adding CMake runtime location to PATH environment variable.

In order to create the project with cmake do this: suppose for example the GEOS trunk was downloaded in "C:\geos\trunk" you may create a new folder like "C:\geos\build" enter in "C:\geos\build" and run the command for the compiler you like use:

C:\> cd geos\build
C:\geos\build> cmake -G "Visual Studio 9 2008" C:\geos\trunk

or

C:\geos\build> cmake -G "Visual Studio 9 2008 Win64" ..\trunk

or

C:\geos\build> cmake -G "NMake Makefiles" C:\geos\trunk

with these commands cmake creates a NMAKE makefiles or Visual Studio solution and projects in the folder "C:\geos\build".

Now you are able to build GEOS by loading GEOS.sln in Visual Studio IDE or from command line (use Visual Studio Command Prompt), depending on target CMake generator used in previous steps:

C:\geos\build> nmake /f makefile

or

C:\geos\build> msbuild GEOS.sln

Open Tickets

#878
Static library does not contain C API
#901
cmake is not compiling doc/example
#903
cmake files get compiled twice
#935
incorrect cmake instruction