jrl-umi3218/jrl-cmakemodules — pull request #16 by sbarthelemy (2012-10-12 10:20:35+00:00)
Title: make jrl-cmake path-independent

currently users install jrl-cmake in the "cmake" subdirectory of their
project and do:

INCLUDE(cmake/base.cmake)

with this commit, they can install jrl-cmake system-wide and then do:

FIND_PACKAGE(jrl-cmake REQUIRED HINTS cmake)
INCLUDE(${jrl-cmake_DIR}/base.cmake)

The jrl-cmake package will be searched for at standard locations
(/usr/local/share/cmake/jrl-cmake/, in toolchains, see the find_package
documentation for more details) and in the "cmake" subdirectory, as usual.
A user can also directly set the jrl-cmake_DIR variable, find_package will
use it (and not overwrite it).

Note that doing

INCLUDE(cmake/base.cmake)

is still ok, since base.cmake will set jrl-cmake_DIR when needed.

This feature lets jrl-cmake be handled (packaged, installed) just like
any dependency. In particular, it enables users to not use the git
submodule (just install jrl-cmake system-wide and do not init the submodule)
which is important for buildfarms with flacky connection to the Internet.

This commit also adds install rules for jrl-cmake. To install jrl-cmake in
/usr/local/share/cmake/jrl-cmake/, just do

git clone https://github.com/jrl-umi3218/jrl-cmakemodules.git
cd jrl-cmakemodules
mkdir build
cd build
cmake ..
sudo make install

epilog: I checked it works when installed system-wide and otherwise, but my test did not cover much of the feature set since I do not use much of them (I cannot guarantee that, say doxygen still works).