Yesterday I added several new CMake modules to the build system. These
are not actually used at build time; they get installed into the system
and are used by client and plugin writers. Client and plugin
CMakeLists.txt files can import these modules and get pretty much
everything they need to build against Player predefined in a nice handy
macro. The files get installed to share/cmake/Modules/ under the install
prefix, so if you install to /usr they'll already be in your CMake
modules search path (otherwise you need to add where they get installed
to the search path in some way - adding it as an environment variable is
the best way).
I'll write a wiki page about how to compile clients and plugins when I'm
less tired. For now, all the examples now get installed with working
CMakeLists.txt files that you can look at for reference. You'll find
them under share/player/examples/. For an example:
Note that the plugin interfaces don't actually compile using the macro
yet, I ran out of time yesterday to finish that one off.
This is now finished. Plugin interfaces can be compiled using the
installed CMake module UsePlayerPlugin.cmake.
Geoffrey Biggs wrote:
> Note that the plugin interfaces don't actually compile using the macro
> yet, I ran out of time yesterday to finish that one off.
Continuing this theme, I've just checked in a change to the macros used
to add drivers. The PLAYERDRIVER_ADD_DRIVER_SIMPLE macro, which was used
if you had a driver that didn't need things like extra compile flags or
libraries, is now gone, as it is no longer necessary.
The PLAYERDRIVER_ADD_DRIVER macro no longer requires the four arguments
(include dirs, lib dirs, link flags and cflags) are always specified,
even if empty. The new way to call this macro uses a keyworded argument
list of any length. 5 keywords are used to specify the different things
being passed to the macro: SOURCES, INCLUDEDIRS, LIBDIRS, LINKFLAGS, and
CFLAGS. They can appear in any order and should be followed by a list of
arguments that correspond to those keywords. This makes the macro much
more flexible and the CMakeLists.txt files much cleaner.
It's a fairly simple concept, but have a look through the driver
CMakeLists.txt files for examples if you get lost.
In addition, I've made the same change to the macros in the installed
modules used for client and plugin compiling, but as I doubt anyone has
started using those yet I don't think that's going to cause much
> This is now finished. Plugin interfaces can be compiled using the
> installed CMake module UsePlayerPlugin.cmake.
> Geoffrey Biggs wrote:
>> Note that the plugin interfaces don't actually compile using the macro
>> yet, I ran out of time yesterday to finish that one off.