-
Notifications
You must be signed in to change notification settings - Fork 14
Building OpenFrames on Windows
The OpenFrames build process can be broken down into four main steps:
- Download and configure the dependencies
- Create the build system using CMake
- Build OpenFrames
- Run OpenFrames
The first two steps are generally "one-time" processes that are performed immediately after downloading the OpenFrames repository. They result in a build system (e.g. Visual Studio solution or makefiles) that will intelligently rebuild OpenFrames components as needed when source or configuration files are changed.
Below are step-by-step instructions on how to perform the aforementioned steps along with the background requirements that are needed before beginning.
- Source Tree : a GUI git and mercurial client
- Git for Windows : a command line linux style shell and with git support or GUI based (runs over included MINGW)
- used to generate build system
- used 3.12 as tested
- to run build and install processes
- used VS 2013 Community edition version 12.0.40629.00 Update 5 as tested
(Optional) Winteracter Open Motif
- used if you want to to build the Winteracter demo
- download the latest static library for your architecture (32 or 64-bit) and place it in a convenient location
- it is recommended to place it in the Winteracter lib directory (e.g.
lib.ifi64
) next to the existing Winteracter libraries
- download the OpenFrames repository
- when checking out, ensure you have selected the "develop" branch instead of the "Master" branch
- the root OpenFrames folder will be referred to as
[OF_FOLDER]
on this page
The following steps correspond to the numbered arrows in Figure 1 below.
In CMake:
- Specify
[OF_FOLDER]
as the Source Code location. - Specify
[OF_FOLDER]\Win64build
as the Build Binaries location.
- Note: CMake makes slashes forward slashes
- Click Add Entry and specify the following:
-
Name
=OSG_DIR
-
Type
=PATH
-
Value
= Path to your[OSG_FOLDER]\install
directory -
Description
= empty
- (Optional) If you want to build the Winteracter example, click Add Entry and specify the following:
-
Name
=WINTER_ROOT
-
Type
=PATH
-
Value
= Path to your Winteracter\wint
directory, eg:C:\Users\John\Documents\wint
-
Description
= empty
- Press the Configure button
- say Ok if you are asked to create the
build
folder - verify the default generator choice (Visual Studio 12 2013 Win64 in our case) or choose a different one
- check Use default native compiler (See Figure 2)
- click Finish
Figure 1 : CMake GUI
Figure 2 : CMake Specifications
Note: If you get a CMake error OpenSceneGraph NOT FOUND, make sure you specified OSG_DIR
correctly (Step 3 above).
Note: If you get a CMake warning Open Motif NOT FOUND, see below to set the path to libXm
if you want to build the Winteracter demo.
- Set CMake variables
- the configure process sets up build variables that can be modified before generating the actual build system
- the variable list can be organized by clicking the Grouped button. Set the following variables: (See Figure 3)
-
CMAKE_INSTALL_PREFIX
=[OF_FOLDER]\OpenFrames-Windows-install
- Select
OF_FORTRAN_MODULE
to build the Fortran interface and Winteracter example - (Optional) Use
CMAKE_LIBRARY_PATH
to specify the directory containing Open Motif (libXm
) if you are building the Winteracter example, only needed if you did NOT placelibXm
next to the installed Winteracter libraries
-
- Finally, create the build system
- press the Configure button again to enable the variable changes you just made
- press the Generate button to create the build system
- exit CMake
Figure 3 : CMake Variables
In Visual Studio (See Figure 4)
-
File -> Open Project and navigate to
[OF_FOLDER]\Win64build
folder. ChooseOpenFrames.sln
and click Open - The Solution Explorer windows will have ALL_BUILD selected
- By default the Debug build solution may be selected. Choose the Release build solution and perform build. (Build -> Build Solution)
- Once the build is complete perform the installation:
- within Solution Explorer window, find the list of CMakePredefinedTargets under ALL_BUILD, INSTALL etc, in the Solution Explorer window (highlighted in Figure 4)
- right-click INSTALL, left click Build
- Confirm that the
ofsplitwindow
executable is in[OF_FOLDER]\OpenFrames-Windows-install\bin
(see Figure 5)
Figure 4 : MS Visual Studio
Figure 5 : Browse to locate ofsplitwindow
In System Properties:
- Select the Advanced tab on your Windows machine.
- Click on Environment Variables button (see Figure 6)
- Edit
Path
under User Variables. IfPath
doesn't exist, then create it. (see Figure 7) - Add
[OF_FOLDER]\OpenFrames-Windows-install\bin
to the Path by clicking Edit once Path is selected. Add the path as a new line in the table. - Create a new user environment variable named
OSG_FILE_PATH
, and set its value to[OF_FOLDER]\install
. This will allow OpenFrames demos to find their resources (images, models, etc.). IfOSG_FILE_PATH
variable already exists, then append the new value to its end by clicking Edit and adding a path as a new ling in the table. - Click OK to close the editor dialog
- Click OK to close the Environment Variables dialog
- Open a new terminal (so the above changes can take effect), change directory to
[OF_FOLDER]\OpenFrames-Windows-install\bin
and typeofsplitwindow
. It should bring up a window where the top half has satellites orbiting the Earth, and the bottom half has a 3D time-history plot of one of the satellites.
Figure 6 : Environment Variables
Figure 7 : Environment Variables
Congratulations, OpenFrames is now built and installed.