We will now configure the Zorba build by running CMake. We assume that the appropriate build preparations (described in Preparing to Build Zorba) have been performed.
cmake-gui"
. On Windows, the GUI is installed by default and can be started via the Start menu. On MacOS, it is available as the "gui"
variant of the cmake
package.The basic steps to configure Zorba are:
{ZORBABUILD}
directory: {ZORBASRC}
may be an absolute or a relative path to your Zorba source directory. For example, if you used the convention of creating the build directory as a subdirectory of the source directory, you can just type-G
or -D
options.This command should configure Zorba and prepare for the build. CMake will tell you if your environment is missing some of the required libraries or development headers.
The meaning of the -G
and -D
arguments are described below.
-D
configuration parameters; it is not necessary to specify -G
/ -D
every time.CMake is a meta build system. It is able to generate both native makefiles (e.g. GNU Make or NMake) and IDE workspaces (e.g. Visual Studio or KDevelop Projects), depending on which CMake generator is selected. By default it will generate a UNIX-style Makefile-based project.
You specify the generator to use with the -G
arguments to cmake
. For example, on Windows, you can create a Visual Studio 10 solution by executing the following command in the {ZORBASRC}
directory:
The list of available Generators for your CMake installation can be seen by typing " cmake –help
".
In most circumstances it will be necessary to specify a few parameters to CMake, such as the various configuration parameters mentioned above in Library Dependencies. You do this with a series of -D
arguments to CMake. For example, to build Zorba without ICU (Unicode) support:
A complete list of Zorba's configuration parameters can be found here: Zorba Configuration Parameters. CMake itself also has some configuration parameters that may be important for you; here are three of the most common:
CMAKE_PREFIX_PATH
. This parameter is a semicolon-separated list of directories where CMake should look. For instance, if you have Xerces-C installed in /opt
, try the following: CMAKE_PREFIX_PATH
on Windows. See Zorba's Automatic DLL Detection Mechanism for more information.CMAKE_INSTALL_PREFIX
parameter. By default, this directory will be {ZORBABUILD}/dist
, which is not likely to be a useful location. bin/
, lib/
, and share/
. On Unix and MacOS installations, a common value for CMAKE_INSTALL_PREFIX
is /usr/local
. On Windows, something like C:\Program Files\Zorba
is suggested. DESTDIR
variable. However, specifying this variable at compile time will not work with Zorba, because certain installation paths are hard-coded into the Zorba binaries. Be sure to only use CMAKE_INSTALL_PREFIX
.CMAKE_BUILD_TYPE
parameter as follows: Once CMake runs without reporting any configuration errors, move on to Building and Installing Zorba.