Jam Workspace Generator

Overview

JamPlus has a built-in workspace generator that reads a project's Jamfiles and exports an IDE workspace. The workspace may then be loaded in the appropriate IDE and represents a read-only view of the contents of the Jamfiles. Updates to the Jamfiles do not appear automatically in the IDE workspace, although correct Jam builds will continue to function. JamPlus provides a facility to manually regenerate the workspace when Jamfiles change.

JamPlus generates a completely out-of-source build structure. This means that all intermediate files, output files, IDE project files, and other miscellaneous Jam related files exist in a directory external to the source code itself. Since the entire build tree is generated, merely removing the out-of-source build directory will destroy all evidence of the build.

Out of source build trees also contain special instructions to make the build run faster. Among other things, the dependency cache is set up. The dependency cache is used to track 'include' dependencies, but it is also used to store MD5 command lines and MD5 contents information.

Usage

Generation of a new IDE workspace is performed by running the command line:

    jam --workspace ...

Running jam --workspace without any command line options will list the help.

jam --workspace
    [ -gen=GENERATOR ]
    [ -compiler=COMPILER ]
    [ -config=CONFIG ]
    [ -jamflags=KEY=VALUE ]
    source-jamfile
    [ path-to-destination ]

jam --workspace may be invoked with the following options:

-gen=GENERATOR

Sets an IDE workspace and project generator. GENERATOR may be one of the following:

  • codeblocks - Generates CodeBlocks workspaces and projects.
  • none (default) - Do not generate a workspace.
  • vc6 - Generates Visual C++ 6.0 workspaces and projects.
  • vs2003 - Generates Visual Studio 2003 solutions and projects.
  • vs2005 - Generates Visual Studio 2005 solutions and projects.
  • vs2008 - Generates Visual Studio 2008 solutions and projects.
  • vs2010 - Generates Visual Studio 2010 solutions and projects.
  • xcode - Generates Xcode workspaces and projects.

-compiler=COMPILER

Sets the default compiler used to build with. If not specified, the compiler will be set according to the Jambase auto detection capabilities, with Visual Studio taking precedence.

COMPILER may be one of the following:

  • vs2010 - Visual Studio 2010.
  • vs2008 - Visual Studio 2008.
  • vs2005 - Visual Studio 2005.
  • vs2003 - Visual Studio 2003.
  • vc6 - Visual C++ 6.
  • mingw - MinGW.
  • gcc - GCC.

-config=CONFIG

Provides various configuration options to Jam's workspace generator. CONFIG is the name of the configuration file.

-jamflags=KEY=VALUE

Provides additional configuration options when generating the out of source build's redirection Jambase.jam. KEY is the name of a variable known to Jam, such as CSC_COMPILER. VALUE is the value to set that Jam variable to.

Examples:

  • CSC_COMPILER=mono (or vs2005 or vs2008)

source-jamfile

The path to the Jamfile to start building the workspace from. If only the directory is specified, then Jam attempts to load a file named Jamfile.jam from the given directory. If source-jamfile is a directory with filename, such as ../Game/Pong.jam, then the specified Jamfile is loaded.

path-to-destination (optional) If path-to-destination is specified, then the build tree will be generated into path-to-destination. If path-to-destination is not specified, the build tree is generated into the current working directory.

Minimally, Jam requires the -gen parameter and source-jamfile.

Assuming a source tree of:

Running JamToWorkspace from the helloworld/ root with the following command line creates an out of source build directory in helloworld/build/.

jam --workspace -gen=vs2008 Jamfile.jam build

From here on out, all Jam executions should be run from within the generated build/ directory.

Generated Files