Adding drivers to Player 3

From The Player Project

Jump to: navigation, search
Line 1: Line 1:
-
= Adding a driver to Player 3 =
+
= Driver source code =
-
== Driver source code ==
+
See example. More needs to be written here.
See example. More needs to be written here.
-
== Build the driver ==
+
= Build the driver =
Player 3 uses [http://cmake.org CMake] for its build system. CMake is a modern, cross-platform build system. For details on general use of CMake, see the [http://cmake.org/cmake/help/cmake2.6docs.html CMake documentation] and the [http://www.cmake.org/Wiki/CMake CMake wiki].
Player 3 uses [http://cmake.org CMake] for its build system. CMake is a modern, cross-platform build system. For details on general use of CMake, see the [http://cmake.org/cmake/help/cmake2.6docs.html CMake documentation] and the [http://www.cmake.org/Wiki/CMake CMake wiki].
Line 32: Line 31:
There are many other macros that can also be used to set up a driver's compilation. These perform functions such as searching for libraries, finding include paths, and similar. See below for a full documented list of these macros. In addition, any normal CMake commands can be used between the calls to PLAYERDRIVER_OPTION() and PLAYERDRIVER_ADD_DRIVER(). There are numerous examples in the drivers already present in Player, many of which perform many checks to find the information they need to compile. Look at other CMakeLists.txt files for examples when writing your own.
There are many other macros that can also be used to set up a driver's compilation. These perform functions such as searching for libraries, finding include paths, and similar. See below for a full documented list of these macros. In addition, any normal CMake commands can be used between the calls to PLAYERDRIVER_OPTION() and PLAYERDRIVER_ADD_DRIVER(). There are numerous examples in the drivers already present in Player, many of which perform many checks to find the information they need to compile. Look at other CMakeLists.txt files for examples when writing your own.
-
== Player's driver macros ==
+
= Player's driver macros =
-
=== PLAYERDRIVER_ADD_DRIVER ===
+
== PLAYERDRIVER_ADD_DRIVER ==
'''PLAYERDRIVER_ADD_DRIVER (_name _cumulativeVar <variable args>)'''
'''PLAYERDRIVER_ADD_DRIVER (_name _cumulativeVar <variable args>)'''
Line 50: Line 49:
:The option used in the called CMakeLists.txt to check if the driver has been enabled.
:The option used in the called CMakeLists.txt to check if the driver has been enabled.
-
=== PLAYERDRIVER_ADD_EXTRA ===
+
== PLAYERDRIVER_ADD_EXTRA ==
'''PLAYERDRIVER_ADD_EXTRA (_name)'''
'''PLAYERDRIVER_ADD_EXTRA (_name)'''
Line 61: Line 60:
CFLAGS <compile flags list>
CFLAGS <compile flags list>
-
=== PLAYERDRIVER_OPTION ===
+
== PLAYERDRIVER_OPTION ==
'''PLAYERDRIVER_OPTION (_name _cumulativeVar _defaultValue [reason])'''
'''PLAYERDRIVER_OPTION (_name _cumulativeVar _defaultValue [reason])'''
Line 77: Line 76:
:Give a reason for disabling to the user. If not provided, a standard reason will be given.
:Give a reason for disabling to the user. If not provided, a standard reason will be given.
-
=== PLAYERDRIVER_REQUIRE_OS ===
+
== PLAYERDRIVER_REQUIRE_OS ==
'''PLAYERDRIVER_REQUIRE_OS (_name _cumulativeVar <variable args>)'''
'''PLAYERDRIVER_REQUIRE_OS (_name _cumulativeVar <variable args>)'''
Line 90: Line 89:
:OS variables to check for (see FindOS.cmake in the cmake/internal/ dir for a list of what variable is set on each OS).
:OS variables to check for (see FindOS.cmake in the cmake/internal/ dir for a list of what variable is set on each OS).
-
=== PLAYERDRIVER_REJECT_OS ===
+
== PLAYERDRIVER_REJECT_OS ==
'''PLAYERDRIVER_REJECT_OS (_name _cumulativeVar <variable args>)'''
'''PLAYERDRIVER_REJECT_OS (_name _cumulativeVar <variable args>)'''
Line 103: Line 102:
:OS variables to check for (see FindOS.cmake in the cmake/internal/ dir for a list of what variable is set on each OS).
:OS variables to check for (see FindOS.cmake in the cmake/internal/ dir for a list of what variable is set on each OS).
-
=== PLAYERDRIVER_REQUIRE_PKG ===
+
== PLAYERDRIVER_REQUIRE_PKG ==
'''PLAYERDRIVER_REQUIRE_PKG (_name _cumulativeVar _package _includeDirs _libDirs _linkLibs _linkFlags _cFlags [_version])'''
'''PLAYERDRIVER_REQUIRE_PKG (_name _cumulativeVar _package _includeDirs _libDirs _linkLibs _linkFlags _cFlags [_version])'''
Line 126: Line 125:
:Name of the variable to receive the compile flags.
:Name of the variable to receive the compile flags.
-
=== PLAYERDRIVER_REQUIRE_HEADER ===
+
== PLAYERDRIVER_REQUIRE_HEADER ==
'''PLAYERDRIVER_REQUIRE_HEADER (_name _cumulativeVar _header)'''
'''PLAYERDRIVER_REQUIRE_HEADER (_name _cumulativeVar _header)'''
Line 139: Line 138:
:Name of the header file to look for.
:Name of the header file to look for.
-
=== PLAYERDRIVER_REQUIRE_HEADER_CPP ===
+
== PLAYERDRIVER_REQUIRE_HEADER_CPP ==
'''PLAYERDRIVER_REQUIRE_HEADER_CPP (_name _cumulativeVar _header)'''
'''PLAYERDRIVER_REQUIRE_HEADER_CPP (_name _cumulativeVar _header)'''
Line 152: Line 151:
:Name of the header file to look for.
:Name of the header file to look for.
-
=== PLAYERDRIVER_REQUIRE_FUNCTION ===
+
== PLAYERDRIVER_REQUIRE_FUNCTION ==
'''PLAYERDRIVER_REQUIRE_FUNCTION (_name _cumulativeVar _function)'''
'''PLAYERDRIVER_REQUIRE_FUNCTION (_name _cumulativeVar _function)'''
Line 165: Line 164:
:Name of the function to look for.
:Name of the function to look for.
-
=== PLAYERDRIVER_REQUIRE_LIB ===
+
== PLAYERDRIVER_REQUIRE_LIB ==
'''PLAYERDRIVER_REQUIRE_LIB (_name _cumulativeVar _library _function _path)'''
'''PLAYERDRIVER_REQUIRE_LIB (_name _cumulativeVar _library _function _path)'''
Line 182: Line 181:
:Location where the library is expected to be.
:Location where the library is expected to be.
-
=== PLAYERDRIVER_ADD_DEFINEOPTION ===
+
== PLAYERDRIVER_ADD_DEFINEOPTION ==
'''PLAYERDRIVER_ADD_DEFINEOPTION (_cumulativeVar _option _defaultValue _type _desc)'''
'''PLAYERDRIVER_ADD_DEFINEOPTION (_cumulativeVar _option _defaultValue _type _desc)'''

Revision as of 05:40, 29 June 2009

Personal tools