diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-01-15 15:15:04 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-01-15 22:42:38 +0100 |
| commit | 6733048be431f5e89bd956d89c3e3283deac291b (patch) | |
| tree | e9adcb1da746f742f0023c0b83ed884e037acfa0 /docs | |
| parent | d76e6202d27c730b4dcbf16b8c1575c11b703485 (diff) | |
| download | PROJ-6733048be431f5e89bd956d89c3e3283deac291b.tar.gz PROJ-6733048be431f5e89bd956d89c3e3283deac291b.zip | |
Doc: add in install.rst tutorials to build on Windows
Fixes #1776
Content based on https://github.com/OSGeo/PROJ/wiki/Building-with-VS-and-vcpkg
which should be retired to avoid duplication of information
README.md is also modified to point to install.rst
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/source/install.rst | 125 |
1 files changed, 125 insertions, 0 deletions
diff --git a/docs/source/install.rst b/docs/source/install.rst index 1a055b4c..4e09a4b3 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -141,6 +141,8 @@ Build requirements - C99 compiler - C++11 compiler - SQLite3 >= 3.11 (headers, library and executable) +- libtiff >= 4.0 (headers and library) +- optional (but recommended): curl >= 7.29.0 - GNU make for autotools build or CMake >= 3.5 Autotools @@ -231,3 +233,126 @@ Tests are run with:: The test suite requires that the proj-datumgrid package is installed in :envvar:`PROJ_LIB`. + + +Building on Windows with vcpkg and Visual Studio 2017 or 2019 +-------------------------------------------------------------------------------- + +This method is the preferred one to generate Debug and Release builds. + +Install git ++++++++++++ + +Install `git <https://git-scm.com/download/win>`_ + +Install Vcpkg ++++++++++++++ + +Assuming there is a c:\\dev directory + +:: + + cd c:\dev + git clone https://github.com/Microsoft/vcpkg.git + + cd vcpkg + .\bootstrap-vcpkg.bat + +Install PROJ dependencies ++++++++++++++++++++++++++ + +:: + + vcpkg.exe install sqlite3[core,tool]:x86-windows tiff:x86-windows curl:x86-windows + vcpkg.exe install sqlite3[core,tool]:x64-windows tiff:x64-windows curl:x64-windows + +.. note:: The tiff and curl dependencies are only needed since PROJ 7.0 + +Checkout PROJ sources ++++++++++++++++++++++ + +:: + + cd c:\dev + git clone https://github.com/OSGeo/PROJ.git + +Build PROJ +++++++++++ + +:: + + cd c:\dev\PROJ + mkdir build_vs2019 + cd build_vs2019 + cmake -DCMAKE_TOOLCHAIN_FILE=C:\dev\vcpkg\scripts\buildsystems\vcpkg.cmake .. + cmake --build . --config Debug -j 8 + + +Run PROJ tests +++++++++++++++ + +:: + + cd c:\dev\PROJ\build_vs2019 + ctest -V --build-config Debug + + +Building on Windows with Conda dependencies and Visual Studio 2017 or 2019 +-------------------------------------------------------------------------------- + +Variant of the above method but using Conda for SQLite3, TIFF and CURL dependencies. +It is less appropriate for Debug builds of PROJ than the method based on vcpkg. + +Install git ++++++++++++ + +Install `git <https://git-scm.com/download/win>`_ + +Install miniconda ++++++++++++++++++ + +Install `miniconda <https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe>`_ + +Install PROJ dependencies ++++++++++++++++++++++++++ + +Start a Conda enabled console and assuming there is a c:\\dev directory + +:: + + cd c:\dev + conda create --name proj + conda activate proj + conda install sqlite libtiff curl cmake + +.. note:: The libtiff and curl dependencies are only needed since PROJ 7.0 + +Checkout PROJ sources ++++++++++++++++++++++ + +:: + + cd c:\dev + git clone https://github.com/OSGeo/PROJ.git + +Build PROJ +++++++++++ + +From a Conda enabled console + +:: + + conda activate proj + cd c:\dev\PROJ + call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" + cmake -S . -B _build.vs2019 -DCMAKE_LIBRARY_PATH:FILEPATH="%CONDA_PREFIX%/Library/lib" -DCMAKE_INCLUDE_PATH:FILEPATH="%CONDA_PREFIX%/Library/include" + cmake --build _build.vs2019 --config Release -j 8 + +Run PROJ tests +++++++++++++++ + +:: + + cd c:\dev\PROJ + cd _build.vs2019 + ctest -V --build-config Release |
