Windows Build/MinGW

From K-3D

Jump to: navigation, search


Build Overview

  • K-3D version: 0.7.
  • Build environment: MinGW with CMake.
  • Runtime environment: Native Win32.
  • Pros
    • Preferred method of delivering a Win32 build, since it uses a 100% FOSS toolchain.
    • Native OpenGL performance.
    • Stable.
  • Cons
  • Known Issues
    • None.
  • Requirements
    • MinGW with MSYS
    • CMake
    • Boost 1.33 or later (built for MinGW)
    • GTK / gtkmm 2.8, most recent versions (runtime + development)

Important Note

You will need the Boost libraries built with MinGW to complete this build. The libraries provided by boost.org will not work - they are built for MSVC. You must either download boost binaries from K-3D, or build them from source, as described in the following instructions.

Build Instructions

Install CMake 2.6

Install MSYS & MinGW

MSYS provides a shell window, bash shell, and utilities that you will need for your K-3D build. MinGW provides a Win32 port of the GNU gcc compiler that you will use to build K-3D.

Install Boost for MinGW

  • Download the prepackaged Boost 1.34 MinGW binaries provided by K-3D.
  • Expand the contents of the ZIP file into C:/.
  • The Boost header files and libs will be located in C:\Boost. You must add C:\Boost\lib to your PATH.
  • For reference, we provide instructions on how to Build MinGW Boost.

Install GTK & gtkmm

  • Download and install the most up-to-date "Gtk+/Win32 Development Environment" (for example: "gtk-dev-2.10.11-win32-1.exe") from http://gladewin32.sourceforge.net - recommended install directory is c:\gtk.
  • Download and install the most up-to-date gtkmm development installer (for example: "gtkmm-win32-devel-2.10.8-1.exe") from http://ftp.gnome.org/pub/gnome/binaries/win32/gtkmm/ - Note: make absolutely sure you install it in the same directory as GTK+, e.g: c:\gtk.
  • Add the GTK+ binary directory c:\gtk\bin to your PATH.
  • Set the PKG_CONFIG_PATH environment variable to point to the pkg-config configuration files installed by GTK/gtkmm, typically c:\gtk\lib\pkgconfig.

Download K-3D Sources

Obtain K-3D 0.7 or later, from either Subversion or K-3D Downloads. Place the sources in your c:\msys\1.0\home\<username>\k3d directory.

Initial Build Instructions

In a break from the past, K-3D now requires an out-of-source build. So assuming that you've downloaded the K-3D sources to c:\msys\1.0\home\<username>\k3d, you will need to create a separate directory where the binaries will be created:

$ cd
$ mkdir k3d-build
  • Run cmake by selecting Start Menu > CMake 2.4 > CMake.
  • In the cmake window that opens, select c:\msys\1.0\home\<username\k3d as the source code directory.
  • Select c:\msys\1.0\home\<username>\k3d-build as the build directory.
  • Hit the Configure button to configure the build.
  • In the Select Generator window that opens, choose "MSYS Makefiles" and hit OK. CMake will examine your system and detect external libraries. You may be prompted for information if cmake can't locate a required external library.
  • CMake will display the set of available configuration options.
  • If you have external libraries in non-standard locations, you may have to manually edit the options, supplying the paths to library header files or binaries. Use the "Show Advanced Values" checkbox to toggle visibility for all options.
  • Hit the Configure button again to configure any changes you've made.
  • Once all options have been set, the OK button will be available. Hit it to generate the K-3D makefiles and close the cmake window.

Now, you may start the build. In your MSYS window:

$ make

Once the program is built, you can run it out of the build directory:

$ make run

To install everything to its final destination:

$ make install

Subsequent Builds

Whenever you update your source tree from Subversion you should re-run cmake to ensure that your build is completely up-to-date. To do this, cd into your build directory and re-run cmake:

$ cd k3d-build
$ make edit_cache

From this point you can configure, deal with any new options that have been introduced in the source tree, and generate your new makefiles. cmake retains your old options, so you won't have to recreate any previous selections.

Personal tools