horror/thirdparty/ode-0.16.5/INSTALL.txt
2024-06-10 12:48:14 +03:00

174 lines
5.6 KiB
Plaintext

ODE has two new build systems, one for *nix systems and another for
just about everything else.
1. Building with Visual Studio
2. Building with Autotools (Linux, OS X, MSYS, etc.)
3. Building with Code::Blocks
4. Building with Something Else
5. Building with CMake
1. BUILDING WITH VISUAL STUDIO (2002 and up)
============================================
If you downloaded this source code from Subversion you must first use
the Premake build system to generate project files.
Open a command prompt and enter into the build directory. Then run the
premake4.exe program with the appropriate options to generate the
project files. For example, to generate a project for VS2008:
> premake4.exe --with-tests --with-demos vs2008
To see a complete list of options use:
> premake4.exe --help
Note that Visual Studio 6 is not supported and users are advised to upgrade
to at least Visual Studio 2005 Express (it's free!)
Using CMake is another option for generating project files for Visual Studio.
See section 5 below for more details on this.
2. BUILDING WITH AUTOTOOLS (Linux, OS X, MSYS, etc.)
====================================================
2.1 FROM SUBVERSION REPOSITORY
------------------------------
If you downloaded the source code from Subversion you must bootstrap the
process by running the command:
$ ./bootstrap
For this command to work you need a set of tools typically available
on BSD and Linux distributions with development packages installed. OS X
users may need to manually install libtool, autoconf, automake,
pkg-config, and maybe some more.
If you downloaded a source code package from SourceForge this has
already been done for you. You may see some "underquoted definition"
warnings depending on your platform, these are (for now) harmless
warnings regarding scripts from other m4 installed packages.
2.2 FROM A RELEASED TARBALL
---------------------------
First extract the archive (e.g. tar xvfz <filename.tar.gz>) and enter
the created directory (ode-x.y).
Run the configure script to autodetect your build environment:
$ ./configure
By default this will build ODE as a static library with single-precision
math, trimesh support with OPCODE, and debug symbols enabled. You can
modify these defaults by passing additional parameters to
configure. For a full list of available options, type:
$ ./configure --help
Some of the more popular options are
--enable-double-precision enable double-precision math
--with-trimesh=none disables the trimesh support
--with-trimesh=opcode use OPCODE for trimesh code
--with-trimesh=gimpact use GIMPACT for trimesh code
--enabled-shared builds a shared library
To pass specific flags for an optimized build, you must do so
in the CFLAGS and CXXFLAGS enviroment variables, or as arguments
to ./configure. For example if you are building for an athlon xp processor
and you want the compiler to use SSE instructions you can run configure as
follows:
$ ./configure CFLAGS="-msse -march=atlon-xp" CXXFLAGS="-msse -march=atlon-xp"
Note that you must set both CFLAGS and CXXFLAGS as ODE contains a mixture of
C and C++ files.
Once configure has run successfully, build and install ODE:
$ make
$ make install
The latter command will also create a pkg-config script that provides
compilation and linking flags for programs. The old stand-alone
"ode-config" script is also installed for compatibility.
3. BUILDING WITH Code::Blocks
=============================
Because Code::Blocks supports so many different platforms, we do not
provide workspaces. Instead, use Premake to create a workspace tailored
for your platform and project. Like so:
$ cd build
$ premake4 --with-tests --with-demos codeblocks
To see a complete list of options:
$ cd build
$ premake4 --help
Using CMake is another option for generating project files for Code::Blocks.
See section 5 below for more details on this.
4. BUILDING WITH SOMETHING ELSE
===============================
ODE uses the Premake tool to provide support for several different toolsets.
Premake adds support for new toolsets on a regular basis, so yours might be
supported. Check the Premake website at http://premake.sourceforge.net/,
and then follow the directions for Code::Blocks above, substituting your
toolset target in place of `codeblocks`.
Using CMake is another option for generating project files for other
toolsets. See section 5 below for more details on this.
5. BUILDING WITH CMAKE
======================
ODE includes support for CMake to generate project files for various platforms
and IDEs including Unix Makefiles, Ninja, Code::Blocks, Visual Studio. A full
overview of all supported generators can be found at the latest version of the
manual at https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html
CMake supports and encourages out-of-source builds. In order to generate build
files for your platform, create a build directory at your preferred location
and then call CMake with the path to ODE's source directory as argument, e.g.,
one level above the source directory:
$ cd ..
$ mkdir ode-build
$ cmake ../ode-src
The existing build directory in the source directory can also be used as a
location for the project files. A different generator than the default one
for the system can be specified as well:
$ cd build
$ cmake -G"Visual Studio 15 2017 Win64" ..
QtCreator, CLion, and Visual Studio 2017 also offer the option to open the
source directory with the CMakeLists.txt file directly in the IDE.