OctoMap/octomap — pull request #66 by codingcasp (2014-07-03 09:49:33+00:00)
Title: Adding CMAKE option to choose if octovis&dynamicEDT3D should be built (BUILD_OCTOVIS_SUBPROJECT)

As suggested in issue #65 (https://github.com/OctoMap/octomap/issues/65) I added the following option to the main cmakelists :
**BUILD_OCTOVIS_SUBPROJECT**

If it's ON (*default*) everything remains the same behaviour as people expect it.
If it's turned off, only the octomap project will be built and missing QGLViewer and/or OpenGL are not an issue. For standalone builds this is the same as running cmake from the subfolder octomap/octomap/.

But it comes in handy when octomap is used as an external project in a
cmake-project, then the option can be passed in the cmake_args, e.g. :

>ExternalProject_Add(
>	octomap-1.6.6
>	URL https://github.com/OctoMap/octomap/archive/v1.6.6.tar.gz
> CMAKE_ARGS -DBUILD_OCTOVIS_SUBPROJECT=OFF
>)

This allows to download the project from GitHub instead of having to package the octomap subfolder on it's own with the project and not having to write any CMAKE syntax that refers to hardcoded folder structures which could be subject to change.

I tested it on CMAKE 2.8 on a windows system.

CMAKE option command : (http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:option)