wiki:BuildingOnMINGW64CMake

Version 1 (modified by robe, 5 years ago) (diff)

--

Building on Windows with CMake and mingw64 chain

* this is still a work in progress

You can use the regular CMake 32-bit binaries to build 64-bit and just extract somewhere: http://cmake.org/cmake/resources/software.html (I used the zip file http://www.cmake.org/files/v2.8/cmake-2.8.10-win32-x86.zip and extracted to folder

latest now is http://www.cmake.org/files/v2.8/cmake-2.8.11-win32-x86.zip which should work fine and probably better and just extracted into folder C:\ming64\cmake-2.8.10.2-win32-x86 )

Configure

Building from SVN development branch requires to generate the geos_svn_revision.h file with POSIX shell script:

tools\svn_repo_revision.sh
## NOTE: for this I had to use some suggestions 
## from http://osgeo-org.1560.x6.nabble.com/Compiling-geos-with-mingw64-td5034567.html which are not committed yet
## I was also using the mingw64 pre-compiled build - http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/rubenvb/gcc-4.8-release/
( x86_64-w64-mingw32-gcc-4.8.0-win64_rubenvb.7z )

export PATH=".:/bin:/include:/mingw/bin:/mingw/include:/c/Windows/system32:/c/Windows:/usr/local/bin:/c/ming64/cmake-2.8.10.2-win32-x86/bin"
export PROJECTS=/c/ming64/projects
cd geos/geos-3.4
export GEOS_VER=3.4.0dev
tools/svn_repo_revision.sh
rm -rf build/mingw
mkdir -p build/mingw
cd build/mingw
cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=${PROJECTS}/geos/rel-${GEOS_VER}w${OS_BUILD} -DHAVE_STD_ISNAN=1 -DHAVE_LONG_LONG_INT_64=1 -DGEOS_ENABLE_INLINE=ON  -DGEOS_ENABLE_TESTS=ON  ../../
make
make test
make check
make install

strip ${PROJECTS}/geos/rel-${GEOS_VER}w${OS_BUILD}/bin/*.dll

Output of tests should look something like

Running tests...
Test project C:/ming64/projects/geos/branches/geos-3.4/build/mingw
    Start 1: geos_unit
1/4 Test #1: geos_unit ........................   Passed    0.19 sec
    Start 2: xmltester
2/4 Test #2: xmltester ........................   Passed    6.72 sec
    Start 3: bug234
3/4 Test #3: bug234 ...........................   Passed    0.01 sec
    Start 4: TestSweepLineSpeed
4/4 Test #4: TestSweepLineSpeed ...............   Passed    1.79 sec

100% tests passed, 0 tests failed out of 4

Total Test time (real) =   8.73 sec
Scanning dependencies of target check
Test project C:/ming64/projects/geos/branches/geos-3.4/build/mingw
    Start 1: geos_unit
1/4 Test #1: geos_unit ........................   Passed    0.14 sec
    Start 2: xmltester
2/4 Test #2: xmltester ........................   Passed    6.69 sec
    Start 3: bug234
3/4 Test #3: bug234 ...........................   Passed    0.01 sec
    Start 4: TestSweepLineSpeed
4/4 Test #4: TestSweepLineSpeed ...............   Passed    1.78 sec

100% tests passed, 0 tests failed out of 4

Total Test time (real) =   8.63 sec
Built target check

Open Tickets

#632
CMake builds should automatically generate a geos-config
#878
Static library does not contain C API