Comment 1 for bug 772640

Revision history for this message
toby schneider (tes) wrote :

I have written a much better FindMOOS.cmake for the (new) LAMSS project (https://launchpad.net/lamss).

Could you take a look at it and give your opinion (attached)? I've gone to a different style of Find*.cmake scripts. First I find a single component, then find all the rest in the location found by the first.

In the case of MOOS, I find libMOOS.a/so and then find the rest of MOOS from that location. It now searches /opt /opt/local in addition to a few other hard coded guesses, and the Unix system defaults that CMake adds (/usr, /, /usr/local). In all these paths, it looks for the suffix "moos-ivp/MOOS/MOOSBin", "MOOS/MOOSBin", "src/moos-ivp/MOOS/MOOSBin", or "src/MOOS/MOOSBin" which should cover most of your scenarios.

If that fails, you can also set the MOOS_ROOT_DIR to the path e.g. "/opt/local/MOOS".

For reference, http://www.cmake.org/cmake/help/cmake2.6docs.html#command:find_library explains CMake's search in gory detail.

Advice is welcome.