Qgis source code download and Windows platform use scripting to automate compilation

Source: Internet
Author: User

  • Environment Introduction
      • QGis 2.7+ Current 2.8
      • Win7
  • Download code from GitHub
      • Code Warehouse
  • Official Installation Documentation
      • Windows platform installation Look at section 1, 2, mainly look at 4.1 ok
  • General overview of the compilation process
      • Qgis uses the cross-platform engineering generation tool CMake to manage all projects, since it's worth knowing qgsi how much qmake it is, CMake and qmake are similar, but more versatile and more powerful. For CMake, you can refer to this .
      • The Windows platform can be installed using an automated installation script located at: root directory \ms-windows\osgeo4w\package-nightly.cmd
  • Download ready tools and libraries, official documents are lagging, some do not need
      • CMake
        • CMake Introduction
      • Flex&bison
        • Official documents are installed separately with Cygwin, the actual direct download of the win version on OK, or search Win_flex_bison
      • Download osgeo4w (an open source GIS software, Qgis use it to download dependent libraries), use it to install other dependent libraries

        • It's very similar to the Cygwin.
      • Qt Python does not have to be installed, after downloading according to the above list, there will be a osggeo4w
      • For the purpose of this library, please refer to
  • Modify the Build script
    • Path
        • Root directory \ms-windows\osgeo4w\package-nightly.cmd
    • If the direct double-click execution, nothing effect, the window flashed over
        • Because this script needs to be executed in CMD, take 4 parameters. If there is, how to exit directly.
        • We change to pause so we can at least see what's wrong.

    • The build directory has environment variables set

        • As you can see, this script requires 4 parameters, namely version number, package number, package name, platform version
        • Buildder for the generated project catalog
        • Osgeo4w_root directory for installed osgeo4w
          • Add the OSGEO4W_ROOT environment variable to the root directory
          • Add%osgeo4w_root%\bin to Path (required for compilation not required but run by the program)
    • Temporarily add the paths of CMake and Flex&bison to the environment variable. Modify it according to your own directory.
    • If this is the x86 version, the following path is not correct
    • Configure the modules that need to be compiled
    • Basically, if there is a problem, you can refer to the log information modification when the script executes
  • Execute script

      • Execution will generate a project file of VS, and the entire project has been compiled, that is, it can be run directly, in VS, set the startup project to Qgis OK
  • Other
      • If some modules cause errors due to incomplete downloads or other problems, you can temporarily block
        • CMake is recursive, each time you add a subdirectory in the CMakeLists.txt, CMake will execute the CMakeLists.txt in the subdirectory.

        • So for example, the Python module is not available (I encountered it myself), Sip.exe call failed, can block Python module
          • Just modify the/src/under the CMakeLists.txt.

            • #用于注释


From for notes (Wiz)

Qgis source code download and Windows platform use scripting to automate compilation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.