Skip to content

Latest commit

 

History

History
29 lines (17 loc) · 2.41 KB

cmake.md

File metadata and controls

29 lines (17 loc) · 2.41 KB

CMake

cmake is an open-source, cross-platform build system and project generator. It's used by OSVR and its dependencies, and is recommended for both client and plugin use.

Version 3.0.2 (included in the Boxstarter packages as of this writing) is recommended as a minimum.

This is a good http://www.cmake.org/cmake/help/v3.1/manual/cmake-buildsystem.7.html|overall, reasonably complete description of CMake usage from the CMake documentation.

Note that if you're writing an OSVR plugin, there is a wrapper function around ''add_library'' that handles default linking, naming, build directories, and install directories: see the example for details. The first argument, however, is a target name just like ''add_library'' so your build system can be extended beyond the example as far as needed.

Writing Find Modules

If you're writing a new driver that has to link against external software, you'll need to tell CMake how to find it. (If you're writing a client, you can probably skip this section unless you'd like to learn more about using CMake)

If you control the external software and/or it's built with CMake, the preferred route is to export targets with a "config"/package file (this is what OSVR-Core does).

If you don't control the external software, you can write a "Find Module." The style for these has evolved over time, but the latest recommendations are to mimic the behavior of config-file mode closely.

Other Resources