Traditionally, options are put before any other command-line arguments.
However, dunecontrol puts variable assignment before options, like env,
and this confuses getopt.
This variant (based on a suggestion by Andreas Lauser) collects the
variables into an array at the same time as the options are processed.
Follow the guidelines in
<http://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/
html_node/Option-Checking.html#Option-Checking>
and print a *warning* if there is an unknown --enable-* or --with-*
option, error otherwise. --disable-option-checking does not turn off the
errors, but silences the warnings.
dunecontrol looks for a dune.module to determine whether a directory
contains a module or not. By copying this file to the build tree, we
can use (out-of-source!) build trees in dunecontrol too.
If the files for ERT is not found, then the find module cheats and
indicates that it didn't compile either (since there are some later
tests for HAVE_ERT).
However, erraneously, it gave this variable the value 0, which tests
for false in the CMake code but not in the #ifdef checks in the C++
code. This error is cancelled in opm-core by the fact that it didn't
store it as a cache variable, but resurfaced in opm-polymer when it
probes the second time (as both opm-core as a dependency and
opm-polymer itself declare a dependency on ERT).
It is now stored in a way that should be satisfactory to both
projects.
There were (at least) three implementations of the same macro; these
have been collected into a separate helper module. (Note that this
means that FindERT is now not completely stand-alone anymore).
If you specified options in an environment variable containing a blank
at the end, then this would not compare equal to the other candidate,
which was stripped, causing the first added argument to drop out! This
is usually the flag for C++11 compliance, causing binary incompatibility
The previous version did the test and setting of the config variable
right, but reported that the module was found only if the files were
located, independently of the result of the compile.
If we are going to set e.g. CXXFLAGS to more than one value, the
quotes must be preserved at the same time as the list is laundered
(for autotools-variables)
When generating the config.h configuration file, write to a temporary
first and then rename afterward to avoid touching the file and thus
triggering a complete rebuild (of everything that includes config.h)
unnecessarily.
Files which constitutes compilation units are now specified explicitly
in the file CMakeLists_files.cmake rather than identified through a
glob. If this file is updated, a reconfigure should be triggered.
This also enables us to specify exactly which headers that should be
distributed as part of the installation package, and which programs
that should be used for unit testing.
dunecontrol will specify --with-* for each and every module that is
listed as a dependency in dune.module; there is no difference between
them because they all share the same code :-)