OPM/ewoms — pull request #3 by rolk (2012-10-31 10:08:44+00:00)
Title: Provide config mode CMake files

As things are now, clients can just include eWoms directly:

set (Ewoms_INCLUDE_DIRS "../ewoms" CACHE LOCATION "Source tree of eWoms")
include_directories (${Ewoms_INCLUDE_DIR})

However, if one were to follow the standard idiom for including external packages it would be:

set (Ewoms_DIR "../ewoms" CACHE LOCATION "Build tree of eWoms")
find_package (Ewoms)

This changeset provides a config-mode .cmake file for eWoms so that both there approaches are possible.

There are a couple of things that can be discussed about the patch:

(1) Capitalization; should CMake variables have names EWOMS_xxx, eWoms_xxx, ewoms_xxx or Ewoms_xxx. No particular good precedent seems to exists: all variants are in the wild :-(

(2) Definitions from config.h; even if eWoms itself could be built with some option enabled, I landed on using only the options from the custom project's config.h. Since there are no binary package to be linked, the source code of eWoms will of course be able to adapt.

(3) The config mode file sets a bunch of variables which are usually provided but not really needed in this case -- only the include path must be propagated. I have done this to keep the option open.