On Tue, Feb 24, 2009 at 8:48 PM, Andrea Tagliasacchi <a...@cs.sfu.ca> wrote:

> This is a bit odd to me. Why would not everything be required?
> Are there situations in which you might not need a package?
>
> Maybe I can answer my own question...
>
> If you have 2 libraries A and B that do the same task maybe you can
> use different compile rules like you showed below, while if A is the only
> one, then "REQUIRED" gives the trick.


It all depends on the needs of the software really and also how it's
designed.  Many software projects have no need for optional dependencies but
others would be extremely annoying to build without them because every
dependency would have to be available on every platform in order to compile
& link the project.

Since you appear to be doing 3D work, a good example of optional
dependencies in action could be the OpenSceneGraph's plugin architecture.
By creating well defined interfaces up front, they have made it so that the
project can be built with very few mandatory dependencies (OpenGL and GLUT
are the only two IIRC).  All of the 3rd party dependencies they've added
along the way have been made optional (libpng, libjpeg, libtiff,
libfreetype, libcurl, libgdal, etc.) through their plugin API.  If libpng
isn't available at build time (for whatever reason) the png plugin simply
isn't built.  It can always be built and dropped into the system later
through the magic of dynamic linking.

http://www.openscenegraph.org/projects/osg/browser/OpenSceneGraph/trunk/src/osgPlugins


-- 
Philip Lowman
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to