BuildWindowsGisinternals - Maproom/qmapshack GitHub Wiki

Prev (GDAL support for additional map formats) | Home | Manual | Index | (Ubuntu-14.04) Next


Table of contents


Build QMapShack for Windows using GISInternals

This page describes a more or less complete build process for QMapShack (QMS) using GISInternals.

Introduction

A build procedure for QMapShack and QMapTool (QMS) on Windows is described here and here. Using this procedure, all packages on which QMS depends (GDAL, proj, zlib, ...) must be built individually from their sources (assuming that a suitable precompiled package is not available). If additional GDAL plugins (e.g. for the ECW format) are to be used in QMS, separate build steps are required for these plugins. The user must ensure that all required packages (including Qt6 and optional GDAL plugins) are built with compatible compiler versions. Depending on the GDAL version and the GDAL build configuration, building the plugins using this procedure may fail for various reasons.

This page describes a QMS build procedure for Windows based on a complete and precompiled GDAL build environment package provided by GISInternals. This procedure has several advantages over the one just mentioned:

  • GISInternals packages are provided for different versions of Microsoft Visual Studio (MSVC).

  • GISInternals packages are provided for different GDAL versions.

  • GISInternals packages support many GDAL plugins, including those for the widely used ECW, MrSID, PDF, KMZ, OZIExplorer, and other raster map plugins (main reason for using GISInternals).

  • GISInternals packages provide precompiled library and header files for all GDAL dependencies and plugins. This implies that there is no need to download Hexagon ERDAS ECW/JP2 SDK or other sources.

  • GISInternals packages provide all necessary DLL files. Build/compile steps for GISInternals packages are not required. Remark: Building one of the GISInternals packages would require the preliminary download of the sources of some of the dependency packages and/or adjusted settings in the GISInternals makefile, and is not recommended.

  • All QMS dependencies except for Qt6, Routino, and Quazip are also dependencies of GDAL and are therefore available in precompiled form. Remark: Use the Dependency Walker to identify these dependencies.

  • Only the Routino and Quazip dependencies of QMS for which no precompiled build environments are available have to be built separately. This greatly reduces the number of build/compiler runs required before building QMS itself.

    Routino doesn't depend on any of the GDAL dependencies.

    Quazip depends on zlib, which is also a GDAL dependency.

  • All individual packages within a GISInternals package are built with the same compiler version. Runtime libraries compiled with MSVC 2015 or later versions of the compiler are binary-compatible. This gives some freedom in choosing the MSVC version as well as the Qt6, the GISInternals, and other package versions. To meet the compiler compatibility requirements, QMS should be compiled with the latest MSVC version and the latest redistributable version possible.

A disadvantage of this approach is that the user is bound to the software versions chosen by GISInternals.

The build process described on this page is completely script-driven. The Visual Studio (MSVC) GUI is not used in the build process. But all configuration can be immediately transferred to the MSVC GUI.

Overview of required and used software

Software packages used by QMS

QMS depends on the following software:

  • Qt6
  • MySQL (if databases of this type are used in QMS)
  • GISInternals
  • Routino
  • Quazip
  • BRouter (optional, not discussed on this page)
  • Java (if BRouter is used in QMS)

Software tools used in the QMS build process

(This page does not go into detail about all of the software listed. Some software is used only in the deploy process not discussed on this page.)

  • Microsoft Visual Studio (MSVC)
  • MSYS2
  • Git
  • NSIS
  • ResourceHacker
  • Python (used with modules papermill, markdown, jupyterlab, ...)
  • Dependency walker
  • sigcheck (find version numbers of some files)
  • Text editor (with UTF-8 support)

Directory structure for software

The following discussion of the QMS build process assumes a fixed directory hierarchy below a user-defined root directory for the QMS software dependencies as shown in the following graph:

images/qmsdirstruct.png

(All shown version numbers are just examples!)

Get required packages

  1. Install, if not yet done, Microsoft Visual Studio (MSVC) 2026 or later (or update to this version if MSVC is already installed). Compiling QMS with this MSVC version ensures compatibility with dependency packages compiled with earlier MSVC versions (up to 2015):

    1. Open https://visualstudio.microsoft.com/downloads
    2. Download from this page the free-of-charge Visual Studio 2026 Community Edition installer.
    3. Run the downloaded Visual Studio installer. Selecting the package for desktop development with C++ is sufficient.
  2. Install, if not yet done, the latest Microsoft Visual C++ Redistributable (this package is part of MSVC, too!).

  3. Install, if not yet done, a Qt6 version for one of the compatible MSVC versions (example: Qt 6.10.0 or newer).

    1. Download the Qt6 online installer for open source use for Windows x64 from https://www.qt.io/development/download-qt-installer-oss

    2. Launch the downloaded online installer

    3. Register, if not yet done

    4. Follow the next steps

    5. Select user-defined installation

    6. Open the Qt branch

    7. Select a Qt version with an MSVC branch compatible with the installed MSVC version (e.g. Qt 6.10.1 - MSVC 2022 64-bit

    8. Select at least the following additional libraries for the selected Qt version:

      • Qt 5 Compatibility Module
      • Qt Image Formats
      • Qt Positioning
      • Qt Serial Port
      • Qt WebChannel
    9. From the extensions branch, select Qt WebEngine for the selected Qt and MSVC versions

    10. Follow the next steps to download the selected components (this includes the necessary library and header files)

    11. Check the installed libraries by looking at the XML part of the output of the command

      maintenancetool list
      

      XML part of output:

      <?xml version="1.0"?>
      <localpackages>
          ...
          <package name="extensions.qtwebengine" displayname="Qt WebEngine" version="1.0.1-202503311052"/>
          ...
          <package name="qt.qt6.6100.addons.qt5compat.win64_msvc2022_64" displayname="Qt 5 Compatibility module for MSVC 2022 64-bit" version="6.10.0-0-202510021201"/>
          ...
      </localpackages>
      

      For more information compare the Qt6 documentation.

    12. Check for library updates by looking at the XML part of the output of the command

      maintenancetool.exe check-updates
      

      XML part of output:

      <?xml version="1.0"?>
      <updates>
          ...
          <update name="Qt WebEngine" version="10.0.0-202512021138" size="0" id="extensions.qtwebengine"/>
          ...
      </updates>        
      
  4. If a MySQL database is to be used in QMS: Install Qt6 MySQL driver/plugin (Qt6 doesn't provide this driver anymore):

    1. Download MySQL binaries from https://github.com/thecodemonkey86/qt_mysql_driver/releases
      1. Select QMYSQL driver 6.10.0 (the installed Qt6 version)

      2. Download qsqlmysql.dll_Qt_SQL_driver_6.10.0_MSVC2022_64-bit.zip and unpack it.

        The optimal location of the file sqldrivers\qsqlmysql.dll of the ZIP package would be the 6.10.0\msvc2022_64\plugins\sqldrivers subdirectory of the Qt6 installation directory. To avoid cluttering of the Qt installation directory, the ZIP file should be unpacked to the mysql\<qt_version> subdirectory of the QMS base directory (e.g. d:\QtProjects\QMS\mysql\6.10.0 - the mysql driver depends on the Qt version!). Remark: The compilation of MySQL is described in https://doc.qt.io/qt-6/sql-driver.html.

    Remark: The lib*.dll files in the downloaded zip file are part of the GISInternals package, too. Thus, only the files in the sqldrivers subdirectory have to be added to the final QMS distribution sqldrivers subdirectory.

  5. Download the Quazip sources and unpack them.

  6. If not yet done so, install the MinGW-w64/MSYS2 package:

    1. Download the MSYS2 installer (currently: msys2-x86_64-20251213.exe, alternative download from GitHub)
    2. Run the MSYS2 installer.
    3. Use the MSYS2 UCRT64 command prompt window (open from the Start menu after MSYS2 installation) to install some additional packages:
      1. Install gcc: pacman -S mingw-w64-ucrt-x86_64-gcc
      2. Install make: pacman -S make
      3. Install bzip2: pacman -S mingw-w64-ucrt-x86_64-bzip2
    4. For updating MSYS2, follow these instructions.
  7. Download the latest Routino version from https://www.routino.org/download and unpack it to C:\msys64\home\currentUser.

  8. Goto the GISInternals Development Kits page

    1. Select an MSVC version for the x64 architecture compatible with the installed MSVC version.
    2. Click the corresponding development release package (example: release-1930-x64-dev) and download its ZIP file.
    3. Unpack the downloaded ZIP file. To avoid DLL version conflicts delete the files .\release-1930-x64\bin\proj_?_?.dll with the exception of the newest/latest one.

    Remarks:

    • In this GISInternals link, the latest available GDAL version is used. Its version number can be found in the file .\release-1930-x64\doc\gdal_version.txt.
    • Other GDAL versions can be found when starting from GISInternals stable or other branches.
    • The versions of additional dependency packages contained in GISInternals and their download locations can be found near the end of the file config.opt in the GISInternals root directory or in the file release-1930-x64\doc\gdal_deps.txt.
    • A list of supported GDAL formats can be found in the file .\release-1930-x64\doc\gdal_formats.txt.
  9. Download the QMS sources from https://github.com/Maproom/qmapshack (depending on the used download method: git and some experience in using it can be useful).

Build QMS

  1. Build the Routino library:

    1. Open the MSYS2 UCRT64 console from the Windows program menu
    2. Change to the root directory of the unpacked Routino sources (use POSIX notation, i.e. slashes instead of backslashes)
    3. Run make clean
    4. Run make
  2. The following steps are based on the use of the CMake command-line tool. Use the Visual Studio 18 2026 generator for the x64 architecture to compile Quazip and QMS with the CMake build system (alternative: use the Ninja generator). All CMake configuration parameter settings have to be saved in configuration files. The information given in these configuration files can easily be applied when working with the CMake-gui. Examples of these files are shown in subsection "Configuration examples" of this page. Parameters shown there are used by the author of this page when building (and deploying) QMS. Configuration entries are separated into two files:

    1. QMSUserSettings.cfg: This configuration file contains all user-dependent settings (e.g. directory names or software version numbers).
    2. QMSSettings.cfg: This configuration file contains general settings and some settings derived from the contents of QMSUserSettings.cfg.

    Remarks:

    • Not all parameters of these configuration files are used in the CMake runs described later on this page. Some of them are used elsewhere by the author of this page.
    • The configuration files should be located in the msvc_64\scripts directory.
    • Examples of the configuration files are shown in subsection "Configuration examples".
  3. Update all settings in QMSUserSettings.cfg.

  4. Check if the paths used for GISInternals and Qt6 in QMSSettings.cfg match your directory structure. If not, adjust the paths properly.

  5. Build the Quazip library (without BZip2). Quazip depends on zlib, which should be taken from the GISInternals package using its DLL filename convention.

    1. Open the MSVC x64 Native Tools Command Prompt from the Windows start menu.
    2. Change to the Quazip root directory (the one where the Quazip sources are unpacked)
    3. Run md build
    4. Run cd build
    5. Run
    cmake --fresh -G "Visual Studio 18 2026" -A x64 -S .. -B . -L -DUPDATE_TRANSLATIONS=OFF \
                 -C <path_to_scripts>/QMSUserSettings.cfg \
                 -C <path_to_scripts>/QMSUserSettings.cfg
    
    1. Check that the configuration and generation of the build system have been correct (look for output lines -- Configuring done and -- Generating done and check all displayed variable values)
    2. Run cmake --build . --config Release -j8
    3. Run cmake --build . --config Release -j8 --target install
  6. Build QMS.

    1. Open the MSVC x64 Native Tools Command Prompt from the Windows start menu.
    2. Change to the QMS root directory (the one where the QMS sources are unpacked)
    3. Run md build
    4. Run cd build
    5. Run
    cmake -G "Visual Studio 18 2026" -A x64 -S .. -B . -L -DUPDATE_TRANSLATIONS=OFF \
          -C <path_to_scripts>/QMSUserSettings.cfg \
          -C <path_to_scripts>/QMSUserSettings.cfg
    
    1. Check that the configuration and generation of the build system have been correct (look for output lines -- Configuring done and -- Generating done and check all displayed variable values)
    2. Run cmake --build . --config Release -j8
  7. Copy all required DLL and other files to the ...\QMS\msvc_64\Files directory before starting QMS for the first time.

    The files CopyFilesGis*.bat located in the msvc_64\scripts directory and shown in the subsection "Example of CopyFilesGis.bat" can serve as a basis for this copy step, but they need to be adapted as they depend on version numbers and some filenames used by the author of this page. When using these files, run CopyFilesGis.bat from msvc_64\scripts. This file includes the file CopyFilesGis_add.bat

Remarks:

  • When using the Ninja generator instead of the Visual Studio generator, make the following changes:
    • Replace build directory by build-ninja.
    • Replace -G "Visual Studio 18 2026" -A x64 by -G Ninja -DCMAKE_BUILD_TYPE=Release in QMSUserSettings.cfg and in the CMake calls.
  • Version numbers of the dependencies used in GISInternals can be found in the files ...\release-1930-x64\doc\gdal_deps.txt and ...\release-1930-x64\doc\gdal_version.txt.
  • Call gdalinfo --formats to see all map formats (plugins) supported by GDAL. Among others, ECW, MrSID, and MBTILES are available.
  • The described use of GISInternals allows for MySQL databases to be accessed in QMS.
  • If a projection error occurs when starting QMS, the content of the Files\share\proj directory is incomplete. Restarting QMS after such a projection error with an updated share\proj directory may fail due to a corrupted QMS INI file. In the Views section of the INI file, the projections may be missing or incomplete. In this case, delete the Views section of the INI file and restart QMS.

Configuration examples

The following files are examples of CMake configuration files for building Quazip and QMS. They are used by the author of this page and must be adjusted to user needs.

User settings file QMSUserSettings.cfg

# User settings for QMS and QuaZip compilation and deployment -------

set(QMSDIR               "d:/QtProjects/QMS" CACHE PATH   "Basis location of all used packages" FORCE)
set(QMS_VERX             "1.20.0.2"          CACHE STRING "Complete QMS version string"         FORCE)
set(QMSSRC               "QMS4Qt6"           CACHE STRING "Location of local QMS repo relative to QMSDIR" FORCE)
set(GISINTERNALS_VER     "1944"              CACHE STRING "Used GISInternals version"           FORCE)
set(GISDATE              "260214"            CACHE STRING "GISInternals download date"          FORCE)
set(PROJ_VER0            "9.7.1"             CACHE STRING "Used proj version in GISInternals"   FORCE)
set(QUAZIP_VER           "1.5"               CACHE STRING "Used QUAZIP version"                 FORCE)
set(ROUTINO_VER          "3.4.3"             CACHE STRING "Used ROUTINO version"                FORCE)
set(MSYS2_DIR            "c:/msys64"         CACHE PATH   "MSYS2 installation directory"        FORCE)
set(QT_DEV_PATH          "c:/Qt/6.10.0/msvc2022_64"             CACHE PATH   "Qt installation path"  FORCE)
set(MSVC_GENERATOR       "-G \"Visual Studio 18 2026\" -A x64"  CACHE STRING "VS build generator"    FORCE)
#set(MSVC_GENERATOR      "-G Ninja  -DCMAKE_BUILD_TYPE=Release" CACHE STRING "Ninja build generator" FORCE)

# End of user settings ------------------------------------------------

Comments:

  • QMSDIR defines the root directory of the directory tree shown at the begin of this page.
  • QMSDIR\QMSSRC defines the location of the QMS sources (root\QMS in directory tree).
  • GISINTERNALS_VER_GISDATE defines the location of the GISInternals package (1944_260214 in directory tree).

General settings file QMSSettings.cfg

cmake_policy(SET CMP0054 NEW)
#cmake_policy(SET CMP0169 OLD)

# Derived from user settings ------------------------------------------

set(CMAKE_CXX_FLAGS "/wd4996 /wd4101 /wd4005 /wd4003 /EHsc" CACHE STRING "Suppress some warnings" FORCE)
set(CMAKE_INSTALL_PREFIX "${QMSDIR}/${QMSRC}/install" CACHE PATH "" FORCE)
set(EXEFILE "${QMS_VERX}" CACHE STRING "" FORCE)
set(GDAL_DEV_PATH "${QMSDIR}/GISInternals/${GISINTERNALS_VER}_${GISDATE}/release-${GISINTERNALS_VER}-x64" CACHE PATH "" FORCE)
set(GDAL_INCLUDE_DIR "${QMSDIR}/GISInternals/${GISINTERNALS_VER}_${GISDATE}/release-${GISINTERNALS_VER}-x64/include" CACHE PATH "" FORCE)
set(GDAL_LIBRARY "${QMSDIR}/GISInternals/${GISINTERNALS_VER}_${GISDATE}/release-${GISINTERNALS_VER}-x64/lib/gdal_i.lib" CACHE FILEPATH "" FORCE)
set(GISInternals_DEV_PATH "${QMSDIR}/GISInternals/${GISINTERNALS_VER}_${GISDATE}/release-${GISINTERNALS_VER}-x64" CACHE PATH "" FORCE)
set(JPEG_DEV_PATH "${QMSDIR}/GISInternals/${GISINTERNALS_VER}_${GISDATE}/release-${GISINTERNALS_VER}-x64" CACHE PATH "" FORCE)
set(LIBPROJ_LIBRARY "${QMSDIR}/GISInternals/${GISINTERNALS_VER}_${GISDATE}/release-${GISINTERNALS_VER}-x64/lib/proj9.lib" CACHE FILEPATH "" FORCE)
set(PROJ_DEV_PATH "${QMSDIR}/GISInternals/${GISINTERNALS_VER}_${GISDATE}/release-${GISINTERNALS_VER}-x64" CACHE PATH "" FORCE)
set(PROJ_INCLUDE_DIR "${QMSDIR}/GISInternals/${GISINTERNALS_VER}_${GISDATE}/release-${GISINTERNALS_VER}-x64/include/proj9" CACHE PATH "" FORCE)
set(QUAZIP_DEV_PATH "${QMSDIR}/quazip/quazip-${QUAZIP_VER}/install" CACHE PATH "" FORCE)
set(QUAZIP_INCLUDE_DIR "${QMSDIR}/quazip/quazip-${QUAZIP_VER}/install/include" CACHE PATH "" FORCE)
set(Qt6Concurrent_DIR "${QT_DEV_PATH}/lib/cmake/Qt6Concurrent" CACHE PATH "" FORCE)
set(Qt6Core5Compat_DIR "${QT_DEV_PATH}/lib/cmake/Qt6Core5Compat" CACHE PATH "" FORCE)
set(Qt6CoreTools_DIR "${QT_DEV_PATH}/lib/cmake/Qt6CoreTools" CACHE PATH "" FORCE)
set(Qt6Core_DIR "${QT_DEV_PATH}/lib/cmake/Qt6Core" CACHE PATH "" FORCE)
set(Qt6EntryPointPrivate_DIR "${QT_DEV_PATH}/lib/cmake/Qt6EntryPointPrivate" CACHE PATH "" FORCE)
set(Qt6ExamplesAssetDownloaderPrivate_DIR "${QT_DEV_PATH}/lib/cmake/Qt6ExamplesAssetDownloaderPrivate" CACHE PATH "" FORCE)
set(Qt6GuiTools_DIR "${QT_DEV_PATH}/lib/cmake/Qt6GuiTools" CACHE PATH "" FORCE)
set(Qt6Gui_DIR "${QT_DEV_PATH}/lib/cmake/Qt6Gui" CACHE PATH "" FORCE)
set(Qt6Help_DIR "${QT_DEV_PATH}/lib/cmake/Qt6Help" CACHE PATH "" FORCE)
set(Qt6LinguistTools_DIR "${QT_DEV_PATH}/lib/cmake/Qt6LinguistTools" CACHE PATH "" FORCE)
set(Qt6Network_DIR "${QT_DEV_PATH}/lib/cmake/Qt6Network" CACHE PATH "" FORCE)
set(Qt6OpenGLWidgets_DIR "${QT_DEV_PATH}/lib/cmake/Qt6OpenGLWidgets" CACHE PATH "" FORCE)
set(Qt6OpenGL_DIR "${QT_DEV_PATH}/lib/cmake/Qt6OpenGL" CACHE PATH "" FORCE)
set(Qt6Positioning_DIR "${QT_DEV_PATH}/lib/cmake/Qt6Positioning" CACHE PATH "" FORCE)
set(Qt6PrintSupport_DIR "${QT_DEV_PATH}/lib/cmake/Qt6PrintSupport" CACHE PATH "" FORCE)
set(Qt6QmlAssetDownloader_DIR "${QT_DEV_PATH}/lib/cmake/Qt6QmlAssetDownloader" CACHE PATH "" FORCE)
set(Qt6QmlIntegration_DIR "${QT_DEV_PATH}/lib/cmake/Qt6QmlIntegration" CACHE PATH "" FORCE)
set(Qt6QmlMeta_DIR "${QT_DEV_PATH}/lib/cmake/Qt6QmlMeta" CACHE PATH "" FORCE)
set(Qt6QmlModels_DIR "${QT_DEV_PATH}/lib/cmake/Qt6QmlModels" CACHE PATH "" FORCE)
set(Qt6QmlTools_DIR "${QT_DEV_PATH}/lib/cmake/Qt6QmlTools" CACHE PATH "" FORCE)
set(Qt6QmlWorkerScript_DIR "${QT_DEV_PATH}/lib/cmake/Qt6QmlWorkerScript" CACHE PATH "" FORCE)
set(Qt6Qml_DIR "${QT_DEV_PATH}/lib/cmake/Qt6Qml" CACHE PATH "" FORCE)
set(Qt6QuickTools_DIR "${QT_DEV_PATH}/lib/cmake/Qt6QuickTools" CACHE PATH "" FORCE)
set(Qt6QuickWidgets_DIR "${QT_DEV_PATH}/lib/cmake/Qt6QuickWidgets" CACHE PATH "" FORCE)
set(Qt6Quick_DIR "${QT_DEV_PATH}/lib/cmake/Qt6Quick" CACHE PATH "" FORCE)
set(Qt6Sql_DIR "${QT_DEV_PATH}/lib/cmake/Qt6Sql" CACHE PATH "" FORCE)
set(Qt6ToolsTools_DIR "${QT_DEV_PATH}/lib/cmake/Qt6ToolsTools" CACHE PATH "" FORCE)
set(Qt6Tools_DIR "${QT_DEV_PATH}/lib/cmake/Qt6Tools" CACHE PATH "" FORCE)
set(Qt6UiPlugin_DIR "${QT_DEV_PATH}/lib/cmake/Qt6UiPlugin" CACHE PATH "" FORCE)
set(Qt6UiTools_DIR "${QT_DEV_PATH}/lib/cmake/Qt6UiTools" CACHE PATH "" FORCE)
set(Qt6WebChannel_DIR "${QT_DEV_PATH}/lib/cmake/Qt6WebChannel" CACHE PATH "" FORCE)
set(Qt6WebEngineCoreTools_DIR "${QT_DEV_PATH}/lib/cmake/Qt6WebEngineCoreTools" CACHE PATH "" FORCE)
set(Qt6WebEngineCore_DIR "${QT_DEV_PATH}/lib/cmake/Qt6WebEngineCore" CACHE PATH "" FORCE)
set(Qt6WebEngineWidgets_DIR "${QT_DEV_PATH}/lib/cmake/Qt6WebEngineWidgets" CACHE PATH "" FORCE)
set(Qt6WidgetsTools_DIR "${QT_DEV_PATH}/lib/cmake/Qt6WidgetsTools" CACHE PATH "" FORCE)
set(Qt6Widgets_DIR "${QT_DEV_PATH}/lib/cmake/Qt6Widgets" CACHE PATH "" FORCE)
set(Qt6Xml_DIR "${QT_DEV_PATH}/lib/cmake/Qt6Xml" CACHE PATH "" FORCE)
set(Qt6ZlibPrivate_DIR "${QT_DEV_PATH}/lib/cmake/Qt6ZlibPrivate" CACHE PATH "" FORCE)
set(Qt6_DIR "${QT_DEV_PATH}/lib/cmake/Qt6" CACHE PATH "" FORCE)
set(QT_DIR "${Qt6_DIR}" CACHE PATH "Qt base dir" FORCE)
set(QT_QMAKE_EXECUTABLE "${QT_DEV_PATH}/bin/qmake6.exe" CACHE FILEPATH "" FORCE)
set(QuaZip-Qt6_DIR "${QMSDIR}/quazip/quazip-${QUAZIP_VER}/install/lib/cmake/QuaZip-Qt6-${QUAZIP_VER}" CACHE PATH "" FORCE)
set(ROUTINO_DEV_PATH "${QMSDIR}/routino/routino-${ROUTINO_VER}/install" CACHE PATH "" FORCE)
set(WINDEPLOYQT_EXECUTABLE "${QT_DEV_PATH}/bin/windeployqt.exe" CACHE FILEPATH "" FORCE)
set(ZLIB_LIBRARY "${QMSDIR}/GISInternals/${GISINTERNALS_VER}_${GISDATE}/release-${GISINTERNALS_VER}-x64/lib/zlib.lib" CACHE FILEPATH "" FORCE)
set(ZLIB_ROOT "${QMSDIR}/GISInternals/${GISINTERNALS_VER}_${GISDATE}/release-${GISINTERNALS_VER}-x64" CACHE PATH "" FORCE)

# End of derived settings ---------------------------------------------

# Evaluated settings --------------------------------------------------

string(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" QMS_VER_SHORT "${QMS_VERX}")

string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" QT_VER "${QT_DEV_PATH}")

set(QUAZIP_QT_MAJOR_VERSION ${CMAKE_MATCH_0})

string(SUBSTRING ${QT_VER} 0 1 QT)

string(SUBSTRING ${PROJ_VER0} 2 1 PROJ_SUBVER0)
string(SUBSTRING ${PROJ_VER0} 0 1 PROJ_VER0)
set(PROJ_VER      ${PROJ_VER0} )  
set(PROJ_SUBVER   ${PROJ_SUBVER0})  

set(REDIST $ENV{VCToolsRedistDir})

if(MSVC_GENERATOR MATCHES "Ninja")
    set(BUILD_PATH "${QMSDIR}/${QMSSRC}/build-ninja")
    set(BUILD_PATH_QUAZIP "${QMSDIR}/quazip/quazip-${QUAZIP_VER}/build-ninja")
    set(BUILD_PATH_QMS "${QMSDIR}/${QMSSRC}/build-ninja")
else()
    set(BUILD_PATH "${QMSDIR}/${QMSSRC}/build/Release")
    set(BUILD_PATH_QUAZIP "${QMSDIR}/quazip/quazip-${QUAZIP_VER}/build")
    set(BUILD_PATH_QMS "${QMSDIR}/${QMSSRC}/build")
endif()


# Fixed settings ------------------------------------------------------

set(BUILD_FOR_LOCAL_SYSTEM "OFF"     CACHE BOOL   "" FORCE)
set(BUILD_QMAPSHACK        "ON"      CACHE BOOL   "" FORCE)
set(BUILD_QMAPTOOL         "ON"      CACHE BOOL   "" FORCE)
set(CMAKE_BUILD_TYPE       "Release" CACHE STRING "" FORCE)
set(MSVC_VER               "$ENV{VCTOOLSVERSION}" CACHE STRING "" FORCE)
set(QUAZIP_BZIP2_STDIO     "OFF"     CACHE BOOL   "Don't use bzip2" FORCE)
set(QUAZIP_BZIP2           "OFF"     CACHE BOOL   "Don't use bzip2" FORCE)
set(UPDATE_TRANSLATIONS    "OFF"     CACHE BOOL   "" FORCE)
set(UPDATE_TRANSLATIONS_PURGE_OBSOLETE "OFF" CACHE BOOL "" FORCE)
set(USE_QT6DBus            "OFF"     CACHE BOOL   "" FORCE)

# End of all settings -------------------------------------------------

Example of copy files batch script

This is an example of the file CopyFilesGis.bat used for copying/collecting all files necessary to run QMS.


@echo off

echo Script to copy all files necessary for QMS (GISInternals version)
rem echo Scripts switches to x64 Native Tools Command Prompt and then to `%~dp0` directory!

rem echo Preparing x64 Native tool ...

rem for /f "usebackq tokens=*" %%i in (`"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (set VSPATH=%%i)

rem call "%VSPATH%\VC\Auxiliary\Build\vcvars64.bat"
rem pause

set QMSD0=%~dp0
    
cd /D %QMSD0%

echo Switched to %cd%

rem Delete all files --------------------------------------------
rmdir /s /q ..\Files

IF ERRORLEVEL 1 (
    echo [ERROR] RMDIR failed with error code %ERRORLEVEL%.
    exit /b %ERRORLEVEL%
) ELSE (
    echo RMDIR successful.
)

pause

mkdir ..\Files


rem Include and run user settings
rem for /f "tokens=2 delims=:" %%a in (QMSUserCfg.dir) do (
rem echo Include dir: %%a
set USERDIR=%cd%

echo Starting file copy  step 1 ...

pause

call %cd%\CopyFilesGis_add.bat
rem )

rem echo %QMSI_BUILD_PATH%\qmapshack.exe

echo Starting file copy step 2 ...
pause



rem Copy QMapShack Files (removed bin subdir! 28.04.25 ------

echo

copy "%QMSI_BUILD_PATH%\qmapshack.exe"
copy "%QMSI_BUILD_PATH%\qmaptool.exe"
copy "%QMSI_BUILD_PATH%\qmt_map2jnx.exe"
copy "%QMSI_BUILD_PATH%\qmt_rgb2pct.exe"

copy %QMSI_QT_PATH%\bin\assistant.exe

rem Copy Qt files -------------------------------------------------

set PATH=%QMSI_QT_PATH%\bin;%PATH%

windeployqt.exe  --force-openssl --no-translations .\qmapshack.exe .\qmaptool.exe .\qmt_map2jnx.exe .\qmt_rgb2pct.exe .\assistant.exe

pause

mkdir translations

for %%i in (ca, cs, de, en, es, fr, it, nl, ru) do (

    if exist %QMSI_QT_PATH%\translations\qt_%%i.qm (copy %QMSI_QT_PATH%\translations\qt_%%i.qm translations)
    if exist %QMSI_QT_PATH%\translations\qtbase_%%i.qm (copy %QMSI_QT_PATH%\translations\qtbase_%%i.qm translations)
    if exist %QMSI_QT_PATH%\translations\assistant_%%i.qm (copy %QMSI_QT_PATH%\translations\assistant_%%i.qm translations)
    if exist %QMSI_QT_PATH%\translations\qt_help_%%i.qm (copy %QMSI_QT_PATH%\translations\qt_help_%%i.qm translations)
)

rem Qt6WebEngine translations
cd translations
mkdir qtwebengine_locales

for %%i in (ca, cs, de, en-US, en-GB, es, fr, it, nl, ru) do if exist %QMSI_QT_PATH%\translations\qtwebengine_locales\%%i.pak (copy %QMSI_QT_PATH%\translations\qtwebengine_locales\%%i.pak qtwebengine_locales)

cd ..


if %QT%==5 (
copy %QMSI_QT_PATH%\bin\libEGL.dll
copy %QMSI_QT_PATH%\bin\libGLESv2.dll
copy %QMSI_QT_PATH%\bin\Qt%QT%WebEngine.dll

mkdir printsupport
cd printsupport
copy %QMSI_QT_PATH%\plugins\printsupport\windowsprintersupport.dll
cd ..
) 

rem Copy Routino files ----------------------------------------------
copy %QMSI_ROUT_PATH%\lib\routino.dll
copy %QMSI_ROUT_PATH%\bin\planetsplitter.exe
copy %QMSI_MGW6_PATH%\libwinpthread-1.dll
copy %QMSI_MGW6_PATH%\zlib1.dll
xcopy %QMSI_ROUT_PATH%\xml routino-xml /s /i

rem Copy QuaZip --------------------------------------------------------
copy %QMSI_QUAZIP_PATH%\bin\quazip1-Qt%QT%.dll

rem Copy mysql 

echo.
echo.
echo Copy mysql
rem copy %QMSI_MYSQL_PATH%\qsqlmysql.dll
robocopy %QMSI_MYSQL_PATH% "%cd%" /E /NJH /NJS /NFL /NDL     
pause

rem Copy MSVC Redistributables -------------------------------------
copy %QMSI_VCREDIST_PATH%VC_redist.x64.exe

echo Compiling all .ts files to .qm ...
for %%g in ("qmapshack", "qmaptool", "qmt_rgb2pct") do (

    for %%f in ("%QMSI_SRC_PATH%\%%g\locale\*.ts") do (
        %QMSI_QT_PATH%\bin\lrelease.exe -silent "%%f" -qm translations\%%~nf.qm
    )
)

pause

copy ..\*.ico

rem Copy offline help files ------------------------------------------------
mkdir doc
cd doc
mkdir HTML
copy ..\..\..\src\qmapshack\doc\QMSHelp.* HTML
copy ..\..\..\src\qmaptool\doc\QMTHelp.* HTML
cd ..

rem Copy 3rd party software description and licence ----------------------------
copy ..\3rdparty.txt
copy ..\..\LICENSE 1LICENSE.txt

copy %USERDIR%\UsedVersions.txt

rem Copy qt.conf -----------------------------------------------------------
copy ..\qt.conf

pause

cd ..\scripts

This file includes the file CopyFileGis_add.bat:

rem Environment variable replacements for copy step created with PrepareSetup.cfg

set QMSI_QMS_PATH=d:\QtProjects\QMS
set QMSI_GIS_PATH=d:\QtProjects\QMS\gisinternals\1944_260214\release-1944-x64
set QMSI_QT_PATH="c:\Qt\6.10.0\msvc2022_64"
set QMSI_VCREDIST_PATH="C:\Program Files\Microsoft Visual Studio\18\Community\VC\Redist\MSVC\14.50.35710\"
set QMSI_ROUT_PATH="d:\QtProjects\QMS\routino\routino-3.4.3\install"
set QMSI_MYSQL_PATH="d:\QtProjects\QMS\mysql\6.10.0"
set QMSI_MGW6_PATH="c:\msys64\ucrt64\bin"
set QMSI_QUAZIP_PATH="d:\QtProjects\QMS\quazip\quazip-1.5\install"
set QMSI_BUILD_PATH=d:\QtProjects\QMS\QMS4Qt6\build\Release
set QMSI_SRC_PATH="d:\QtProjects\QMS\QMS4Qt6\src"
set QT=6
 
cd ..\Files
mkdir data
pause
xcopy %QMSI_GIS_PATH%\bin\gdal-data data /s /i
if '260214' LSS '241207' (
    copy  %QMSI_GIS_PATH%\bin\proj_9_7.dll
) else (
    copy  %QMSI_GIS_PATH%\bin\proj_9.dll
)
xcopy %QMSI_GIS_PATH%\bin\*.dll /I /EXCLUDE:..\gisexclude.txt
mkdir gdalplugins
xcopy %QMSI_GIS_PATH%\bin\gdal\plugins gdalplugins /s /i /EXCLUDE:..\gisexclude.txt
copy %QMSI_GIS_PATH%\bin\curl-ca-bundle.crt
copy %QMSI_GIS_PATH%\bin\gdal\apps\*.exe
copy %QMSI_GIS_PATH%\bin\proj9\apps\*.exe
copy %QMSI_GIS_PATH%\bin\curl.exe
copy %QMSI_GIS_PATH%\bin\openssl.exe
copy %QMSI_GIS_PATH%\bin\sqlite3.exe
copy %QMSI_GIS_PATH%\..\license.txt GisInternals_license.txt
xcopy %QMSI_QMS_PATH%\mysql\6.10.0\sqldrivers\qsqlmysql.dll .\sqldrivers\ /i
mkdir share\proj
xcopy %QMSI_GIS_PATH%\bin\proj9\share share\proj /s /i

Prev (GDAL support for additional map formats) | Home | Manual | Index | Top | (Ubuntu-14.04) Next

⚠️ **GitHub.com Fallback** ⚠️