Features Help Download

Lomse library. Installing on Microsoft Windows

This document contains detailed instructions for building Lomse library and tests program from sources, on Microsoft windows systems. If you find things that need to be fixed in this document and would like to contribute, you are welcome. Please post a message on the Lomse list. Thank you.

For installing the Lomse library you have to use CMake, version 2.8.11 or greater. CMake will generate for you a makefile for doing all necessary steps, as well as additional ones, such as building a test program for checking the library, and an example program.

If you don't have CMake, download and install the latest distribution from http://www.cmake.org/cmake/resources/software.html. Download the installer .exe file and run it.

Requirements

To build the lomse library, the following software should be installed in your system:

Installation steps

Once you have checked that you have the required packages you can proceed to create the makefile or project file for building Lomse.

1. Get the Lomse source code

Create a folder for Lomse sources. For instance, "C:\MyData\Projects\lomse". Using your Git client software download a working copy of Lomse project. If you are using a command window, the command to issue would be:

    git clone https://github.com/lenmus/lomse

2. Generate Makefile

Now, using CMake, proceed to create the makefile:

  1. Open CMake GUI program. (usually at C:\Program Files\CMake\bin\cmake-gui.exe). It will display this window

  2. Click on the 'Browse Source...' button in the top right hand corner of the window. Use the file browser popup to locate the Lomse source directory (i.e.: C:\MyData\Projects\lomse), and click OK.

  3. Now we create a directory in which to create the Visual Studio project files and hold the build products. This directory should not be the same as, or inside, the the source directory. Here we will create this build directory alongside our source directory.

    Click on the 'Browse Build...' button in the top right hand side of the CMake GUI window. Use the file browser popup to browse back to C:\MyData\Projects\, and click on the Make New Folder button. Rename the created folder to lomse-build, and click on the OK button.

    The two text entries at the top of the GUI should now contain C:/MyData/Projects/lomse and C:/MyData/Projects/lomse-build respectively (Note: CMake always represents Windows paths with forward slashes).

  4. Click on the 'Configure' button on the left hand side. A window will open and you will be asked for which tool you would like to generate the makefile for. Select, for instance, "Visual Studio 7 .NET". Ensure only the 'Use default native compilers' radio box is checked. Then click on the 'Finish' button.

    Once the generator is selected, the configuration process will start. At some point, you will get a listing of all relevant options (CMakeCache entries). All entries at this point will be highlighted in red to signal that you may want to modify some of them. Mouse-hover over entries will generate a brief description, as shown below.

    Most of the default settings should be fine, though you may want to change CMAKE_INSTALL_PREFIX. By default, CMake will configure the build to install Lomse under C:\Program Files\lomse. If you do not wish to use this directory, or do not have permission to install there, you can change the installation location. Click on the arrow next to the CMAKE entry in the central options display to expand all CMake specific configuration options. Scroll down to locate the CMAKE_INSTALL_PREFIX entry. Click on the entry and edit the path directly or via the file browser popup. In this example we will modify this install directory to C:/MyData/Projects/lomse-install.

  5. Once you have adjusted any options, click on the Configure button again. After this has finished, all the options listed in the central option display should be white. If you still have entries in red, click Configure to reconfigure until all entries are white.

    Building with CMake is an iterative process:

    • Select values, press the Configure button.
    • Set the settings, run configure, set the settings, run configure, etc.
    • Repeat until all values are set (no red lines) and the OK button becomes available.
    • To set the value of a variable, click on that value:
      • If it is boolean (ON/OFF), a drop-down menu will appear for changing the value.
      • If it is file or directory, an ellipsis button will appear ("...") on the far right of the entry. Clicking this button will bring up the file or directory selection dialog.
      • If it is a string, it will become an editable string.
    • Some variables (advanced variables) are not visible right away. To see them, toggle to advanced mode ("Show Advanced Values" toggle).

    It may happen that CMake won't find some needed libraries, such as FreeType. In this case you will have tree or four variables highlighted in red that you have to fix. Yo have two options for this:

    1. Modify the CMAKE_PREFIX_PATH variable to hint search locations to CMake. For instance, if library FreeType is installed at 'C:\MySoftware\freetype' add this path to CMAKE_PREFIX_PATH.
    2. The other alternative is to directly set up the required variables (i.e. FREETYPE_INCLUDE_DIR_freetype, FREETYPE_INCLUDE_DIR_ft2build and FREETYPE_LIBRARY) to point to appropriate paths.

  6. When no more red lines, click on the 'Generate' button. This will create the Visual Studio project files and will be placed in the specified folder. Finally, CMake will report Configuring done, Generating done in the logging window at the bottom of the GUI. You can now close the CMake GUI.

3. Build the library

At this point you've generated project files using CMake. Now, just run MS Visual Studio, open the solution file, choose your configuration, and build the ALL_BUILD project.

4. Install Lomse

Once you have built Lomse you can install it by building the INSTALL target in Visual Studio. In the Solution Explorer, right click on the INSTALL solution, and select Build from the popup menu. The solution will now build and install to the directory you chose for CMAKE_INSTALL_PREFIX earlier. If you wish to build a different configuration (Release if you built Debug first, for example), then simply change the solution configuration as described in the previous paragraph, and build the INSTALL solution again.

In case of problems ...

Please notice that:

Last updated: 2016/01/31