Commit Graph

169 Commits

Author SHA1 Message Date
Roland Kaufmann
6ad5ebeffe Install debug files
As part of a -dev package, we would like to install the debug symbols
together with the headers.
2013-02-11 22:38:00 +01:00
Roland Kaufmann
e46d950739 Provide backward-compatibility modules for older CMakes
BLAS module originally required Fortran to be enabled, newer module
doesn't; LAPACK module had some spelling errors that prevented it
from working; and cmake_push_check_state() is not available before
2.8.6.
2013-02-11 22:38:00 +01:00
Roland Kaufmann
4522ebbef3 Use relative path function instead of string manip.
This rest-of-string functionality is not supported by older CMakes
anyway.
2013-02-11 22:38:00 +01:00
Roland Kaufmann
90d30bee90 Disallow source files with leading period
These tend to be backup files (on the form .#*#), and anyway CMake will
later consider them to not have a proper filename stem (everything is
part of the extension), leading to all sorts of strange errors.
2013-02-11 22:37:59 +01:00
Roland Kaufmann
6a92569070 Use custom version scheme instead of fragile CMake one
CMake will not be able to make sense out of the YYYY.MM versioning
convention (since the "major" versions are not related), and we
expect API breakage in the short term anyway.
2013-02-11 22:37:59 +01:00
Roland Kaufmann
4aa523e534 Only compile in support for solvers that are found 2013-02-11 22:37:59 +01:00
Roland Kaufmann
6ec0767239 Use system TinyXML if available; otherwise our own 2013-02-11 22:37:59 +01:00
Roland Kaufmann
eaac6631e2 Disable generation of LaTeX/PDF documentation
Class listings are impractical in PDF format. Instead, the tutorial
alone could perhaps be published in PDF.
2013-02-11 22:37:59 +01:00
Roland Kaufmann
2c31bee5dd Support arch.-indep. libraries files for 64-bit sys.
Fedora uses lib64/ for architecture-independent files on 64-bit systems,
whereas Debian (which is multi-arch for binaries) uses lib/
2013-02-11 22:37:59 +01:00
Roland Kaufmann
81d98d9434 Add target to run self-tests
`make check` is run by the Debian package creator, so it must be a
supported target in the Makefile. For now this is just the same as
`make tests`, but in the future we may/should/must expand this to
also run the tests and figure out if the output is OK (whereas
`make tests` will continue to only compile them)
2013-02-11 22:37:58 +01:00
Roland Kaufmann
8eb6a70c5e Replace build script with a smart wrapper
If a user simply types `make` it will run in parallel by default, which
is what we want to do in most cases.
2013-02-11 22:37:58 +01:00
Roland Kaufmann
21f524e7a5 Enable support for multi-arch on Debian/Ubuntu 2013-02-11 22:37:58 +01:00
Roland Kaufmann
d193938597 Set version number to 1.0 in anticipation of release
Version numbers for the library follow ABI-style and is independent
of the ones for releases. If the interface breaks, we change the
soversion, regardless of the timing of the releases.
2013-02-11 22:37:58 +01:00
Roland Kaufmann
3e33d132a9 Allow system installation to be used with dunecontrol 2013-02-11 22:37:58 +01:00
Roland Kaufmann
20153000bc Build tests as a separate target
It is very annoying having to build all the tests when you are
testing some code in the main library. Someone downloading the
library probably doesn't need the tests either, so these are left
out of the default target.
2013-02-11 22:37:58 +01:00
Roland Kaufmann
60ea52ade1 Provide distclean target to remove CMake artifacts
If you are building in-tree (which is commonly done by dunecontrol),
it can be advantageous to have a target which is capable of cleaning
out all the files that CMake left without having to erase the entire
folder.
2013-02-11 22:37:57 +01:00
Roland Kaufmann
773e645ac0 Keep build dir tidy by relocating Fortran modules
If we are building in-source, we don't want to have a bunch of output
files in the root directory; instead we put them in CMakeFiles/ where
all the rest of the object files go.
2013-02-11 22:37:57 +01:00
Roland Kaufmann
8c808e7262 Explain why globs can be used to enumerate source code
The documentation argues against it, but I believe it uses flawed
reasoning.
2013-02-11 22:37:57 +01:00
Roland Kaufmann
8ce114df89 Make documentation installable
If `make install` is run, the document is included if and only if
it has already been built. If `make install-html` is run, then the
documentation is always generated first, before installation. To
build the documentation separately from installation use `make doc`
2013-02-11 22:37:57 +01:00
Roland Kaufmann
ffe00180a6 Generate documentation in a custom target
The targets are named after the similar targets when using Autotools.
2013-02-11 22:37:56 +01:00
Roland Kaufmann
1cb8f4b0e7 Generate customized Doxyfile for each build 2013-02-11 22:37:56 +01:00
Roland Kaufmann
34702606ca Make building libraries static or shared selectable
Default is still to make a shared object because this is the most
versatile target (it can be included in other shared objects as well
as executables).

Note that due to limitations in CMake, either a shared or a static
library can be built, but not both. (This is due to the fact that on
Windows, an import library has the same name as a static library).
2013-02-11 22:37:56 +01:00
Roland Kaufmann
f4f78bf163 Don't strip debug symbols from libraries
Infer the type of library from the target and only activate debug symbol
stripping if it is an executable format. Note that this changes the
signature of the strip_debug_symbols macro.
2013-02-11 22:37:56 +01:00
Roland Kaufmann
79553333da Search for ERT and include in build if found
If the OpenMP flag is added to the build, this should probably be
propagated to the user programs as well.
2013-02-11 22:37:56 +01:00
Roland Kaufmann
02a9e13d75 Compile and link Algebraic Multigrid, if available
If the path to Notay's AGMG library is provided through the cache
variable AGMG_ROOT, then include this in the build and enable the
test.

It would have been desirable to use the variable name AGMG_DIR for
consistency with the other modules, but unfortunately this name
will alter the functionality of CMake's find_package.
2013-02-11 22:37:55 +01:00
Roland Kaufmann
c387e04069 Don't expand variables for test
Use only expansion when comparing the variable against a literal, not
when comparing for logical true or if defined.
2013-02-11 22:37:55 +01:00
Roland Kaufmann
9bd3f186d2 Do list cleanup in find routine
Although this amounts to some double work, it doesn't make the
configuration noticeably slower, and it ensures that the lists are
always cleaned up (in a proper way).
2013-02-11 22:37:55 +01:00
Roland Kaufmann
2fc5a6349e Probe for C99 standard available
Similar to the -std=c++0x flag for C++ code, we probe for, and add if
available, -std=c99 for C code, since the compiler may generate
different initialization code for this variant.

The reporting from the bundled CMake modules is not as polished as for
probing for C++ flags, but not bad enough to warrant rewriting the code
from scratch just to fix the output.
2013-02-11 22:37:55 +01:00
Roland Kaufmann
0e88d99c50 Write version file so user can specify lower bound
With the version file present, a user program can depend on a certain
version of the library.
2013-02-11 22:37:55 +01:00
Roland Kaufmann
9942dcc8d9 Install config mode CMake module at installation
find_package only searches for FindXxx-modules in the path specified by
CMAKE_MODULE_PATH; other paths are supposed to contain config-mode
modules (much like pkgconfig).

Generate the config-mode module in the installation directory using the
same template as is used for the one in the build directory, only
selectively swapping some directories in the relevant variables.
2013-02-11 22:37:55 +01:00
Roland Kaufmann
944eaf43cc C++11 is only recommended, not required
If we don't have a C++11 compiler, we won't be able to build DUNE, but
opm-core is still usable with for instance UMFPACK. However, if it *is*
available, it should be used to improve the ABI compatibility with other
parts of the suite.
2013-02-11 22:37:55 +01:00
Roland Kaufmann
fc3941d982 Add compiler options that may make the builds faster
Sometimes compiler options can help doing faster builds; for GCC the
pipe option will help interleave the various stages of the build.
2013-02-11 22:37:54 +01:00
Roland Kaufmann
34138223e8 Install the library and headers
Enables running `make && make install` on a target system. Documentation
is not yet built or installed.
2013-02-11 22:37:54 +01:00
Roland Kaufmann
a4ea84cd89 Sources are named after library, not project
All targets in the project uses variables defined on a "project" basis
whereas only a specific target uses variables named after it.
2013-02-11 22:37:54 +01:00
Roland Kaufmann
d79c2d2fed Rename version variables 2013-02-11 22:37:54 +01:00
Roland Kaufmann
8cf610e53a Remove superfluous definitions 2013-02-11 22:37:54 +01:00
Roland Kaufmann
2d3ed1cc27 Write snapshot of probes to config-mode module
Put everything the user needs to link to the opm-core library into the
config-mode file, including result of probes. If this conflicts with
other packages, that is a configuration issue that must be resolved
anyway.

The advantage of doing it like this is that the user can build against
the library without knowing how it was configured; the only thing that
must be provided is the path to the config-mode module!
2013-02-11 22:37:54 +01:00
Roland Kaufmann
8234959abe Write config variables in either C++ or CMake syntax
We need the list of variables to put in config.h for the CMake config-
mode module; reuse the code that writes the list to config.h in the
first place to also write CMake-compatible lines.
2013-02-11 22:37:54 +01:00
Roland Kaufmann
e62f4a1b69 Separate defines for this library from those of deps
This makes it easier to write this list to the config-mode module and
let it merge with those from dependencies in the user's program
(although that implies that we no longer pretend that inconsistencies
are not possible).

The convention that singular form contains values for this project
alone whereas plural form contains values for both this project and
dependencies, is used.
2013-02-11 22:37:54 +01:00
Roland Kaufmann
ccb85102e8 Use declarative list of dependencies instead of functions 2013-02-11 22:37:54 +01:00
Roland Kaufmann
0deeef0127 Rename macro modules
Modules that starts with the prefix "Use" alters the build to enable
something by default, whereas modules that only provide functionality
is not common to start with that prefix.
2013-02-11 22:37:53 +01:00
Roland Kaufmann
5f84bf718b Add library search directories to linker options
Some older packages, and notably those that are detected by PkgConfig,
only give library names and then a list of library search directories.

Add to link_directories here in order to support this configuration,
even though it is deprecated in newer versions of CMake.
2013-02-11 22:37:53 +01:00
Roland Kaufmann
42df5fdbd3 Config-mode CMake file
Users should be able to point their opm-core_DIR to the build tree of
this project and have their client programs pick up all the necessary
settings to use the library. The config mode file helps to bridge
variables from one build (of opm-core) to another (of client program).
2013-02-11 22:37:50 +01:00
Roland Kaufmann
871f6e90f1 Debug build by default
In this stage of development it is assumed that having a build that is
easy to debug from within an IDE has the most value for most users.

If any speed comparisons are to be done, be sure to configure with
-DCMAKE_BUILD_TYPE=Release
2013-02-11 22:36:49 +01:00
Roland Kaufmann
bc8a6a0027 Enable all warnings 2013-02-11 22:36:49 +01:00
Roland Kaufmann
8e9325659a Enable optimization 2013-02-11 22:36:49 +01:00
Roland Kaufmann
6c37e94056 Enable debugging support 2013-02-11 22:36:49 +01:00
Roland Kaufmann
d37e7740bd Remove test when the feature is not available 2013-02-11 22:36:49 +01:00
Roland Kaufmann
6aae2aeda4 Compile programs in the tests/ directory 2013-02-11 22:36:49 +01:00
Roland Kaufmann
2a653ab51a Link with DUNE if available 2013-02-11 22:36:48 +01:00